Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ The compiled sets, read by `Lexicon` (mostly as the `_sets` field of the same na
- the views' kinds — `GENERATION_WORDS`, `CREDENTIAL_WORDS` (a credential written as a word), `HONORIFIC_WORDS` and `PATRONYMIC_PARTICLES` (3.0's 4b and 4c), private: the kinds the other sets do not record, which classify reads to tag a word for the `generation`, `credentials`, `honorifics` and `patronymic` views (rules/R8, rules/R9)
- case masks — `CAPITALIZATION_EXCEPTIONS` mapping of case MASKS (e.g. `{'phd': 'PhD'}`), compiled from the `cased` property, at most one per word: each value is its key's own letters and digits recased, laid over the word as written, so `ph.d.` repairs to `Ph.D.` and repair never writes the value's own punctuation into the word (#459); `Lexicon` raises `ValueError` on a value that spells anything else; and `CAPITALIZED_PARTICLES` (the `saint` and `rank` kinds, private), the particles case repair writes with a capital rather than in lowercase, keyed on the kind so a word needs no mask of its own (rules/R4, #1069), and `CAPITAL_OPENING_PARTICLES` (the particle readings written `capital_opening`, `ter` and `der`, private), the particles case repair writes with a capital where the word before it in the family name is no particle, nor, where it opens the family name, the word written right before it in any role (`Levon Ter Petrosyan`, but `Jan van der Berg` and `Van der Walt`), keyed on a property because `der`'s kind, `article`, is `de`'s and `la`'s too (rules/R12)
- listed spellings — `SAME_AS`, private, read by `Lexicon` as `_same_as` and nowhere in a parse: every `same_as` keyed by the group of its reading's kind (`_reading_index.SAME_AS_GROUPS`: `given` for a given name or a bound given name, `family` for a surname or a particle, `title`, `suffix`), each word with every full form it carries there (`sr` among titles is both `señor` and `senhor`). The name match (`_match.py`) reads each role in its group through `Lexicon._headwords`, every word reachable through the group's links, so a given name's spelling never matches a surname (`Ma, Jack` / `María, Jack` conflict) and a loop is simply all its words (decisions/name-matching, 2026-11-08); and `SAME_AS_NAMED`, per group, the words of it whose name reading's `same_as` stands beside a name reading of the same kind with none, a name of its own too (`jo`), whose links `_headwords` follows only where `_match._spellings` read the word with its trailing period (the 2026-11-08 #1006 follow-up)
- familiar forms — `FAMILIAR`, private, read by `Lexicon` as `_familiar` (through `Lexicon._familiar_forms`) and nowhere in a parse: each `familiar` reading's `short_for`, the longer given names a short one stands for (`max` -> `maximilian`, `maxwell`), every file's together, which `Lexicon` reads both ways (a pair matches whichever way its source wrote it, never chained) and the name match reads as the opt-in `familiar-form`. `familiar` is a category of its own, never a `given` reading, which would move parses where the word is also a title, particle or suffix; a choice neither prefers nor drops by it (`_reading_index.UNPREFERRED`), and `tools/vocab/familiar.py` writes the shipped ones, and the shipped spellings, from `tools/vocab/familiar_reviewed.tsv` alone, the pairs `tools/vocab/familiar_candidates.py` finds in ORCID, a few familiar forms the FEC's filings and Congress's legislators evidence, counted by recipes in decisions/name-matching rather than a committed tool, and the Central and Eastern European and Balkan pairs `tools/vocab/familiar_wikidata.py` finds in Wikidata's people (a birth name beside the label, or a nickname or the label beside the given name, per language; 2026-11-20 #1387), as two readers reviewed them (decisions/name-matching, 2026-11-08 FAMILIAR FORMS, 2026-11-12 ALTERNATE SPELLINGS ARE OPT-IN and 2026-11-13 THE FAMILIAR FORMS FROM DATA ALONE); and `ALTERNATE_SPELLINGS` beside it, each `spelling` reading's `spelling_of`, the given names a name is another spelling of by the person's or a romanization's choice (`olha` of `olga`), read by `Lexicon` as `_alternate` (through `Lexicon._alternate_spellings`) both ways and never chained, and by the name match as the opt-in `alternate-spelling`: a kind of its own, never a `given` reading's `same_as`, which would make the word a name written short and move parses (`GIVEN_NAME_ABBREVIATIONS`)
- familiar forms — `FAMILIAR`, private, read by `Lexicon` as `_familiar` (through `Lexicon._familiar_forms`) and nowhere in a parse: each `familiar` reading's `short_for`, the longer given names a short one stands for (`max` -> `maximilian`, `maxwell`), every file's together, which `Lexicon` reads both ways (a pair matches whichever way its source wrote it, never chained) and the name match reads as the opt-in `familiar-form`. `familiar` is a category of its own, never a `given` reading, which would move parses where the word is also a title, particle or suffix; a choice neither prefers nor drops by it (`_reading_index.UNPREFERRED`), and `tools/vocab/familiar.py` writes the shipped ones, and the shipped spellings, from `tools/vocab/familiar_reviewed.tsv` alone, the pairs `tools/vocab/familiar_candidates.py` finds in ORCID, a few familiar forms the FEC's filings and Congress's legislators evidence, counted by recipes in decisions/name-matching rather than a committed tool, and the Central and Eastern European and Balkan pairs `tools/vocab/familiar_wikidata.py` finds in Wikidata's people (a birth name beside the label, or a nickname or the label beside the given name, per language; 2026-11-20 #1387), and the Brazilian Portuguese pairs `tools/vocab/familiar_tse.py` finds in Brazil's election candidates, a ballot name beside the civil given name it stands for (2026-11-20 #1495), as two readers reviewed them (decisions/name-matching, 2026-11-08 FAMILIAR FORMS, 2026-11-12 ALTERNATE SPELLINGS ARE OPT-IN and 2026-11-13 THE FAMILIAR FORMS FROM DATA ALONE); and `ALTERNATE_SPELLINGS` beside it, each `spelling` reading's `spelling_of`, the given names a name is another spelling of by the person's or a romanization's choice (`olha` of `olga`), read by `Lexicon` as `_alternate` (through `Lexicon._alternate_spellings`) both ways and never chained, and by the name match as the opt-in `alternate-spelling`: a kind of its own, never a `given` reading's `same_as`, which would make the word a name written short and move parses (`GIVEN_NAME_ABBREVIATIONS`)

- the group suggester's tables — `config/_order_names.py`, private, written by `tools/vocab/order_names.py` (`--write`; its hand-kept spelling lists sit above the generated blocks) and read by `_suggest` only, never by a parse or a `Lexicon`: `ROMANIZED_SURNAMES` (zh, ko and vi surnames folded by `_suggest.fold`), `COMMON_GIVEN_NAMES`, and `COMMON_SURNAMES` (#1364, the given names' mirror: family-box words ORCID's holders rarely type as a given name, mostly Spanish), the two surname tables read together as `SURNAMES`. They are not `Lexicon` kinds, so a language choice, `strict=True` and a caller's edit do not reach them and no snapshot moves with them (decisions/group-suggestion, 2026-11-10 TABLES)

Expand Down
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ the sources whose licences ask for credit are credited:
and ``_es_ar_given_names.py``;
- part of ``locales.ZH``'s surnames, selected from Taiwan's Ministry of
the Interior surname ranking (Open Government Data License, version 1),
credited in ``nameparser/locales/zh.py``.
credited in ``nameparser/locales/zh.py``;
- the Brazilian Portuguese familiar forms, measured on the candidate
files of Brazil's Superior Electoral Court, the Tribunal Superior
Eleitoral (Creative Commons Attribution,
https://creativecommons.org/licenses/by/4.0/), credited in
``nameparser/vocab/pt-BR.toml``.

.. |Build Status| image:: https://github.com/derek73/python-nameparser/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/derek73/python-nameparser/actions/workflows/python-package.yml
Expand Down
Loading