Commit 995bb40
Sweep docs for the relocated script table
Closing sweep for the _SCRIPT_RANGES move to _policy.py. Two stale
spots, both corrected:
- nameparser/_policy.py: _script_matcher's docstring claimed the
closure keeps derived matchers out of test_regex_sync.py's hand-copy
completeness sweep as if that sweep scanned everywhere; it scans a
fixed set of pipeline modules (_assign, _post_rules, _render,
_tokenize, _vocab), which covers _vocab but never _policy or the
packs. Reworded to claim only what holds: the closure spares
_vocab's derived matchers a declaration row in that sweep.
- docs/locales.rst: the contributing contract told authors to declare
DEVIATES but never said how a range-declaring pack builds one, while
test_locales.py now reads any module-level re.Pattern as a marker
regex needing branch coverage and fails a pack importing re without
one. Added the mechanism: build the predicate with _policy's
_script_matcher, the way zh and ja do, never by compiling private
character ranges.
Verified rather than edited: AGENTS.md's test_regex_sync.py line
("wherever the copy lives -- including copies outside the package")
stays true because the differential toml copy in tools/ remains and is
still pinned; its layering line already lists _policy among allowed
pack imports. Acceptance greps: 0x4E00 appears in the package only in
_policy.py's table; the dead symbols (_HAN_RANGES, _JA_RANGES,
_in_repertoire, _SCRIPT_PATTERNS, _JA_PATTERN) are gone from
nameparser/, tests/, and tools/; no pack references _vocab.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent c78adde commit 995bb40
2 files changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
0 commit comments