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
6 changes: 6 additions & 0 deletions docs/design/decisions/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- `gen` is a title that may be a given name, written short, as `maj` is; the listed ranks and offices that stand before General attach to it, and `gen` and `maj` attach to `sir`: `Gen Goto` reads given 'Gen', reported `title-or-name`, `Lt Gen John Smith`, `Colonel Gen John Smith` and `Gen Sir Nick Carter` the title, `Gen. and Mrs. John Smith` the given name — 2026-11-03 #999, `gen`.
- `brig` is a title that may be a given name, written short, a title word only since this entry, attaching to `gen`, `general` and `sir`: `Brig Gen Mark Kimmitt` reads the title, `Brig Klyce` and a bare `Brig John Smith` the given name, as before — 2026-11-03 #999, `brig`.
- `hon` is a title that may be a given name only under a Chinese choice, zh.toml's `given` reading being off by default; there a style written short has its phrase partner in the article before it (`The Hon John Smith`), a rule that reaches no other word, so `The Sheikh` and `The Grace` stay epithets — 2026-11-03 #999, `hon`.
- The article before any other title that may be a given name is no partner, save before a modifier, whose object of `the` decision 10 reads (`The Wing Smith` → title 'The Wing'), at the head, after a comma and under every order: `The Marquis de Sade` reads given 'The Marquis', `The Marquis of Tavistock` the title — 2026-11-03 #913, the article (Derek).

## Log

Expand Down Expand Up @@ -146,3 +147,8 @@
- PSC's filers type the title in a box of its own, and 15 of the 21 typed `Baron` there (`uv run python tools/differential/local_agreement.py psc-individuals --base <checkout> --list 30`: 14 regressions, 6 progress, 1 changed): peers (`Baron James Rudolph Palumbo`) and six Turkish or Turkmen filers (`Baron Ahmet Bayin`), against 6 who typed it as the forename (`Mr Baron Phillips`). rules/H9's Accepted bullet for a noble written with the bare title rests on the record data writing the word there almost only as a given name, which holds for `baron` in the US records and not in the UK's, where barons exist and file as one.
- Two shapes the grid found, for a later attempt: a life peer's style (`Baron Smith of Kensington`) would have read given 'Baron', `of` partnering only directly after the word; and a leading `The`, a conjunction, joins a title read only in a phrase into the given name, `The Baron de Coubertin` → given 'The Baron', as master reads `The Marquis de Sade` → given 'The Marquis'.
Recompute: on a tree giving en.toml's `baron` a `given = { us_ssa = 7059, as_of = 2026-11-03, note = "spike" }` reading, `uv run python tools/differential/measure.py --base <checkout of a1b3e186>`, then the `local_agreement.py` line above.
- **2026-11-03 #913, the article (Derek) — A LEADING `The` IS NO PARTNER FOR A TITLE THAT MAY BE A GIVEN NAME: THE EPITHET BULLET WIDENED TO EVERY SUCH WORD.** The `baron` entry's shape grid (above) showed `The Marquis de Sade` reading given 'The Marquis', family 'de Sade', `the` being a conjunction that joins the word into the given name, where 1.4.0 read title 'The Marquis'. The `mahdi` and `bard` entry and the `buddha` entry had accepted the shape for their words as epithets, and #999's `hon` entry kept the article from partnering any word but a style written short (`The Sheikh` stays an epithet); nothing had recorded it for the rest.
- THE REACH (tree `a1b3e186`): every word in `titles_ambiguous`, 37 on that tree, in `The X John Smith`, `The X Smith`, `Smith, The X John`, `John Smith, the X`, `The X Smith, John` and `The X of Bute John Smith`, under all three orders. 35 lose the title behind the article in every shape but the last, under every order; `royal` and `wing` keep it, the modifier rule reading the object of `the` (decision 10); `of` after the word keeps it for all 37. In the wheels (`PYTHONSAFEPATH=1`, `nameparser.__file__` asserted on both sides, `The X John Smith`): 1.4.0 read title `The X` for 31 of the 37, all but `brig`, `dean`, `grace`, `justice`, `major` and `marshal` (`The Dean John Smith` → first 'The Dean'); 2.8.1 for eight, `gen`, `maj`, `majesty`, `pharaoh`, `royal`, `sailor`, `saint` and `wing`, the rest having moved with their batches.
- WHAT THE ARTICLE WOULD FIX, MEASURED BY THE BIGRAM, since a partner keyed on `the` moves only a name holding `the` directly before such a word: 5 lines in the 13 local corpora (8,700,048 entries, 2026-11-03), four reading a title already: `The Marquis of Tavistock` and ORCID's `The King of Shengxin Wang` by `of`, PSC's `His Royal Highness The Prince Of Wales Charles Philip Arthur George Mountbatten Windsor` and `His Majesty The King In Right Of Alberta`, a corporate filer, by the style before the article. The fifth is ORCID's `Satan The Princess Of Darkness Cock`, given 'Satan The Princess Of Darkness', no person's name. In the committed corpora, 4 hits: the two epithets the `mahdi` entry accepted, and `the Queen's Bench` in corpus.jsonl and corpus_rules.jsonl, a title already through decision 10. So no real person's name reads differently for want of the partner, which would reverse three recorded costs and #999's narrowing.
- DECIDED: keep the shape. rules/H9's epithet bullet now names every title that may be a given name, with `The Marquis de Sade` and `The Saint Thomas More` as its examples and `The Marquis of Tavistock` as the partner that keeps the title.
Recompute: `grep -o -i -E '(^|["[:space:],])the (<the titles_ambiguous words joined by |)\b' ~/.cache/nameparser-tools/local/*/corpus.jsonl tools/differential/corpus*.jsonl`, the word list from `sorted(Parser().lexicon._sets.titles_ambiguous)`.
5 changes: 4 additions & 1 deletion docs/design/rules/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@
"The Hon. Wing Lau" → title="The Hon. Wing"
"John Smith Wing. Jr." → title="Wing."
```
- An epithet that is also a given name, written with its article before the name or after a comma, reads as a name word, the article joining it; no name data at hand writes either shape.
- A title that may be a given name, written with its article before the name or after a comma, reads as a name word, the article joining it, as an epithet does, unless it is a style written short or has another partner, such as `of` after it; the name data at hand writes the article there almost only before `of` or behind a style.
```
"The Mahdi Muhammad Ahmad" → given="The Mahdi"
"William Shakespeare, the Bard" → given="the Bard"
"The Marquis de Sade" → given="The Marquis"
"The Saint Thomas More" → given="The Saint"
"The Marquis of Tavistock" → title="The Marquis of Tavistock"
```
- A religious title that also opens given names, in its own tradition or another, 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; the name data at hand writes the title there almost never.
```
Expand Down
2 changes: 1 addition & 1 deletion tests/v2/rules_budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"H6": {"words": 316, "then_words": 79, "because_sentences": 3, "except": 4, "precedence": 0, "accepted": 2, "accepted_words": 100},
"H7": {"words": 339, "then_words": 270, "because_sentences": 2, "except": 0, "precedence": 0, "accepted": 1, "accepted_words": 54},
"H8": {"words": 431, "then_words": 68, "because_sentences": 3, "except": 3, "precedence": 3, "accepted": 3, "accepted_words": 131},
"H9": {"words": 778, "then_words": 292, "because_sentences": 3, "except": 0, "precedence": 6, "accepted": 11, "accepted_words": 545},
"H9": {"words": 778, "then_words": 292, "because_sentences": 3, "except": 0, "precedence": 6, "accepted": 11, "accepted_words": 574},
"M1": {"words": 231, "then_words": 120, "because_sentences": 2, "except": 1, "precedence": 2, "accepted": 0, "accepted_words": 0},
"M2": {"words": 714, "then_words": 435, "because_sentences": 1, "except": 4, "precedence": 1, "accepted": 6, "accepted_words": 209},
"M3": {"words": 234, "then_words": 84, "because_sentences": 2, "except": 2, "precedence": 2, "accepted": 1, "accepted_words": 80},
Expand Down
3 changes: 3 additions & 0 deletions tools/differential/corpus_rules.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,11 @@
"The Hon. Justice Mary Smith"
"The Hon. Wing Lau"
"The Mahdi Muhammad Ahmad"
"The Marquis de Sade"
"The Marquis of Tavistock"
"The Rev. Deacon John Smith"
"The Right Hon. the President of the Queen's Bench Division"
"The Saint Thomas More"
"Torres Sánchez-Cid Andrés"
"VI, AD"
"Van Buren, Ed"
Expand Down
3 changes: 3 additions & 0 deletions tools/differential/snapshot.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -3692,11 +3692,14 @@
{"name": "The Hon. Wing Lau", "title": "The Hon. Wing", "family": "Lau", "initials": "L.", "capitalized_force": "the Hon. Wing Lau"}
{"name": "The Lord of the Universe", "title": "The Lord of the Universe", "capitalized_force": "the Lord of the Universe"}
{"name": "The Mahdi Muhammad Ahmad", "given": "The Mahdi", "middle": "Muhammad", "family": "Ahmad", "initials": "M. M. A.", "capitalized_force": "the Mahdi Muhammad Ahmad"}
{"name": "The Marquis de Sade", "given": "The Marquis", "family": "de Sade", "initials": "M. S.", "capitalized_force": "the Marquis de Sade"}
{"name": "The Marquis of Tavistock", "title": "The Marquis of Tavistock", "capitalized_force": "the Marquis of Tavistock"}
{"name": "The Rev. Deacon John Smith", "title": "The Rev.", "given": "Deacon", "middle": "John", "family": "Smith", "initials": "D. J. S.", "capitalized_force": "the Rev. Deacon John Smith"}
{"name": "The Right Hon. the President of the Queen's Bench Division", "title": "The Right Hon. the President of the Queen's Bench", "family": "Division", "ambiguities": ["TITLE_OR_NAME"], "alternatives": ["TITLE_OR_NAME: title as title (vocabulary)"], "initials": "D.", "capitalized_force": "the Right Hon. the President of the Queen'S Bench Division"}
{"name": "The Rt Hon", "title": "The Rt", "family": "Hon", "ambiguities": ["TITLE_OR_NAME"], "alternatives": ["TITLE_OR_NAME: title as title (vocabulary)"], "initials": "H.", "capitalized_force": "the Rt Hon"}
{"name": "The Rt Hon John Jones", "title": "The Rt Hon", "given": "John", "family": "Jones", "initials": "J. J.", "capitalized_force": "the Rt Hon John Jones"}
{"name": "The Rt Hon Kenneth Clarke QC MP, HMG", "title": "The Rt Hon", "given": "Kenneth", "family": "Clarke", "suffix": "QC MP, HMG", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "K. C.", "capitalized_force": "the Rt Hon Kenneth Clarke QC MP, HMG"}
{"name": "The Saint Thomas More", "given": "The Saint", "middle": "Thomas", "family": "More", "initials": "S. T. M.", "capitalized_force": "the Saint Thomas More"}
{"name": "Theobald, Dietrich von", "given": "Dietrich", "family": "von Theobald", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "D. T."}
{"name": "Theodor von Schön", "given": "Theodor", "family": "von Schön", "initials": "T. S."}
{"name": "Thibaut II.", "given": "Thibaut", "suffix": "II.", "ambiguities": ["GIVEN_OR_FAMILY"], "alternatives": ["GIVEN_OR_FAMILY: name as family (position)"], "initials": "T.", "generation": "II."}
Expand Down
Loading