Skip to content

Commit 69ff00a

Browse files
derek73claude
andauthored
Read the royal title phrases Queen Mother, Consort and Princess Royal as one title (#913) (#928)
* Read the given name Queen as a name outside a title phrase (#913) A #913 title batch, `queen` on its own. It gains a dated given reading, 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, while `Her Majesty Queen Elizabeth` and `Queen of England` keep the title. A monarch written with the bare title reads it as the given name (`Queen Elizabeth II`), the cost recorded to be decided. `Elizabeth II, Queen` was rules/H1's example of a given-name title alone after a comma; `Mary II, Dame` replaces it, reading as it did on master under all three orders. Tests that used `queen` as their sample title move to `Dame` and `Sir`. Refs #913 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Record the acceptance of the queen monarch cost (#913) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP: royal title phrases (#913), measured, docs and tests not yet updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Read the royal title phrases as one title (#913) `king` and `prince` attach to `consort`, `queen` to `consort` and `mother`, and `princess` to `consort` and `royal`; `consort` is a new modifier, and it and `royal` address by the given name. rules/H9's modifier clause now finds a modifier's phrase in a title before it that attaches to it, so `Prince Consort Albert`, `Queen Consort Camilla`, `Queen Mother Elizabeth` and `Princess Royal Anne` read the phrase as the title and the given name behind it. `royal` gains a dated given reading, so `BALES, ROYAL` reads given 'ROYAL'. The bare royal words now report title-or-name, a listed phrase holding them, as accepted. Refs #913 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add the orcid-researchers measurement to the royal title phrases entry (#913) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 598167f commit 69ff00a

13 files changed

Lines changed: 128 additions & 37 deletions

File tree

‎docs/design/decisions/H9-title-phrase.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,10 @@
9999
- THE COST, accepted by Derek on 2026-10-27 as the `king` cost was, its three parts below each accepted, shown the share of royals in jrc-names below and that a style or `of` keeps the title: a monarch written with the bare title in front reads it as the given name (`Queen Elizabeth II` → given 'Queen', family 'Elizabeth', suffix 'II', where 1.4.0 through 2.7.0 read title 'Queen'), the class accepted for `king`; so does one alone after a comma (`Elizabeth II, Queen`, which read given 'Elizabeth' from 2.5.0), and a title written after it that is no partner of it reads as a name word (`Queen Mother Elizabeth` → given 'Queen', middle 'Mother', where master read title 'Queen Mother'). In jrc-names, of the 11 moved spellings, 9 are 5 queens regnant or consort and 2 one person whose stage name opens with the word, so news text writes the royal far more often than the given name; in PSC no filer types `Queen` into the title box, and every moved record files it as the forename.
100100
- MEASURED (2026-10-27, against master `04d7086b`, py3.11, `uv run python tools/differential/measure.py --base <checkout>`, 14 steps). PSC (1,039,144 scored) 14 records fixed, 0 broken, 2 changed, each now reading the given name and splitting a multi-word middle box differently; ctgov-officials 2, both fixes (`Queen Aa, CRED`, which had read the surname as the given name); fec-individuals 14, all fixes, every one `AA, QUEEN…` in the listing form, 12 of which had read the surname as the given name and no family; jrc-names 11 spellings, the 9 royals and 2 given-name spellings above; nepal-candidates, tse-donors, tw-donors and ukec-individuals none; spelling pairs (mechanisms.md#PAIRED-SPELLINGS-PER-CHANGE) 0 now alike and 0 apart. The committed corpora move by `Queen Elizabeth` (given 'Queen', family 'Elizabeth') beside the batch's rule examples; CLDR and GND agreement do not move. A v1 `Constants().titles` keeps `queen` with no edit (the v1 title list entry above).
101101
Recompute: `uv run python tools/differential/measure.py --base <checkout of this commit's parent>`.
102+
- **2026-10-27 #913, royal title phrases (Derek) — `Queen Mother`, `King Consort`, `Queen Consort`, `Prince Consort`, `Princess Consort` AND `Princess Royal` ARE TITLE PHRASES, AND A MODIFIER IS IN ONE BEHIND A TITLE THAT ATTACHES TO IT.** The royal batches (`king`, `prince`, `princess`, `queen`) left these phrases reading as names: `Prince Consort Albert` read given 'Prince', middle 'Consort'. Now `king` and `prince` attach to `consort`, `queen` to `consort` and `mother`, and `princess` to `consort` and `royal`; `consort` is a new modifier, and it and `royal` address by the given name, so the word behind the phrase is the given name (`Queen Consort Camilla` → title 'Queen Consort', given 'Camilla'; `Anne, Princess Royal` → given 'Anne'). `mother` was already a title addressing by the given name, so `Queen Mother Elizabeth` needed only the `attaches` entry.
103+
- THE RULE CHANGE. A modifier written after its head lost its title (the Accepted clause, whose `Her Royal Highness Princess Royal Anne` → given 'Royal' was the example). rules/H9's modifier clause now finds the phrase also in a title before the modifier that attaches to it, `_vocab.title_readings` asking `f"{prev} {n}" in title_phrases` in its modifier pass; a modifier after a head that does not attach to it still loses its title (`Her Royal Highness Princess Grand Anne` → given 'Grand'), the Accepted example now.
104+
- `royal` GAINS A DATED `given` READING (US SSA 24,394 births, Census rank 2,319). Without it, `royal` addressing by the given name read a lone `ROYAL` after a family comma as rules/H1's given-name title, so `BALES, ROYAL` read given 'BALES' and no family, which the first measurement found in 31 FEC names. With it, `royal` is a modifier that may be a given name, read everywhere as in its run, as `wing` is: `BALES, ROYAL` and `Smith, Royal` read given 'Royal', and `Royal Smith` stays given 'Royal'.
105+
- THE REPORTS, accepted by Derek on 2026-10-27 as H9's contract: a listed phrase now holds `king`, `queen`, `prince`, `princess` and `royal`, so each, read as a name word where it is the first name word after any titles and no comma has marked the given name, is reported `title-or-name`, as `Dean Smith` is (`King Curtis`, `Prince Fielder`, `Mr Prince Smith`, `Royal Smith`), the surname behind a title included (`Dr. King`, `Dr King Jr`, where the report is noise). No field moves with them. The 2j case rows that asserted no report for these now assert one.
106+
- 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.
107+
- 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.
108+
Recompute: `uv run python tools/differential/measure.py --base <checkout of this commit's parent>`.

‎docs/design/decisions/vocabulary-model.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ Open: #913 (the title words phase 2j left, read as titles though borne as names)
219219
- `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.
220220
Adding the four fields changes `Lexicon`'s pickle layout, as phase 2h did.
221221
- **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.
222+
- **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.
222223
- **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.
223224
- **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.
224225
- **2026-10-27 #913, `marquis` and `marquise` (Derek) — THE FIRST OF #913's TITLE BATCHES: both have a dated `given` reading** on their en.toml entries, US SSA 25,041 and 10,995 births, so each is a title only inside a title phrase. `Marquis Johnson`, `Mr Marquis Smith` and `Johnson, Marquise` read the given name; a noble written with the bare title does too (`Marquis de Lafayette`), the class accepted for `king` and `prince`, accepted by Derek on 2026-10-27. `Marquis of Queensberry` keeps the title. Derek chose the two words from #913's ranking on 2026-10-27. The measurement is decisions/H9's entry of this date.

‎docs/design/rules/H9-title-phrase.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@
2929
"Mr Deacon Smith" → given="Deacon"
3030
"Ms Queen Smith" → given="Queen"
3131
"Cheikh Anta Diop" → given="Cheikh"
32+
"Queen Mother Elizabeth" → title="Queen Mother"
3233
```
33-
- **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.
34+
- **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 a title before it that attaches to it, 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.
3435
```
3536
"Wing Commander Lau" → title="Wing Commander"
37+
"Princess Royal Anne" → title="Princess Royal"
38+
"Prince Consort Albert" → title="Prince Consort"
3639
"Mr Wing Lau" → given="Wing"
3740
"Mr. and Mrs. Wing Lau" → given="Wing"
3841
"President of the United States Barack Obama" → title="President of the United States"
@@ -49,6 +52,8 @@
4952
"Marshal Yanda" → ambiguities=("title-or-name",)
5053
"Mr Dean Smith" → ambiguities=("title-or-name",)
5154
"Dean Smith, MD" → ambiguities=("title-or-name",)
55+
"Prince Fielder" → ambiguities=("title-or-name",)
56+
"Dr. King" → ambiguities=("title-or-name",)
5257
"Grace Smith" → ambiguities=()
5358
"Bard Larsen" → ambiguities=()
5459
"GRACE SMITH" → ambiguities=()
@@ -99,10 +104,10 @@
99104
```
100105
"Mr Justice Smith" → given="Justice"
101106
```
102-
- A modifier whose head is not a listed title loses the title, as with duke, which the vocabulary refuses, and so does a modifier written after its head with no `of` behind it.
107+
- A modifier whose head is not a listed title loses the title, as with duke, which the vocabulary refuses, and so does a modifier written after a head that does not attach to it, with no `of` behind it.
103108
```
104109
"Grand Duke of Tuscany" → given="Grand"
105-
"Her Royal Highness Princess Royal Anne" → given="Royal"
110+
"Her Royal Highness Princess Grand Anne" → given="Grand"
106111
```
107112
- In the given part after a family comma a modifier that is not also a given name is read as listed, so the listing form and the written order of one name read it differently, the cost decision 10 took for the parts where a lone title word is a role.
108113
```

‎docs/migrate.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,11 @@ grep your fixtures for, with what 1.4 read:
896896
a title only inside a title phrase or behind a style (``"Her Majesty
897897
Queen Elizabeth"``), as ``King`` is since 2.7: 1.4 read title
898898
``Queen``, first ``Latifah``, and last ``Elizabeth``.
899+
- ``"Prince Consort Albert"``, ``"Princess Royal Anne"`` and ``"Bales,
900+
Royal"`` (2.8) — the royal title phrases are one title, and ``Royal``
901+
after a family comma is the first name: 1.4 read title ``Prince``,
902+
first ``Consort``; title ``Princess Royal``, last ``Anne``; and title
903+
``Royal``, first ``Bales``.
899904

900905
.. doctest::
901906

@@ -1048,3 +1053,8 @@ grep your fixtures for, with what 1.4 read:
10481053
'Deacon of the Church'
10491054
>>> HumanName("Queen Latifah").first, HumanName("Elizabeth II, Queen").first
10501055
('Queen', 'Queen')
1056+
>>> consort = HumanName("Prince Consort Albert")
1057+
>>> consort.title, consort.first
1058+
('Prince Consort', 'Albert')
1059+
>>> HumanName("Princess Royal Anne").first, HumanName("Bales, Royal").first
1060+
('Anne', 'Royal')

‎docs/release_log.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Release Log
1010

1111
**Behavior Changes**
1212

13+
- **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`
1314
- **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`
1415
- **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`
1516
- **Fix the given names Marquis and Marquise reading as titles.** ``Marquis Johnson`` and ``Mr Marquis Smith`` give first ``Marquis``, where 1.4.0 through 2.7.0 gave title ``Marquis`` and ``Mr Marquis``; ``Johnson, Marquise`` reads the same. A noble written with the bare title reads it as a first name too (``Marquis de Lafayette`` gives first ``Marquis``), where ``of`` keeps it (``Marquis of Queensberry``). :issue:`913`

‎nameparser/_pipeline/_vocab.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,8 @@ def title_readings(texts: Sequence[str], folded: Sequence[str],
14871487
of `title_modifiers` is a title only with a head title behind it in
14881488
its run of titles: any title that is not a modifier, or a word H2's
14891489
shape reads as one, before 'of' ('Mother Superior of the Convent'),
1490-
or in the object of 'of' or 'the' there (decision 10 of
1490+
behind a title that attaches to it in `title_phrases` ('Princess
1491+
Royal', #913), or in the object of 'of' or 'the' there (decision 10 of
14911492
decisions/vocabulary-model). Only the leading run is the head: a
14921493
modifier outside it is read as listed, one ending the name being
14931494
H5's. A
@@ -1558,7 +1559,10 @@ def title_readings(texts: Sequence[str], folded: Sequence[str],
15581559
and ((head and i < lead) or (n in contested and n not in titles))):
15591560
reading[i] = behind or linked[i] or (
15601561
i < last and folded[i + 1] in _PHRASE_LINKS
1561-
and folded[i + 1] in conjunctions)
1562+
and folded[i + 1] in conjunctions) or (
1563+
# a title before it that attaches to it ('Princess Royal')
1564+
i > 0 and reading[i - 1]
1565+
and f"{folded[i - 1]} {n}" in phrases)
15621566
behind = reading[i]
15631567
elif reading[i] or (head and is_title_shaped(texts[i], lexicon)):
15641568
behind = True

‎nameparser/config/_compiled.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'baba',
1515
'brother',
1616
'cheikh',
17+
'consort',
1718
'dame',
1819
'father',
1920
'guru',
@@ -26,6 +27,7 @@
2627
'prince',
2728
'princess',
2829
'queen',
30+
'royal',
2931
'shaik',
3032
'shaikh',
3133
'shayk',
@@ -224,6 +226,7 @@
224226
'computer',
225227
'comtesse',
226228
'conductor',
229+
'consort',
227230
'consultant',
228231
'controller',
229232
'corporal',
@@ -628,7 +631,6 @@
628631
'ritter',
629632
'rock',
630633
'rouva',
631-
'royal',
632634
'rt',
633635
'sailor',
634636
'saint',
@@ -960,6 +962,7 @@
960962
'princess',
961963
'queen',
962964
'ranger',
965+
'royal',
963966
'shaik',
964967
'shaikh',
965968
'sheik',
@@ -1006,6 +1009,7 @@
10061009
'civil',
10071010
'classical',
10081011
'computer',
1012+
'consort',
10091013
'corporate',
10101014
'credit',
10111015
'criminal',
@@ -1312,7 +1316,13 @@
13121316
'chief wo5',
13131317
'chief न्यायमूर्ति',
13141318
'chief বিচারপতি',
1319+
'king consort',
13151320
'major general',
1321+
'prince consort',
1322+
'princess consort',
1323+
'princess royal',
1324+
'queen consort',
1325+
'queen mother',
13161326
'sergeant major',
13171327
'sgt major',
13181328
})

0 commit comments

Comments
 (0)