Repository navigation
Remove the vocabulary modules in nameparser.config (#1007) - #1012
Merged
Merged
Conversation
derek73
added a commit
that referenced
this pull request
Nov 3, 2026
The table's only TITLES row named it with TITLES_AMBIGUOUS, whose words() call returns 816 words where TITLES held 786, and the coverage test passed on the name alone. Each is now a comprehension the test runs (a title word with a given reading and no particle reading is ambiguous), and the test asks every constant for a row of its own. The removal row for 2.2's names no longer offers names this PR removes, the #357 release bullet no longer says the word lists stay, the decisions entry drops its miscount, and AGENTS.md's sub-set recipe and set list match the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
added a commit
that referenced
this pull request
Nov 3, 2026
…claim (#1012 review) 2.8.1 warns where code reads a constant of a removed vocabulary module, never at a bare import, so migrate.rst's "Finding the sites" says to upgrade to 2.8.1, lists the bare import among what passes and still fails, and adds the eight modules to the search list. Three sites still claimed one call per constant where TITLE_PHRASES has none and several are comprehensions; the release bullet no longer pairs TITLES with a call returning more words; AGENTS.md's layering example names a module that exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nameparser.config.titles, suffixes, particles, conjunctions, bound_given_names, given_names, maiden_markers and capitalization were each a row of `NAME = _compiled.NAME` assignments under a docstring that restated the rules, rendered as API reference and checked by nothing. In 3.0 their sets are an implementation detail of configuring by reading, so they go, and a caller lists a kind's words with Lexicon.words(kind=...) (#1009). 2.8.1 warns where code reads one of their constants. nameparser.config keeps surnames (now with an __all__); Lexicon.default() reads CAPITALIZATION_EXCEPTIONS from _compiled, and tools/vocab/build.py's roster is a list of names. docs/migrate.rst gives a call or a comprehension per 2.x constant, and a test runs each against the compiled set it replaces and requires a row per constant; its "Finding the sites" names the modules. customize.rst, usage.rst, modules.rst, the vocab README, AGENTS.md's configuration section and mechanisms.md's recipe say what replaces the modules. decisions/3-0-reevaluations records the removal and the 2.8.1 that warns of it, superseding the #357 entry's modules staying and the Lexicon-warning waiver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73
force-pushed
the
feat/issue-1007-remove-vocab-modules
branch
from
November 3, 2026 04:17
410f2aa to
3f8f577
Compare
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1007. Decided in chat 2026-11-02.
Merges before 2.8.1 is released, after #1010. 2.8.1 (#1011, on
2.x) carries the deprecation warning for this removal, and its messages link to the 3.0 migration guide this PR writes, so master gets it first (decided in chat); 3.0 is not released before 2.8.1.What goes, what replaces it
These eight modules are removed:
nameparser.config.titlesnameparser.config.suffixesnameparser.config.particlesnameparser.config.conjunctionsnameparser.config.bound_given_namesnameparser.config.given_namesnameparser.config.maiden_markersnameparser.config.capitalizationEach was a row of
NAME = _compiled.NAMEassignments under a docstring that restated the rules. Those docstrings rendered as API reference and no test checked them.The replacement is
Lexicon.words(kind=..., **properties), merged in #1009. docs/migrate.rst gets a "Vocabulary constants → Lexicon.words" table with one call per 2.x constant. A set the compiler derives from a clash between readings is a comprehension overwordsandreadings_of(TITLES_AMBIGUOUSis a title word with a given reading and no particle reading;TITLESis the rest).TITLE_PHRASES, compiled fromattaches, has no spelling, and its row says so.CAPITALIZATION_EXCEPTIONSisdict(Lexicon.default().capitalization_exceptions).nameparser.configkeeps:surnames, which now has__all__, so a star import no longer binds itsassert_normalized;regexeswent with Remove nameparser.config.regexes, which the parser has not read since 2.0 (#1008) #1010.)Code
Lexicon.default()readsCAPITALIZATION_EXCEPTIONSfrom_compiled.tools/vocab/build.py'sCONSTANTSroster is now a plain list of names, with no module column._compiled.py's header says the sets are private, and it is rebuilt._compiled.test_contracts's frozen-constant sweep covers_compiled, with a floor of 24, and names_compiled.CAPITALIZATION_EXCEPTIONSas an exemption. Its quiet-import and star-import tests usesurnames.test_layeringchecks that each of the eight modules raisesModuleNotFoundError.Docs
words()/readings_of().nameparser.config,surnamesandregexes.from nameparser.config.titles import TITLESstill work in 3.0, now thatLexicon.readings_of()answers what a word is? #1007 entry. It supersedes the Remove the 1.x vocabulary names (PREFIXES, FIRST_NAME_TITLES, …) and their bridge #357 entry's "the vocabulary modules stay" and the 2026-10-29 Lexicon-warning waiver, since 2.8.1 carries that warning now. The Standing lines are amended to match.Tests and checks
test_migrate_s_words_call_reproduces_each_2x_constantevaluates each code row of migrate.rst's table against the compiled set it replaces (20 rows).test_migrate_s_table_covers_every_compiled_constantchecks that every 2.x constant has a row of its own, and checks the two-constanttitlerow directly.sphinx-build -b doctest docs(0 failures), the HTML build andpython -m doctest README.rstall pass.snapshot.pymatches the snapshot.pytest -n0 -m serial(the benchmark guards): 42 passed, rerun at a normal load after a first run under load average 30–40 had failed on wall-clock timing.Review
The independent review found no code defects. It found that
TITLEShad no row of its own (the shared row's call returns 816 words againstTITLES' 786, and the coverage test passed on the name alone), a miscount in the decisions entry, two rows contradicting the removal, and stale AGENTS.md recipes; bae8c75 fixes them.Rebased onto #1010
The branch is one commit rebased onto master after #1010 (fbcd08e). The seven conflicting files resolve so that both PRs hold:
nameparser.config's one public module issurnames._compiled.CAPITALIZATION_EXCEPTIONS.regexesand the eight vocabulary modules together: 2.8.1 warns where a constant is read, and a bare import stays quiet.Three AGENTS.md lines that merged without a conflict marker are fixed too: the
regexesbullet, and the public-surface lines that named it.On the rebased tree,
pytest(34895 passed) and the serial benchmarks (42 passed) pass, as do mypy, ruff,build.py --check,snapshot.py,sphinx-build -W -b html, the doc doctests and the README doctest.🤖 Generated with Claude Code