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
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 @@ -106,3 +106,10 @@
- THE COST, accepted by Derek on 2026-10-27: `FISH, ROYAL SR` reads given 'FISH' and no family, `sr` being a title as well as a suffix, so `ROYAL SR` is a title run with a head and H1 reads the word before the comma as the given name; one FEC name. A phrase with nothing behind it still names its last word (`Princess Royal` → title 'Princess', given 'Royal'), H4's reading of an input that is all vocabulary.
- MEASURED (2026-10-27, against master `598167f4`, which holds the queen batch, py3.11, `uv run python tools/differential/measure.py --base <checkout>`, 16 steps). Fields: fec-individuals 49, 47 fixes, nearly every one `AA, ROYAL…`, where the queen head read title 'ROYAL' and no given name, 1 broken (above) and 1 input that names one person twice; jrc-names 6 spellings, `Princess Royal Anne`'s and a `consort marquise of X`; PSC and orcid-researchers agreement no record moved (ORCID 1,831,533 scored). Reports only: orcid-researchers 548 (`prince` 329, `princess` 103, `king` 70, `queen` 24, `royal` 15, a few behind `Dr.` or `Prof.`), PSC 310 records (`prince` 119, `princess` 58, `king` 49, `queen` 13, the rest `royal` and salutation forms), jrc-names 154 spellings, ctgov-officials 17, nepal-candidates 3, the committed corpora 13; tse-donors, tw-donors and ukec-individuals none; spelling pairs jrc-names 0 now alike and 1 apart; CLDR and GND agreement do not move. A v1 `Constants().titles` keeps all four royal titles, and `royal` and `consort` reach it as titles with no edit.
Recompute: `uv run python tools/differential/measure.py --base <checkout of this commit's parent>`.
- **2026-10-28 #913, `chancellor`, AND `judge` KEPT A TITLE (Derek) — THE LAST 2.8 TITLE BATCH: ONE TITLE BORNE AS A GIVEN NAME, AND THE PHRASES THAT KEEP JUDICIAL AND ACADEMIC TITLES WHOLE.** `judge` and `chancellor` were proposed together; Derek shipped `chancellor` alone and kept `judge` a title on 2026-10-28. `chancellor` gains a dated `given` reading and is a title only inside a title phrase: `Chancellor Smith`, `Mr Chancellor Smith` and `Smith, Chancellor` read given 'Chancellor', where 1.4.0 through 2.7.0 read the title. Before a family comma H6 no longer peels it (`Chancellor Case, Nancy` → family 'Chancellor Case', 1.4.0's reading). The phrases keep it: a modifier (`Vice Chancellor`, `Associate Chancellor`), `of` (`Chancellor of the Exchequer`), and `attaches` data added here for the phrases a modifier does not reach: `lord` attaches to `chancellor` and `justice` and `lady` to `justice` (`Lord Chancellor`, `Lord Justice`, `Lady Justice`), `deputy` to the office kind as `chief` does (`Deputy Chancellor`, `Deputy Judge`), `pro` to `chancellor` (`Pro Chancellor`), and `magistrate` to `judge` (`Magistrate Judge`, the US federal office, which with `judge` moved had lost its second word). `Lord Justice Leveson` and `Lady Justice Arden` now read the one title, where 1.4.0, which listed no `justice`, through 2.7.0, where it is contested (phase 2i), read title 'Lord', given 'Justice'. Since `Vice Chancellor` and `Lord Chancellor` are listed phrases, a bare `Chancellor` opening a name reports `title-or-name`, as `Dean Smith` does. Phrases that read the same on master and stay out of scope: `Circuit Judge`, `Probate Judge`, `His Honour Judge` and the hyphenated `Vice-Chancellor`.
- `judge` KEPT A TITLE, its evidence recorded in the note on its title reading so a later batch meets it: given US SSA 3,826 births (all male), Wikidata 7, nam_dict band 1 in the U.S.A.; family Census 10,453 (rank 3,414), Wikidata 133; in PSC 0 filers put it in the forename box and 0 in the title box. Measured as a contested title against master `f207e4f1`, it broke 13 FEC records, every one a judge filing `FAMILY, JUDGE GIVEN` (9) or `FAMILY, JUDGE` alone (4), and 2 jrc-names spellings of news text before a surname, against 2 fixes in all the local corpora (one ORCID and one PSC filer whose given name it is). The `TEST_NAMES` judges (`Judge James M. Moody`) and every example that uses `judge` as an ordinary surname in TITLES (the H section's Background, rules/H5, rules/H6 and rules/H7) keep it.
- THE COUNTS for `chancellor`, recorded on the word (`uv run python tools/name_usage.py chancellor`, 2026-10-28): given US SSA 2,648 births (2,643 male), Wikidata 13 (United States 3); family Census 4,147 (rank 7,974), Wikidata 77 (United Kingdom 11, United States 8).
- THE COST, accepted by Derek on 2026-10-28: a chancellor written with the bare title reads it as the given name (`Chancellor Merkel` → given 'Chancellor', family 'Merkel', where 1.4.0 through 2.7.0 read title 'Chancellor'), so does one alone after a full name and a comma (`John Smith, Chancellor` reverses to given 'Chancellor', family 'John Smith', the role-word class `John Smith, Dean` accepted), and a bare first-word `Chancellor` reports `title-or-name`.
- WORKED EXAMPLES MOVED. The v1 tests that add a custom title and parse it (`tests/test_constants.py`, `tests/test_python_api.py`) add `bursar`, in no default set, where they added `chancellor`, which v1's `Constants().titles` still holds; rules/H9 gains the `Lord Chancellor` and `Chancellor Smith` examples.
- MEASURED (2026-10-28, against master `f207e4f1`, py3.11, `uv run python tools/differential/measure.py --base <checkout>`, 16 steps). fec-individuals 10, all fixes: 4 `AA, CHANCELLOR` alone, which had read no given name, 1 `AA, CHANCELLOR A.`, 2 `AA, CHANCELLOR MR.`, and 3 with a two-word surname opening with the word before the comma, which had read it as the title; jrc-names 5 spellings, 3 fixed (`Lord Justice` and `Lady Justice` before a surname) and 2 broken, spellings of one head of government written with the bare title, now reporting `title-or-name`; ctgov-officials 1 fix (a `Deputy` and an office title after a comma, now one title through `deputy`'s attaches); orcid-researchers, psc-individuals, nepal-candidates, tse-donors, tw-donors and ukec-individuals none; ORCID (1,831,533 scored) and PSC (1,039,145 scored) agreement do not move; spelling pairs jrc-names 0 now alike and 0 apart; CLDR and GND agreement do not move. The committed corpora move by `Chancellor Jane Smith` (given 'Chancellor') beside the batch's rule examples. A v1 `Constants().titles` keeps `chancellor` and `judge` with no edit, and `c.titles.remove('chancellor')` turns every title reading of it off (the v1 title list entry above).
Recompute: `uv run python tools/differential/measure.py --base <checkout of this commit's parent>`.
1 change: 1 addition & 0 deletions docs/design/decisions/vocabulary-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Open: #913 (the title words phase 2j left, read as titles though borne as names)
- `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-28 #913, `chancellor`, and `judge` kept a title (Derek) — A #913 TITLE BATCH: `chancellor` has a dated `given` reading**, US SSA 2,648 births and Census rank 7,974 as a surname, so it is a title only inside a title phrase. `Chancellor Smith` and `Smith, Chancellor` read given 'Chancellor'; a chancellor written with the bare title does too (`Chancellor Merkel`), accepted by Derek on 2026-10-28. `Vice Chancellor`, `Chancellor of the Exchequer` and, through new `attaches` data, `Lord Chancellor`, `Deputy Chancellor` and `Pro Chancellor` keep the title; the same data makes `Lord Justice`, `Lady Justice` and `Magistrate Judge` one title. `judge` was proposed in the same batch and kept a title by Derek on 2026-10-28, the counts against moving it (13 FEC judges filing `FAMILY, JUDGE …` against 2 fixes) recorded in the note on its title reading. The measurement is decisions/H9's entry of this date.
- **2026-10-27 #913, royal title phrases (Derek) — `king`, `queen`, `prince` and `princess` CARRY `attaches`, `consort` IS A NEW MODIFIER AND `royal` HAS A DATED `given` READING.** `king` and `prince` attach to `consort`, `queen` to `consort` and `mother`, `princess` to `consort` and `royal`; `consort` (no bearers found) and `royal` address by the given name, so `Queen Consort Camilla` and `Princess Royal Anne` read the phrase as the title and the given name behind it. `royal`'s given reading keeps `BALES, ROYAL` the listing form's given name. The bare royal words now report `title-or-name`, a listed phrase holding them, accepted by Derek on 2026-10-27. The measurement and the rule change are decisions/H9's entry of this date.
- **2026-10-27 #913, `queen` (Derek) — A #913 TITLE BATCH: `queen` has a dated `given` reading**, US SSA 16,123 births and Census rank 1,945 as a surname, so it is a title only inside a title phrase. `Queen Latifah`, `Ms Queen Smith` and `Smith, Queen` read given 'Queen' and the word behind it as the family; a monarch written with the bare title does too (`Queen Elizabeth II`), the class accepted for `king`, accepted by Derek on 2026-10-27. `Her Majesty Queen Elizabeth` and `Queen of England` keep the title. `Mary II, Dame` replaces `Elizabeth II, Queen` as rules/H1's example. The measurement is decisions/H9's entry of this date.
- **2026-10-27 #913, `deacon`, `burgess` and `ranger` (Derek) — A #913 TITLE BATCH: each has a dated `given` reading** on its en.toml entry, so each is a title only inside a title phrase. `Deacon Jones`, `Burgess Meredith` and `Ranger Smith` read the given name, and `Burgess Smith, John` keeps the surname whole; a cleric written with the bare title or behind `Rev.` does too (`The Rev. Deacon John Smith`), the religious class accepted for `buddha` and `gyani`, accepted by Derek on 2026-10-27. `Deacon of the Church Jane Smith` keeps the title. Derek chose the three, with `marquis` and `marquise` (#923), from #913's ranking on 2026-10-27. The measurement is decisions/H9's entry of this date.
Expand Down
3 changes: 3 additions & 0 deletions docs/design/rules/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"His Grace John Smith" → title="His Grace"
"Field Marshal Bernard Montgomery" → title="Field Marshal"
"Sergeant Major John Smith" → title="Sergeant Major"
"Lord Chancellor John Smith" → title="Lord Chancellor"
"Mr Dean Smith" → given="Dean"
"SMITH, DEAN MR." → given="DEAN"
"General Major John Smith" → given="Major"
Expand All @@ -28,6 +29,7 @@
"Marquis Johnson" → given="Marquis"
"Mr Deacon Smith" → given="Deacon"
"Ms Queen Smith" → given="Queen"
"Chancellor Smith" → given="Chancellor"
"Cheikh Anta Diop" → given="Cheikh"
"Queen Mother Elizabeth" → title="Queen Mother"
```
Expand All @@ -54,6 +56,7 @@
"Dean Smith, MD" → ambiguities=("title-or-name",)
"Prince Fielder" → ambiguities=("title-or-name",)
"Dr. King" → ambiguities=("title-or-name",)
"Chancellor Smith" → ambiguities=("title-or-name",)
"Grace Smith" → ambiguities=()
"Bard Larsen" → ambiguities=()
"GRACE SMITH" → ambiguities=()
Expand Down
11 changes: 11 additions & 0 deletions docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,11 @@ grep your fixtures for, with what 1.4 read:
after a family comma is the first name: 1.4 read title ``Prince``,
first ``Consort``; title ``Princess Royal``, last ``Anne``; and title
``Royal``, first ``Bales``.
- ``"Chancellor Smith"`` and ``"Lord Justice Leveson"`` (2.8) —
``Chancellor`` is a title only inside a title phrase (``"Lord
Chancellor John Smith"``), and ``Lord Justice`` and ``Lady Justice`` are
one title: 1.4 read title ``Chancellor``, and title ``Lord``, first
``Justice``.

.. doctest::

Expand Down Expand Up @@ -1058,3 +1063,9 @@ grep your fixtures for, with what 1.4 read:
('Prince Consort', 'Albert')
>>> HumanName("Princess Royal Anne").first, HumanName("Bales, Royal").first
('Anne', 'Royal')
>>> HumanName("Chancellor Smith").first
'Chancellor'
>>> HumanName("Lord Chancellor John Smith").title
'Lord Chancellor'
>>> HumanName("Lord Justice Leveson").title
'Lord Justice'
1 change: 1 addition & 0 deletions docs/release_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Release Log

**Behavior Changes**

- **Fix the given name Chancellor reading as a title, and read Lord Justice as one title.** ``Chancellor Smith`` gives first ``Chancellor``, where 1.4.0 through 2.7.0 gave title ``Chancellor``; ``Smith, Chancellor`` reads the same. A chancellor written with the bare title reads it as a first name too (``Chancellor Merkel``), where a modifier, ``of`` or ``Lord`` keeps it (``Vice Chancellor Jane Smith``, ``Chancellor of the Exchequer``, ``Lord Chancellor John Smith``), and so do ``Deputy`` and ``Pro``. Since a listed title phrase holds it, a bare ``Chancellor`` opening a name reports a ``title-or-name`` ambiguity. ``Lord Justice Leveson`` and ``Lady Justice Arden`` give title ``Lord Justice`` and ``Lady Justice``, where 1.4.0 through 2.7.0 gave title ``Lord``, first ``Justice``. :issue:`913`
- **Read the royal title phrases Queen Mother, King Consort, Queen Consort, Prince Consort, Princess Consort and Princess Royal as one title.** ``Prince Consort Albert`` gives title ``Prince Consort``, first ``Albert``, where 2.7.0 gave first ``Prince``, middle ``Consort``, last ``Albert``, and 1.4.0 title ``Prince``, first ``Consort``; ``Princess Royal Anne`` gives first ``Anne``. ``Royal`` after a family comma is the first name (``Bales, Royal`` gives first ``Royal``, where 1.4.0 through 2.7.0 gave title ``Royal``). Since a listed title phrase holds them, a bare ``King``, ``Queen``, ``Prince``, ``Princess`` or ``Royal`` opening a name now reports a ``title-or-name`` ambiguity, as ``Dean Smith`` does (``Prince Fielder``, ``Dr. King``). :issue:`913`
- **Fix the given name Queen reading as a title.** ``Queen Latifah`` and ``Ms Queen Smith`` give first ``Queen``, where 1.4.0 through 2.7.0 gave title ``Queen`` and ``Ms Queen``; ``Smith, Queen`` reads the same. A monarch written with the bare title reads it as a first name too (``Queen Elizabeth II`` and ``Elizabeth II, Queen`` give first ``Queen``, last ``Elizabeth``), where a style keeps it (``Her Majesty Queen Elizabeth``), and so does ``of`` (``Queen of England``). :issue:`913`
- **Fix the given names Deacon, Burgess and Ranger reading as titles.** ``Deacon Jones``, ``Burgess Meredith`` and ``Ranger Smith`` give first ``Deacon``, ``Burgess`` and ``Ranger``, where 1.4.0 through 2.7.0 gave title ``Deacon``, ``Burgess`` and ``Ranger``; ``Smith, Deacon`` reads the same. A cleric written with the bare title, or behind a salutation or ``Rev.``, reads it as a first name too (``The Rev. Deacon John Smith`` gives first ``Deacon``), where ``of`` keeps it (``Deacon of the Church Jane Smith``). ``Burgess Meredith`` reports a ``title-or-name`` ambiguity, since ``Chief Burgess`` is a title phrase. :issue:`913`
Expand Down
81 changes: 80 additions & 1 deletion nameparser/config/_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
'ch.mo',
'chair',
'chairs',
'chancellor',
'chaplain',
'charge',
'chargé',
Expand Down Expand Up @@ -946,6 +945,7 @@
'bard',
'buddha',
'burgess',
'chancellor',
'cheikh',
'deacon',
'dean',
Expand Down Expand Up @@ -1316,11 +1316,90 @@
'chief wo5',
'chief न्यायमूर्ति',
'chief বিচারপতি',
'deputy administrator',
'deputy alderman',
'deputy almoner',
'deputy ambassador',
'deputy arbitrator',
'deputy attache',
'deputy attaché',
'deputy bailiff',
'deputy burgess',
'deputy ceo',
'deputy cfo',
'deputy chair',
'deputy chairs',
'deputy chancellor',
'deputy charge',
'deputy chargé',
'deputy clerk',
'deputy cllr',
'deputy co-chair',
'deputy co-chairs',
'deputy commissioner',
'deputy comptroller',
'deputy controller',
'deputy councillor',
'deputy counsel',
'deputy courtier',
"deputy d'affaires",
'deputy dean',
'deputy delegate',
'deputy dir',
'deputy director',
'deputy dpty',
'deputy envoy',
'deputy gov',
'deputy governor',
'deputy headman',
'deputy intendant',
'deputy judge',
'deputy justice',
'deputy leader',
'deputy mag',
'deputy mag-judge',
'deputy mag/judge',
'deputy magistrate',
'deputy magistrate-judge',
'deputy mayor',
'deputy member',
'deputy minister',
'deputy prefect',
'deputy premier',
'deputy pres',
'deputy president',
'deputy prin',
'deputy principal',
'deputy provost',
'deputy pslc',
'deputy pursuivant',
'deputy registrar',
'deputy rep',
'deputy representative',
'deputy secretary',
'deputy senator',
'deputy senior-judge',
'deputy sheriff',
'deputy speaker',
'deputy swordbearer',
'deputy sysselmann',
'deputy treasurer',
'deputy vc',
'deputy verderer',
'deputy vizier',
'deputy warden',
'deputy न्यायमूर्ति',
'deputy বিচারপতি',
'king consort',
'lady justice',
'lord chancellor',
'lord justice',
'magistrate judge',
'major general',
'prince consort',
'princess consort',
'princess royal',
'pro chancellor',
'queen consort',
'queen mother',
'sergeant major',
Expand Down
Loading
Loading