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
5 changes: 5 additions & 0 deletions docs/design/decisions/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@
- THE COUNTS, recorded on the words (`uv run python tools/name_usage.py Mahdi Bard Bård`, 2026-10-26): `mahdi` given US SSA 2,398 births, Wikidata 141 (a lower bound; Iran 43, Iraq 9), nam_dict band 5 in Arabia/Persia, family Census 1,241, Wikidata 13; `bard` given US SSA 218 (SSA folds `Bård`), Wikidata 10 and 107 more spelled `Bård`, nam_dict band 5 in Norway as `Bård`, family Census 5,953, Wikidata 100. PSC's filers put `Mahdi` in the forename box 84 times as its first word and never in the title box (#853, #867).
- MEASURED (2026-10-26, against master `32049ade`, py3.11, every local check with `--base`). PSC (1,039,174 scored, the fetch dated 2026-10-22): 79 records fixed, none broken, 6 changed, the 6 still disagreeing only because the filer typed two words in the surname box, which the default order reads as middle and family (`Mr MAHDI Aa Aa`, `Aa MAHDI Aa Aa`). ctgov-officials 6 moved, each a `Mahdi Aa, CRED` shape now read with given 'Mahdi'; fec-individuals 20, all fixes: `AA, MAHDI` 10, `AA, BARD` 6, and one each of `AA AA, MAHDI`, `AA, BARD AA`, `AA, BARD A. T` and `BARD AA, AA`, whose family part keeps `BARD` as a surname where H6 had peeled it as a title. The committed corpora, CLDR and GND agreement, and tse-donors do not move: no committed corpus held either word before this change, whose rules examples add two. Spelling consistency (mechanisms.md#PAIRED-SPELLINGS-PER-CHANGE, per person, against master): jrc-names 44 persons now alike and none apart, of 218,822 with two or more spellings, the spellings that read the word as a title and those that did not; nepal-candidates 0 and 0.
Recompute: `uv run python tools/differential/local_agreement.py psc-individuals --base <checkout of this commit's parent>`, and `uv run python tools/differential/snapshot.py --local ctgov-officials --base <the same checkout>` (and `fec-individuals`, `tse-donors`).
- **2026-10-26 #752, phase 2j, `buddha`, `siddha` and `gyani` (#869) — THE THIRD TITLE BATCH: THE FIRST HALVES OF NEPALI COMPOUND GIVEN NAMES.** The batch decisions/vocabulary-model's 2026-10-24 #752 (Derek) entry put third, Derek having agreed there that the three go in the default gate and `guru` to a `ne` pack (its Devanagari twin `गुरु` must move with it; none of the three has a listed twin). Each gains a declared `given` reading and is a title only inside a title phrase; no listed phrase holds any of them, so nothing is reported. `Buddha Bahadur Tamang`, `Gyani Maya Gurung`, `Siddha Raj Joshi` and `Tamang, Buddha Bahadur` read given 'Buddha', 'Gyani', 'Siddha', where 1.4.0 through 2.6.0 read the word as the title and the compound's second half as the given name. A title phrase keeps the title (`His Holiness Buddha Ram`, `Buddha of Kapilavastu Ram`), and the other sites read as for `mahdi` (the entry above): ending the name, alone after a full name and a comma, past a second comma, and before a family comma, where H6 no longer peels the word from the family part (`Buddha Tamang, Ram` → family 'Buddha Tamang', `Dr. Buddha Tamang, Ram` → title 'Dr.', family 'Buddha Tamang'). Under either family-first order the word before a name is the family name (`Lord Buddha Tamang` → family 'Buddha'). Written with its period before `and` it joins the next word as a name (`Buddha. and Maya Gurung` → given 'Buddha. and Maya'), as an unlisted word does: master and 2.6.0 already read `Dean. and Mary Smith` so, and rules/H9's connective precedence bullet and a new P3 bullet in rules/H2 now say it, H9's H2 bullet naming the exception (the review of this batch found both rules claiming the shape always won; the reading is 1.4.0's, and `Xyz. and Mary Smith` reads the same). Behind another title the period-marked spelling stays a title by H2's shape (`Mr Buddha. Tamang` → title 'Mr Buddha.', as master read `Mr Dean. Smith`), which H9's H2 bullet now states for the leading run, not only the front.
- THE COUNTS. Outside Nepal the sources barely see the words (`uv run python tools/name_usage.py Buddha Siddha Gyani`, 2026-10-26): `buddha` given US SSA 6 births and Wikidata 4, recorded as counts; `siddha` and `gyani` reach neither source's floor, so their readings stand without a count and their notes give nepal-candidates' figures, 12 and 38 of 126,981 pairs (Buddha 83), every one the first half of a compound given name, none after a comma.
- THE COSTS, in rules/H9's Accepted clause, none written by any name the corpora hold (0 matches in the eight local corpora and the committed ones, 2026-10-26): the Sikh title in the spelling `Gyani` before a name reads as the given name (`Gyani Zail Singh`; its usual spelling `giani` has no given reading and keeps the title); a title before the word that is no style, modifier or attaching title is no partner (`Lord Buddha Tamang` → given 'Buddha'; `His Holiness Buddha Ram` and `Grand Buddha Ram` keep the title); and the epithet with its article reads as the `mahdi` entry's does, after a comma and before a name (`Ram Tamang, the Buddha` → given 'the Buddha', `The Buddha Ram` → given 'The Buddha').
- MEASURED (2026-10-26, against master `021028b2`, py3.11, every local check with `--base`). nepal-candidates: 121 romanized names moved (`snapshot.py --local nepal-candidates`), 117 the word read out of the title alone and 4 gaining or losing a report: 2 lose H4's `title-or-name`, the name having been nothing but vocabulary (`Gyani Lama`, `lama` a title too, as `Lord Buddha` and `Lord Mahdi` lose it), and 2 gain the `suffix-or-name` any name with a trailing credential word and words to spare gets (`Buddha Lama ma` reads as `Ram Lama ma`). Spelling consistency (mechanisms.md#PAIRED-SPELLINGS-PER-CHANGE, romanized against Devanagari, by structure): 128 pairs now alike, none apart. ctgov-officials 4 moved, all fixes, 2 of them one official written twice whose credential master read as the given name (`Buddha Aa, CAPS, Aa, CAPS` → given 'Buddha', the credentials suffixes, `suffix-or-name` on the name word between them). PSC (1,039,174 scored), fec-individuals, tse-donors, jrc-names, the committed corpora and CLDR and GND agreement do not move.
Recompute: `uv run python tools/differential/snapshot.py --local nepal-candidates --base <checkout of this commit's parent>` (and `ctgov-officials`); the pairs compare `local_corpora._read`'s structure of each record's `name` and `devanagari` in each tree, run from that tree's checkout.
1 change: 1 addition & 0 deletions docs/design/decisions/vocabulary-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Open: #752 (phase 2, derived ambiguity; its sub-phases 2a to 2m, each its own PR
- `dean`, `justice` and `major` gain an office or military reading beside a dated `given` one; `justice`'s exclusion (#606) is replaced by the reading. The batches of 2j declare the rest.
Adding the four fields changes `Lexicon`'s pickle layout, as phase 2h did.
- **2026-10-26 #752, phase 2i (Derek) — `attaches` MAY NAME A TITLE WORD AS WELL AS A KIND, AND `grace` AND `marshal` JOIN THE CONTESTED TITLES.** Amends the `attaches` bullet of the 2026-10-25 #752, phase 2i entry: a kind reaches every word that later joins it, and once `marshal` became a contested military word the military kind made `Sgt Marshal Smith` a title phrase. A list entry that is no kind must be a word with a title reading (a build check, its mutation in tests/v2/test_vocab.py). `major` attaches to `general` and `sergeant` and `sgt` to `major`. `grace` (style) and `marshal` (military, its #606 exclusion replaced) carry dated `given` readings. The measurement and Derek's answers are decisions/H9's entry of this date.
- **2026-10-26 #752, phase 2j, `buddha`, `siddha` and `gyani` (#869) — THE THIRD TITLE BATCH: each has a declared `given` reading**, `siddha`'s and `gyani`'s without a count, which their notes explain: the first halves of Nepali compound given names, which no source outside nepal-candidates counts. `Buddha Bahadur Tamang` reads given 'Buddha', middle 'Bahadur'; `guru` stays a title for a `ne` pack (the 2026-10-24 #752 (Derek) entry). The measurement is decisions/H9's entry of this date.
- **2026-10-26 #752, phase 2j, `mahdi` and `bard` (#867) — THE SECOND TITLE BATCH: both words have a dated `given` reading.** `Mahdi Karimi`, `Mr Mahdi Karimi`, `Karimi, Mahdi` and `Bard Larsen` read the given name, where 1.4.0 through 2.6.0 read a title; no listed phrase holds either word, so nothing is reported. The measurement is decisions/H9's entry of this date.
- **2026-10-26 #752, phase 2j, `wing` — THE FIRST TITLE BATCH: `wing` HAS A DATED `given` READING.** The order is the 2026-10-24 #752 (Derek) entry's. Decision 10 had already read `wing` as a name at the head of the name, so the reading reaches the parts decision 10 left as listed, after a comma and ending the name: `Lau, Wing Kai` reads given 'Wing', and `John Smith Wing.` family 'Wing.'. The rule and the measurement are decisions/H9's entry of this date.
- **2026-10-26 (Derek), #785 — PHASE 2g NARROWED: a capitals member with a name word behind it, and no family comma, does not start the credential's run**, the name word being evidence of initials; `Maria Ana MA Silva`, `Jean Pierre MA DUPONT` and `Mary Jane MA King` keep the readings 1.4.0 through 2.6.0 gave, and `John Smith MA Jones` keeping family 'Jones' is the cost. The record is decisions/S6's entry of this date.
Expand Down
4 changes: 4 additions & 0 deletions docs/design/rules/H2-leading-abbreviation-title.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"John Smith Ma." → family="Ma."
"Smith, John Ma" → middle="Ma"
```
- **A connective after the abbreviation** (P3): the join takes it with the word after the connective before the shape is asked of it, so the two read as two names joined.
```
"Xyz. and Mary Smith" → given="Xyz. and Mary"
```

**Accepted:**

Expand Down
12 changes: 10 additions & 2 deletions docs/design/rules/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"Grace Dean Smith" → given="Grace"
"Sgt Marshal Smith" → given="Marshal"
"Mr Mahdi Karimi" → given="Mahdi"
"Buddha Bahadur Tamang" → given="Buddha"
```
- **A modifier in the leading run of titles before the first comma** has its phrase in a head title after it in that run, in `of` after it, or in the object of `of` or `the` there. A modifier outside that run, ending the name or after a comma, is read as any title is, save one that may be a given name, which is read everywhere as it is in that run.
```
Expand Down Expand Up @@ -65,19 +66,21 @@
```
"Hon. Wing Lau" → given="Wing"
```
- **A period-marked word at the front of the name** (H2): the abbreviation shape makes it a title whatever the vocabulary says, save a given name written short, so the phrase test never reaches it and nothing is reported.
- **A period-marked word in the leading run of titles** (H2): the abbreviation shape makes it a title whatever the vocabulary says, save a given name written short or a word a connective joins (below), so the phrase test never reaches it and nothing is reported, at the front of the name or behind another title.
```
"Dean. Smith" → title="Dean."
"Wing. Lau" → title="Wing."
"Mr Buddha. Tamang" → title="Mr Buddha."
```
- **A title run** (H3, H4): a word this rule reads as a name word is no title word to the run, so the run stops before it and does not count it.
```
"Mr Dean Smith" → title="Mr"
"Dean" → given="Dean"
```
- **A connective after the word** (P3): only `of` makes a phrase of the join, so a word read as a name word before `and` joins the next word as two names join.
- **A connective after the word** (P3): only `of` makes a phrase of the join, so a word read as a name word before `and` joins the next word as two names join, and so does one written with its period, the join taking it before H2's shape is asked.
```
"Dean and Mary Smith" → given="Dean and Mary"
"Dean. and Mary Smith" → given="Dean. and Mary"
```
- **A title that may be a given name which a caller lists in `titles`** is a title wherever it stands, since that is what listing it asks; a modifier is read by this rule however it is listed, and leaving its word out of the modifiers turns the rule off for it.

Expand Down Expand Up @@ -110,6 +113,11 @@
"The Mahdi Muhammad Ahmad" → given="The Mahdi"
"William Shakespeare, the Bard" → given="the Bard"
```
- A religious title that opens given names in another tradition, written bare, reads as a name word before a name in every tradition, behind any title but a style, a modifier or one that attaches to it; no name data at hand writes the title there.
```
"Gyani Zail Singh" → given="Gyani"
"Lord Buddha Tamang" → given="Buddha"
```
- Once a partner has made the word a title, a coordinating join behind it takes the next word into the title too.
```
"Chief Dean and Mary Smith" → title="Chief Dean and Mary"
Expand Down
1 change: 1 addition & 0 deletions docs/release_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Release Log
- **Read the Brazilian agnomens and French fils as suffixes where the name has a word to spare.** ``Pedro Alves Filho`` and ``Alexandre Dumas fils`` give last ``Alves`` and ``Dumas``, suffix ``Filho`` and ``fils``, where 1.4.0 through 2.6.0 gave middle ``Alves`` and ``Dumas``, last ``Filho`` and ``fils``; ``Neto``, ``Netto``, ``Sobrinho`` and the feminines ``Filha``, ``Neta``, ``Sobrinha`` read the same way. Each is a surname too, so a name of two words keeps it as the last name (``Ana Neto``, ``PEDRO FILHO``) and ``Fils`` in Title case in a mixed-case name stays the last name (``Marie Fils``), the parse reports the choice as a ``suffix-or-name`` ambiguity. ``Lexicon.suffix_words_ambiguous`` lists the words and ``Lexicon.agnomens`` the ones read by the word count alone. :issue:`843`, :issue:`752`
- **Read a credential that is also a name, written in capitals in a mixed-case name, as settled.** ``John Smith MA`` reports no ``suffix-or-name`` ambiguity, where 2.0.0 through 2.6.0 reported one, and ``Smith, John MA Jones`` gives suffix ``MA Jones``, where 2.0.0 through 2.6.0 gave middle ``MA Jones`` and 1.4.0 middle ``Jones``, suffix ``MA``. A name written in one case still reports (``JOHN SMITH MA``), and with no comma a name word behind the capitals keeps them a name word, since they may be initials (``Maria Ana MA Silva`` keeps last ``Silva``). :issue:`785`, :issue:`752`
- **Read a title that is also a given name as a title only inside a title phrase.** ``Chief Justice John Roberts`` gives title ``Chief Justice``, first ``John``, where 1.4.0 through 2.6.0 gave title ``Chief``, first ``Justice``; ``Field Marshal Bernard Montgomery``, ``Dean of Students Jane Smith`` and ``Major General John Smith`` give the phrase as the title too. Outside a phrase the word is still a name, so ``Dean Smith`` and ``Grace Smith`` give first ``Dean`` and ``Grace``; ``Dean Smith`` now reports a ``title-or-name`` ambiguity unless a comma has marked the given name (``Smith, Dean``), while ``Grace``, a title only in a phrase such as ``His Grace``, reports nothing. Listing the word as a title still makes it one everywhere (``Lexicon.default().add(titles={"dean"})``). :issue:`752`, :issue:`853`
- **Fix the Nepali given names Buddha, Siddha and Gyani reading as titles.** ``Buddha Bahadur Tamang`` and ``Gyani Maya Gurung`` give first ``Buddha`` and ``Gyani``, middle ``Bahadur`` and ``Maya``, where 1.4.0 through 2.6.0 gave title ``Buddha`` and ``Gyani``, first ``Bahadur`` and ``Maya``; ``Siddha Raj Joshi`` and ``Tamang, Buddha Bahadur`` read the same. ``Guru`` is still a title. The Sikh title written ``Gyani`` reads as a given name too (``Gyani Zail Singh``); its usual spelling ``Giani`` is still a title. :issue:`869`, :issue:`752`
- **Fix the given names Mahdi and Bard reading as titles.** ``Mahdi Karimi`` and ``Bard Larsen`` give first ``Mahdi`` and ``Bard``, where 1.4.0 through 2.6.0 gave title ``Mahdi`` and ``Bard`` with no first name; ``Mr Mahdi Karimi`` and ``Karimi, Mahdi`` read the same. Inside a title phrase either is still a title (``Mahdi of Sudan``), but the epithet with its article is not: ``Muhammad Ahmad, the Mahdi`` gives first ``the Mahdi``, last ``Muhammad Ahmad``, where 1.4.0 through 2.6.0 gave title ``the Mahdi``. :issue:`867`, :issue:`752`
- **Fix a lone title qualifier at the head of a name reading as a title.** ``Wing Lau`` and ``Mr Wing Lau`` give first ``Wing``, where 1.4.0 through 2.6.0 gave title ``Wing`` and ``Mr Wing``; a qualifier such as ``Wing``, ``Vice`` or ``Grand`` is a title only with a title after it (``Wing Commander Lau``). After a comma it is still a title (``John Smith, Vice``), except ``Wing``, which is also a given name: ``Lau, Wing Kai`` gives first ``Wing``, middle ``Kai``, where 1.4.0 through 2.6.0 gave title ``Wing``, first ``Kai``. ``John Smith Wing.`` gives last ``Wing.``, as 1.4.0 through 2.2.0 did, where 2.3.0 through 2.6.0 gave title ``Wing.``. Like ``Dean``, it reverses a full name before a comma (``John Smith, Wing`` gives first ``Wing``, last ``John Smith``). :issue:`752`
- **Read Chas., Wm. and the other given names written short as given names rather than titles.** ``Chas. Smith`` and ``Ma. Cristina Reyes`` give first ``Chas.`` and ``Ma.``, where 1.4.0 through 2.6.0 gave title ``Chas.`` and ``Ma.``; ``Thos.``, ``Jas.``, ``Geo.``, ``Robt.``, ``Benj.``, ``Jno.``, ``Saml.``, ``Edw.``, ``Richd.``, ``Wm.`` and the Filipino ``Jo.`` read the same way, behind a title too (``Mrs Ma. Liza Cruz`` gives title ``Mrs``, first ``Ma.``). An unlisted abbreviation in front is still a title (``Insp. Jane Morse``), and ``Lexicon.given_name_abbreviations`` lists the words. :issue:`789`, :issue:`752`
Expand Down
6 changes: 3 additions & 3 deletions nameparser/config/_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
'british',
'broadcaster',
'brother',
'buddha',
'burgess',
'burlesque',
'business',
Expand Down Expand Up @@ -380,7 +379,6 @@
'gräfin',
'guitarist',
'guru',
'gyani',
'gysgt',
'hajji',
'headman',
Expand Down Expand Up @@ -683,7 +681,6 @@
'sheikh',
'shekh',
'sheriff',
'siddha',
'sig.na',
'sig.ra',
'signor',
Expand Down Expand Up @@ -965,12 +962,15 @@

TITLES_AMBIGUOUS: frozenset[str] = frozenset({
'bard',
'buddha',
'dean',
'grace',
'gyani',
'justice',
'mahdi',
'major',
'marshal',
'siddha',
'wing',
})

Expand Down
6 changes: 4 additions & 2 deletions nameparser/vocab/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ religious = { addresses = "given", gender = "m", expands = "a member of a religi

[[word]]
text = "buddha"
religious = {}
religious = { issue = 869, decided = 2026-10-26, note = "a title only inside a title phrase, its given reading the clash (rules/H9): 'Buddha Bahadur Tamang' reads the given name, unreported, since no listed phrase holds it" }
given = { us_ssa = 6, wikidata = 4, as_of = 2026-10-26, note = "US SSA: male births; Wikidata is a lower bound; the first half of Nepali compound given names (Buddha Bahadur, Buddha Maya): 83 of nepal-candidates' 126,981 pairs write it, opening the name in 79" }

[[word]]
text = "canon"
Expand Down Expand Up @@ -299,7 +300,8 @@ religious = {}

[[word]]
text = "siddha"
religious = {}
religious = { issue = 869, decided = 2026-10-26, note = "a title only inside a title phrase, its given reading the clash (rules/H9): 'Siddha Raj Joshi' reads the given name, unreported, since no listed phrase holds it" }
given = { note = "no US SSA year reaches 5 births and Wikidata counts no one; declared as the first half of Nepali compound given names (Siddha Raj): 12 of nepal-candidates' 126,981 pairs write it, each opening the name (2026-10-26)" }

[[word]]
text = "sister"
Expand Down
3 changes: 2 additions & 1 deletion nameparser/vocab/pa.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ religious = { expands = "a learned Sikh", native = "ਗਿਆਨੀ" }

[[word]]
text = "gyani"
religious = { same_as = "giani" }
religious = { same_as = "giani", issue = 869, decided = 2026-10-26, note = "a title only inside a title phrase, its given reading the clash (rules/H9): 'Gyani Maya Gurung' reads the given name, unreported, since no listed phrase holds it; the Sikh title keeps its usual spelling giani" }
given = { note = "no US SSA year reaches 5 births and Wikidata counts no one; declared as the first half of Nepali compound given names (Gyani Maya): 38 of nepal-candidates' 126,981 pairs write it, opening the name in 37 (2026-10-26)" }

[[word]]
text = "guru"
Expand Down
Loading
Loading