Repository navigation
Closed
Labels
Milestone
Description
nameparser.config.regexes is public, but the parser reads none of it. Its 19 REGEXES entries configured the v1 parser through CONSTANTS.regexes. Since 2.0, parsing is configured by named Policy fields, and the docs already say both halves:
- docs/customize.rst: editing
REGEXES"is not a supported override. The parser does not readREGEXESat all." - docs/migrate.rst: every
regexes.*entry exceptbidiandemoji"has no 3.0 replacement". Those two becamePolicy(strip_bidi=...)andPolicy(strip_emoji=...).
So the module configures nothing and describes nothing about how a name is parsed. The vocabulary modules beside it raise a related but separate question, in #1007.
What keeping it costs
- A third copy of every pattern the pipeline uses. Layering keeps
_pipeline/and_renderfrom importingnameparser.config, so they hold their own copies.tests/v2/test_regex_sync.pythen pins those copies toconfig/regexes.pyas the "source of truth". That is backwards: the pipeline's copy is the one that parses, and the config copy is the one that exists only to be compared against.Петров Иван Никитичreads family 'Никитич' under locales.RU: Никитич and Саввич are missing from the irregular patronymics #994 edited the East Slavic patronymic pattern in three files where two would have done: the pipeline, the config table, and the RU pack'sDEVIATEScopy, whichtest_locales.pyalready holds to the pipeline. - A mutable dict that looks like configuration. Rename the vocabulary data modules to the 2.0 terminology (prefixes.py → particles.py), with a 2.x deprecation bridge #293's freeze exempts
REGEXES(test_every_vocabulary_constant_is_frozennames it). customize.rst spends a paragraph explaining that editing it does nothing.
Proposed
Remove nameparser/config/regexes.py in 3.0:
- Rework
test_regex_sync.pyto pin each hand copy to the pipeline's copy directly (_render._ROMANto_vocab._ROMAN, and so on). Entries already mapped toNonethere are unaffected. - Drop
regexes.REGEXESfromtest_contracts.py's exempt mappings, and the module from docs/modules.rst's automodule list. - Add a row to migrate.rst's removals saying a caller who reused a pattern should copy it.
- Update customize.rst's freeze paragraph, which then names
CAPITALIZATION_EXCEPTIONSalone. - Reword the "Ported from v1 (nameparser/config/regexes.py ...)" provenance comments in
_vocab.py,_render.pyand_tokenize.pyso they don't point at a file that no longer exists.
Open
- This reverses part of a recorded decision. decisions/3-0-reevaluations's 2026-10-28 Remove the 1.x vocabulary names (PREFIXES, FIRST_NAME_TITLES, …) and their bridge #357 entry lists
regexesamong thenameparser.configmodules that stay in 3.0. Removing it needs a superseding entry there, as would anything Shouldfrom nameparser.config.titles import TITLESstill work in 3.0, now thatLexicon.readings_of()answers what a word is? #1007 decides. - 2.8 gave no warning. 3.0's other removals were announced by 2.8's deprecation warnings; this one was not. The options:
- Remove it in 3.0 with the migrate.rst row. Callers who import a pattern for their own code break, and each fix is a paste.
- Warn on import through a module
__getattr__in 3.0 and remove it in 4.0. This keeps the third copy and the backwards test anchor for a whole major version.
Activity
Review fixes for #1008: tripwires for three unpinned patterns, docs
Say where 2.8.1 warns: on reading a regexes constant, not the import (#…
Remove nameparser.config.regexes (#1008) (#1010)