vicary 0.2.19 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/assets/pools/given.txt +181 -0
- data/assets/pools/org.txt +20 -0
- data/assets/pools/place.txt +453 -0
- data/assets/pools/school.txt +26 -0
- data/assets/pools/street.txt +27 -0
- data/assets/pools/surname.txt +291 -0
- data/lib/vicary/adlib.rb +1046 -0
- data/lib/vicary/redact.rb +15 -0
- data/lib/vicary/version.rb +1 -1
- data/lib/vicary.rb +1 -0
- metadata +9 -2
data/lib/vicary/redact.rb
CHANGED
|
@@ -148,6 +148,13 @@ module Vicary
|
|
|
148
148
|
relation_refusal = options.fetch(:relation_refusal, true)
|
|
149
149
|
title_relation_refusal = options.fetch(:title_relation_refusal, true)
|
|
150
150
|
|
|
151
|
+
# Adlib renders over the numbered restore map, so it refuses without one
|
|
152
|
+
# rather than ship placeholders under a setting that promised prose.
|
|
153
|
+
rendering = render_mode(options[:render])
|
|
154
|
+
if rendering == RENDER_ADLIB && !number_placeholders
|
|
155
|
+
raise ArgumentError, "adlib rendering needs local mode with numbered placeholders"
|
|
156
|
+
end
|
|
157
|
+
|
|
151
158
|
minter = PlaceholderMinter.new(number: number_placeholders)
|
|
152
159
|
return [text, 0, minter.assigned] if text.nil? || text.empty?
|
|
153
160
|
|
|
@@ -171,6 +178,14 @@ module Vicary
|
|
|
171
178
|
n += count
|
|
172
179
|
end
|
|
173
180
|
|
|
181
|
+
if rendering == RENDER_ADLIB
|
|
182
|
+
# A fourth element, so `masked, n, map = ...` callers keep working; the
|
|
183
|
+
# map is the adlib inverse, `{stand-in: original}`, as in the reference.
|
|
184
|
+
adlib = render_adlib(masked, minter.assigned, text,
|
|
185
|
+
seed: resolve_adlib_seed(options[:adlib_seed]), identity: identity)
|
|
186
|
+
return [adlib.text, n, adlib.restore_map, adlib]
|
|
187
|
+
end
|
|
188
|
+
|
|
174
189
|
[masked, n, minter.assigned]
|
|
175
190
|
end
|
|
176
191
|
|
data/lib/vicary/version.rb
CHANGED
|
@@ -6,5 +6,5 @@ module Vicary
|
|
|
6
6
|
# Shared across all three front doors on purpose: one detector, one number. A
|
|
7
7
|
# gem 0.3.0 that corresponds to nothing on PyPI cannot be reasoned about, and
|
|
8
8
|
# the parity claim is between *versions*, not between package names.
|
|
9
|
-
VERSION = "0.
|
|
9
|
+
VERSION = "0.3.1"
|
|
10
10
|
end
|
data/lib/vicary.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vicary
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Blake Thomas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
Finds the names a student writes about — classmates, teachers, relatives — and
|
|
@@ -25,9 +25,16 @@ files:
|
|
|
25
25
|
- README.md
|
|
26
26
|
- assets/MANIFEST.json
|
|
27
27
|
- assets/notability.txt.gz
|
|
28
|
+
- assets/pools/given.txt
|
|
29
|
+
- assets/pools/org.txt
|
|
30
|
+
- assets/pools/place.txt
|
|
31
|
+
- assets/pools/school.txt
|
|
32
|
+
- assets/pools/street.txt
|
|
33
|
+
- assets/pools/surname.txt
|
|
28
34
|
- assets/stop_words_never_capitalised.txt
|
|
29
35
|
- assets/stop_words_sometimes_capitalised.txt
|
|
30
36
|
- lib/vicary.rb
|
|
37
|
+
- lib/vicary/adlib.rb
|
|
31
38
|
- lib/vicary/asset.rb
|
|
32
39
|
- lib/vicary/candidates.rb
|
|
33
40
|
- lib/vicary/census.rb
|