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

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/design/decisions/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,10 @@
- `king` WAS THE WORKED EXAMPLE OF A TITLE THAT IS ALSO A SURNAME, in rules H1, H3 to H8, M2, S2 and S8, their decisions Standing lines, AGENTS.md, docs/usage.rst, two code comments and eleven case rows and tests. Each now uses `pope`, chosen because it reads as `king` read on master in every one of those examples (19 inputs checked against `queen`, `bishop`, `pope`, `baron`, `judge`, `sheriff`, `mayor` and `emperor`; only `pope` and `queen` matched all, `pope` being the commoner surname). decisions/v1-xfail-triage's "`king` stays in TITLES" is superseded there.
- MEASURED (2026-10-26, against master `957509d1`, py3.11, every local check with `--base`). PSC (1,039,174 scored): 58 records fixed, none broken, 5 changed. fec-individuals 73 moved, all fixes: `AA, KING …` given names (51) and `KING AA, AA` family parts that H6 had peeled (22). ctgov-officials 12, all fixes: officials whose given name is King (`King A. Aa`), and one whose credential master read as the given name (`Aa King, AA Aa` → given 'Aa', family 'King', the credentials suffixes). tse-donors, ukec-individuals, jrc-names and nepal-candidates pairs (0 now alike, 0 apart: both spellings of a person move together), CLDR and GND agreement do not move. The committed corpora move 11 names before the rules examples were rewritten: the three royal rows, `King Curtis` (#348's example, fixed), `King Smith, John` and `Mary Jane King.` (1.4.0's readings), a maiden clause, and four that only lose H4's `title-or-name`, the word no longer being title vocabulary (`Dr. King`, `Dr King Jr`, `Dr. King MD`; `Smith and King` reports `given-or-family` instead).
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 fec-individuals --base <the same checkout>` (and `ctgov-officials`).
- **2026-10-26 #752, phase 2j, `sultana` and `sultan` (Derek) — THE FIFTH AND SIXTH TITLE BATCHES, COMBINED.** The batches decisions/vocabulary-model's 2026-10-24 #752 (Derek) entry put fifth and sixth; measured apart and together, `sultana` costing nothing and `sultan` only the royal class accepted for `king` (the entry above), Derek combined them on 2026-10-26. Each gains a dated `given` reading (`sultan`'s on its tr.toml entry, the other two files' readings deriving the same marker) and is a title only inside a title phrase; no listed phrase holds either, so nothing is reported. `Sultana Begum`, `Mrs Sultana Begum`, `Sultan Khan`, `Mr Sultan Khan`, `Khan, Sultan` and `Sultan Bin Zayed` read the given name, where 1.4.0 through 2.6.0 read the title (and `Mrs Sultana`, `Mr Sultan`). A style keeps the title (`His Majesty Sultan Hassanal Bolkiah`), as does `of` (`Sultan of Brunei`), and the Ottoman writing after the name was already a name word (`Hurrem Sultan`). The other sites read as for `king`.
- THE COUNTS, recorded on the words (`uv run python tools/name_usage.py Sultana Sultan`, 2026-10-26): `sultana` given US SSA 275 births, Wikidata 19 (Bangladesh 5), nam_dict band 3 in Romania and Arabia/Persia, family Census 3,471, Wikidata 34; `sultan` given US SSA 2,396, Wikidata 151 (Turkey 28, Saudi Arabia 13), nam_dict band 7 in Turkey, family Census 3,363, Wikidata 106 (Ottoman Empire 26, the title written after the name).
- THE COST, `sultan`'s only: a sultan written with the bare title in front reads it as the given name (`Sultan Hassanal Bolkiah` → given 'Sultan', where 1.4.0 through 2.6.0 read title 'Sultan', given 'Hassanal'; so `Sultan Qaboos bin Said`), the class accepted for `king`; in PSC one filer typed `Sultan` in the title box before a name, the one broken record. Sized afterwards, at the review's prompting, in the news text of jrc-names: 135 persons (266 spellings) open with `Sultan` or `Sultana`, by a reading of each about 40 rulers (mostly Ottoman sultans and today's Gulf and Malay rulers), about 80 people whose given name is Sultan, and 13 mosques and other places, a cost about four times `king`'s 10 there.
- FOUND BY THE REVIEW, NOT FIXED HERE: A v1 `remove` OF A WORD 2.6.0 LISTED NOW RAISES. A title that gains a given reading compiles out of `TITLES` (the 2026-10-25 #752, phase 2i entry of decisions/vocabulary-model), so `Constants().titles` no longer holds it and v1's strict `remove` raises `KeyError`: `c.titles.remove('sultan')`, which 2.6.0 accepted (and which then read `Sultan Khan` with first 'Sultan'), raises on this tree, and so does it for every word phase 2j moved out of the titles 2.6.0 listed (`wing`, `mahdi`, `bard`, `buddha`, `siddha`, `gyani`, `king`, `sultana`); phase 2i's own words were never in 2.6.0's titles, so removing them raised before too. The shim is not to raise on a config v1 accepted (AGENTS.md), so this is a defect of the batches, left for its own change before 2.7.0 ships.
- NOT REACHED, for `sheikh`'s batch. `sheikh` is a style, so under rules/H9 it partners a contested word behind it: `Sheikh Sultan Khan` keeps title 'Sheikh Sultan', as master reads it and as `Sheikh Dean Smith` reads, where in Gulf names the word is the person's given name.
- MEASURED (2026-10-26, against master `6ba78d0d`, py3.11, every local check with `--base`). Both words: PSC (1,039,174 scored) 111 records fixed, 1 broken (the title box above), 6 changed, each still wrong for another reason, mostly a two-word surname box; ctgov-officials 41 moved; fec-individuals 21; tse-donors 1; spelling pairs (mechanisms.md#PAIRED-SPELLINGS-PER-CHANGE) jrc-names 9 persons and nepal-candidates 6 pairs now alike, none apart. `sultana` alone: PSC 28 fixed, none broken, 1 changed (a two-word surname box); ctgov 7, every one a fix, 6 of them `Aa Sultana, CRED` names whose credential master read as the given name (`Nasreen Sultana, MBBS` → given 'Nasreen', family 'Sultana', suffix 'MBBS', reported `suffix-or-name`); FEC 5 (`AA, SULTANA`); tse 1; nepal 1. The committed corpora and CLDR and GND agreement do not move.
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`).
1 change: 1 addition & 0 deletions docs/design/decisions/vocabulary-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,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, `sultana` and `sultan` (Derek) — THE FIFTH AND SIXTH TITLE BATCHES, IN ONE PR: both have dated `given` readings**, `sultan`'s on its tr.toml entry, so each is a title only inside a title phrase. `Sultana Begum` and `Sultan Khan` read the given name; a sultan written with the bare title does too (`Sultan Hassanal Bolkiah`), the cost accepted for `king`. Derek combined the two batches on 2026-10-26. The measurement is decisions/H9's entry of this date.
- **2026-10-26 #752, phase 2j, `king` (Derek) — THE FOURTH TITLE BATCH: `king` has a dated `given` reading**, US SSA 37,890 births and Census rank 34 as a surname, so it is a title only inside a title phrase. `King Curtis` and `Mr King Smith` read given 'King'; a monarch written with the bare title does too (`King Henry`), the cost Derek accepted on 2026-10-26. `pope` replaces `king` as the worked example of a title that is also a surname wherever the rules and tests used it. The measurement is 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.
Expand Down
4 changes: 3 additions & 1 deletion docs/design/rules/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"Mr Mahdi Karimi" → given="Mahdi"
"Buddha Bahadur Tamang" → given="Buddha"
"King Curtis" → given="King"
"Sultana Begum" → given="Sultana"
```
- **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 @@ -119,9 +120,10 @@
"Gyani Zail Singh" → given="Gyani"
"Lord Buddha Tamang" → given="Buddha"
```
- A monarch written with the bare title in front reads it as the given name, a style before it or `of` after it keeping the title; the record data at hand writes the word there as a given name, and only news text writes monarchs that way.
- A monarch written with the bare title in front reads it as the given name, a style before it or `of` after it keeping the title; the record data at hand writes the word there almost only as a given name, and monarchs that way mostly in news text.
```
"King Henry" → given="King"
"Sultan Hassanal Bolkiah" → given="Sultan"
"His Majesty King Charles" → title="His Majesty King"
```
- Once a partner has made the word a title, a coordinating join behind it takes the next word into the title too.
Expand Down
2 changes: 1 addition & 1 deletion docs/design/vocabulary-model-rfc.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ A reading whose writing offers no cue is one the gate could only guess, so it is

The front of a name has no words-to-spare cue: a title addresses the name after it. What it has is the contested-head rule. **A title word that also has a name reading is a title only inside a title phrase:**

- **The title before it is not a partner.** A contested word after another title is the given name (`Mr Sultan Khan`, `Ms Princess Ada Obi`, #853), unless that title is its partner; today `Mr Sultan Khan` reads title `Mr Sultan`.
- **The title before it is not a partner.** A contested word after another title is the given name (`Mr Sultan Khan`, `Ms Princess Ada Obi`, #853), unless that title is its partner; `Mr Sultan Khan` read title `Mr Sultan` until phase 2j gave `sultan` its given reading.
- **Its partner** is a modifier or a style before it (`Her Royal Highness Princess Anne`), `of` after it (`Dean of Students`), or a head title after it that the word `attaches` to (`Major General`). A salutation is never a partner (`SMITH, DEAN MR.` is a given name and a salutation).
- **Modifiers** (decision 10, unparked) are titles only beside a head title, at the head of the name only, never in a comma part, where a lone title word is the person's role; a modifier that is also a given name (`wing`, phase 2j) is read by that test in every part.

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 given names Sultan and Sultana reading as titles.** ``Sultan Khan`` and ``Sultana Begum`` give first ``Sultan`` and ``Sultana``, where 1.4.0 through 2.6.0 gave title ``Sultan`` and ``Sultana`` with no first name; ``Mr Sultan Khan`` and ``Khan, Sultan`` read the same. A sultan written with the bare title reads it as a first name too (``Sultan Hassanal Bolkiah`` gives first ``Sultan``), where a style keeps it (``His Majesty Sultan Hassanal Bolkiah``). :issue:`752`, :issue:`853`
- **Fix the given name King reading as a title.** ``King Curtis`` and ``Mr King Smith`` give first ``King``, where 1.4.0 through 2.6.0 gave title ``King`` and ``Mr King``; ``SMITH, KING`` reads the same. A monarch written with the bare title reads it as a first name too (``King Henry`` gives first ``King``, last ``Henry``), where a style keeps it (``His Majesty King Henry``). :issue:`752`, :issue:`348`
- **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`
Expand Down
4 changes: 2 additions & 2 deletions nameparser/config/_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,6 @@
'subaltern',
'subedar',
'suffragist',
'sultan',
'sultana',
'superior',
'supreme',
'surgeon',
Expand Down Expand Up @@ -971,6 +969,8 @@
'major',
'marshal',
'siddha',
'sultan',
'sultana',
'wing',
})

Expand Down
4 changes: 3 additions & 1 deletion nameparser/vocab/ar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ nobility = {}

[[word]]
text = "sultana"
nobility = { gender = "f" }
nobility = { gender = "f", issue = 752, decided = 2026-10-26, note = "a title only inside a title phrase, its given reading the clash (rules/H9): 'Sultana Begum' reads the given name, unreported, since no listed phrase holds it" }
given = { us_ssa = 275, wikidata = 19, as_of = 2026-10-26, note = "US SSA: female births; Wikidata is a lower bound (Bangladesh 5); nam_dict band 3 in Romania and Arabia/Persia" }
family = { us_census_2010 = 3471, wikidata = 34, as_of = 2026-10-26 }

[[word]]
text = "أمير"
Expand Down
4 changes: 3 additions & 1 deletion nameparser/vocab/tr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ style = { expands = "the Ottoman efendi, in its conventional Latin spelling" }

[[word]]
text = "sultan"
nobility = { note = "no gender: Ottoman usage gave it to imperial women too, written after the name (Hürrem Sultan)" }
nobility = { note = "no gender: Ottoman usage gave it to imperial women too, written after the name (Hürrem Sultan)", issue = 752, decided = 2026-10-26 }
given = { us_ssa = 2396, wikidata = 151, as_of = 2026-10-26, note = "US SSA: male births; Wikidata is a lower bound (Turkey 28, Saudi Arabia 13); nam_dict band 7 in Turkey, 5 in Central Asia; a title only inside a title phrase (rules/H9): 'Sultan Khan' and 'Mr Sultan Khan' read the given name, unreported" }
family = { us_census_2010 = 3363, wikidata = 106, as_of = 2026-10-26, note = "Wikidata: Ottoman Empire 26, the title written after the name, which reads as a name word" }

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