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 docs/design/decisions/H1-title-and-one-name-word.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Elsewhere: the graf class, a title word borne as a name but rarely as its first word shipping as a title (`Greve Anna` → title 'Greve', family 'Anna'), is decisions/salutation-titles' 2026-10-04 #606 bundle; the renunciate class, the given-name titles of traditions that drop the surname (`Swami Vivekananda` → given 'Vivekananda'), is decisions/indic-honorifics' 2026-09-06 #346/#344/#343 bundle.

Open: [#913](https://github.com/derek73/python-nameparser/issues/913) (the title words still read as titles though borne as names, #348's question answered by rules/H9: `Baron Davis` reads title 'Baron'; `Prince Fielder` reads given 'Prince' in the default order since 2026-10-27, decisions/H9); [#815](https://github.com/derek73/python-nameparser/issues/815) (whether N3 sets a suffix aside as this rule does, the nickname-led question the 2026-08-25 #410 entry left open: `'Smitty' Jones Jr.` reads given 'Jones', family '').
Open: [#815](https://github.com/derek73/python-nameparser/issues/815) (whether N3 sets a suffix aside as this rule does, the nickname-led question the 2026-08-25 #410 entry left open: `'Smitty' Jones Jr.` reads given 'Jones', family '').

## Log

Expand Down
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`.
- `lady` is a title that may be a given name only under a Spanish choice, es.toml's `given` reading being off by default, and `locales.ES` makes that choice; eight more titles borne as given names, `sir`, `general`, `bishop`, `colonel`, `canon`, `author`, `empress` and `lawyer`, stay titles everywhere, their counts on their title readings — 2026-11-03 #913, the last nine.
- 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 @@ -152,3 +153,8 @@
- 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)`.
- **2026-11-03 #913, the last nine (Derek) — `lady` A GIVEN NAME UNDER A SPANISH CHOICE; `sir`, `general`, `bishop`, `colonel`, `canon`, `author`, `empress` AND `lawyer` KEPT TITLES.** The nine words #913 held after `baron` (the entry above) were read two ways. Their move totals are the fourteen-word spike's (the `saint` entry above: one throwaway tree giving each word a `given` reading, measured against master `df7b1821`), counted here by every moved name holding the word, so a name holding two counts under each. Their filed boxes come from a second throwaway tree giving the nine alone a `given` reading, read against master `a1b3e186` (`uv run python tools/differential/local_agreement.py <corpus> --base <checkout> --list 2000` for psc-individuals, orcid-researchers and patentsview-inventors), the lesson of the `baron` entry, before anything was decided. Eight lose where their filers state the reading, and `lady` splits by country. DECIDED (Derek): the default keeps all nine titles, and es.toml gives `lady` a `given` reading written `default = false`, which a Spanish choice turns on, as zh.toml's `hon` is under a Chinese one (the `hon` entry above). Each word's counts are recorded in the note on its title reading in en.toml, so a later batch meets them.
- THE EIGHT, by psc-individuals' boxes (title box against forename box) and the other corpora's moved names: `sir` 287 against 17, of 742 moved names holding it (27 committed fixtures; 721 holding neither `general` nor `bishop`, the count the `saint` entry gives), govuk-people's 195 and ukec-individuals' 141 knights (`Admiral Sir Ben Key`), orcid-researchers 7 given boxes; `bishop` 18 against 1 of 44, fec-individuals' 18 mostly clergy (`GORDON, BISHOP SIMON`); `canon` 16 against 0 of 27, jrc-names' 7 mostly the camera maker (`Canon PowerShot`); `colonel` 7 against 0 of 28, fec-individuals' 11 officers (`BARROWS, COLONEL BOB`); `general` 5 against 1 of 94 (20 also holding `sir`), govuk-people's 26 and jrc-names' 27 officers (`Lieutenant General Ian Cave`, `General De Gaulle`); `author` 9 moves: 4 a role label after a comma (`Bob Jones, author`), 4 orcid-researchers records opening with it, 2 of them typed in the given box (`Author Aguttu Judith Mary`), and ctgov-officials' `Author Swift, MD`; `empress` 3 moves, 1 forename box (`Empress Lawrence`) against jrc-names' `Empress Michiko` twice; `lawyer` 3 moves, 1 given name (`WESTBROOK, LAWYER III`) against 2 role labels, one of them a psc-individuals title box.
- `lady`, 557 moves: psc-individuals' filers typed it in the title box 160 times and the forename box 19, and ukec-individuals' 59 names opening with it are titles (`Lady Annabel Goldsmith`), while 137 orcid-researchers typed it as their given name, 111 of them in Spanish-speaking countries (Ecuador 41, Colombia 30, Peru 12, Argentina 5, Venezuela 5, Costa Rica 4, Paraguay 3, Chile 2, Spain 2, and seven more with one each) and 9 in the Philippines, beside tse-donors' 13 Brazilian donors (`LADY ANA DA SILVA SOARES`) and about 15 of fec-individuals' 16 (`DISIMULACION, LADY KIMA`); jrc-names' 146 are mostly titles, characters and stage names (`Lady Astor`, `Lady Macbeth`, `Lady Gaga`). Under the choice the title is one only inside a title phrase: `Hon Lady Smith` (`hon` attaches to it), `Lady of Shalott`, and the offices `lady` attaches to by name, `justice`, `chief`, `mayor`, `provost` and `captain` (`Lady Chief Justice Smith`, `Lady Mayor Smith`), keep it, and `Lady Heidenreich` and `DISIMULACION, LADY KIMA` read the given name, `Lady Heidenreich` reporting `title-or-name` since listed phrases hold the word, where it opens the name after any titles with no comma; after a family comma nothing is reported (`DISIMULACION, LADY KIMA`, `Smith, Lady`). The offices were added after the design-docs review read `Lady Chief Justice Smith` as given 'Lady', middle 'Chief' under the choice; no local corpus writes them before a name, and one jrc-names text writes `Lady Captain` alone, which keeps the title with them. They are words rather than kinds for `hon`'s reason (the `hon` entry above), and five, under its six. `locales.ES` makes the choice, unlike `locales.ZH`, so the pack reads it too.
- THE CHOICE'S COSTS, accepted by Derek in choosing it: a peeress written with the bare title reads the given name, and under `locales.ES` rules/O6's two family names then take her own given name into the family (`Lady Annabel Goldsmith` → given 'Lady', family 'Annabel Goldsmith'; the plain choice reads middle 'Annabel'); alone after a full name and a comma the word reverses the name (`John Smith, Lady` → given 'Lady', family 'John Smith'), as `hon` does; a leading `The` joins it into the given name (`The Lady Smith` → given 'The Lady'), the shape the article entry above keeps on purpose; and a conjoined pair opening with it does too (`Lady and Sir John Smith` → given 'Lady and Sir'). Every title after it but the five it attaches to loses the phrase (`Lady Judge Smith`, `Lady Professor Smith` → given 'Lady'): the five are the offices found written after it, one slot left under `hon`'s six.
- MEASURED under the choice (2026-11-03, py3.11): the 595 local-corpus texts holding `lady` as a word, distinct within each corpus (`(?i)(?<![\w])lady(?![\w])` over `~/.cache/nameparser-tools/local/*/corpus.jsonl`; 592 deduplicated across corpora), each parsed with `parser_for(Locale(code="es", lexicon=Lexicon.empty(), languages=frozenset({"es"})))` and with `parser_for(locales.ES)`, the reading on this tree compared with the same parser's on master `f175d013`: 556 moved under each, the same 556 (553 deduplicated), every one from title 'Lady' to a name word: orcid-researchers 143, psc-individuals 179, jrc-names 145, ukec-individuals 59, tse-donors 13, fec-individuals 16, govuk-people 1. The choice's cost is the British title written bare (psc-individuals' 160 title boxes, ukec-individuals' 59), borne by a caller who reads British names under a Spanish choice, as `hon`'s is under a Chinese one. `fil.toml` and `pt-BR.toml` hold no reading of `lady`, so a Filipino or Brazilian choice reads the title, its 9 and 13 bearers there left for a later batch.
2 changes: 0 additions & 2 deletions docs/design/decisions/vocabulary-collisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title

- A credential written as a word (`pc`, `dl`) may also earn the marking by being written as a person's initials in the position its claim acts on, which is C-i's ground read for initials, and as for a name it takes a per-word count of that writing on the word's name reading (ORCID's boxes for `pc` and `dl`) — 2026-10-30 #965.

Open: #913 (the title words still read as titles that are also borne as names).

## Log

- 2026-08-16 #348/#360/#342/#385 (C-i's reach for the suffix acronyms and the Applications bullet's rai clause superseded, as the notes on those bullets say) — THE COLLISION KEYSTONE: the base-rate entry that follows and the undated C-i, C-ii, "The concrete demonstration", "Applications" and "C-ii's per-word framing" bullets after it; C-i's position qualifier is the 2026-08-17 entry, and the demonstration bullet was rewritten for #296's audit.
Expand Down
3 changes: 2 additions & 1 deletion docs/design/decisions/vocabulary-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The vocabulary was a set of base sets plus marker subsets (`particles` and `part

Not standing: the plans the classifications carried out, phase 1's mechanical conversion of the unclassified categories into `und.toml` (2026-10-18 #737) and the shared readings left in place until their categories were classified (2026-10-19 #749), both done by 2026-10-20 #751, the conjunctions; and #747's reason for exempting `und.toml`, its entries keeping the Python lists' order for its vetting comments to point along (2026-10-19 #747), overtaken once it held two entries and no such comment.

Open: #913 (the title words phase 2j left, read as titles though borne as names), #753 (phase 3, language packs; the 16 words strict ungates, each read for a name reading in the chosen file), #754 (phase 4, order, shapes and the output model; the `Lexicon` surface's build, 4i-a to 4i-d).
Open: #753 (phase 3, language packs; the 16 words strict ungates, each read for a name reading in the chosen file), #754 (phase 4, order, shapes and the output model; the `Lexicon` surface's build, 4i-a to 4i-d).

## Log

Expand Down Expand Up @@ -238,6 +238,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-11-03 #913, the last nine (Derek) — `lady` HAS A `given` READING IN es.toml, off by default**, so a Spanish choice, and `locales.ES`, reads it as a given name and the title only inside a title phrase (`Lady Heidenreich` → given 'Lady', `Lady Chief Justice Smith` → title); the default keeps it a title, as it keeps `baron` and the other eight, `sir`, `general`, `bishop`, `colonel`, `canon`, `author`, `empress` and `lawyer`, each with its counts on its title reading. The measurement is decisions/H9's entry of this date.
- **2026-11-03 #913, `saint`, `pharaoh`, `sailor` and `majesty` (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. `Saint Clair Soares`, `Pharaoh Mwale`, `Mr Sailor Vinod` and `CAMPBELL, MAJESTY BARRETT` read the given name, and `SAINT CLAIR, ELAINE` keeps the surname whole; a saint or pharaoh written with the bare word does too (`Saint Thomas More`), accepted by Derek on 2026-11-03. `Saint of Assisi`, `His Majesty King Charles` and, through `pope` and `saint` attaching to each other, `Pope Saint John Paul II` keep the title; an `attaches` entry may name a word that is also a kind of another category (`saint`, a particle kind), which the build refused until then. Derek chose the four from a measurement of all fourteen words #913 had left, the other ten staying titles. The measurement is 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.
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 @@ -183,10 +183,12 @@
```
"Chief Dean and Mary Smith" → title="Chief Dean and Mary"
```
- Whether a title word may be a given name follows the language choice, so a salutation that another language writing the same script makes the first element of a given name is a title by default, the language a text is in being unknowable from its script, and a name word under that language's choice: Nepali writes `श्री` as a given name's first word where Hindi, Marathi and Konkani write it as Mr., so `श्री कृष्ण श्रेष्ठ` reads title `श्री` by default, and under a Nepali choice `श्री` is a title only inside a title phrase (`His Excellency श्री कृष्ण श्रेष्ठ` → title `His Excellency श्री`) and elsewhere a name word placed by position (#870).
- Whether a title word may be a given name follows the language choice, so a title that another language writing the same script makes a given name, or its first element, is a title by default, the language a text is in being unknowable from its script, and a name word under that language's choice: Spanish-speaking Latin America writes `Lady` as a given name where British names write it as a title, so `Lady Heidenreich` reads title `Lady` by default and given `Lady` under a Spanish choice, a peeress written with the bare title reading the given name there too; Nepali writes `श्री` as a given name's first word where Hindi, Marathi and Konkani write it as Mr., so `श्री कृष्ण श्रेष्ठ` reads title `श्री` by default, and under a Nepali choice `श्री` is a title only inside a title phrase (`His Excellency श्री कृष्ण श्रेष्ठ` → title `His Excellency श्री`) and elsewhere a name word placed by position (#870).
```
"श्री कृष्ण श्रेष्ठ" → title="श्री"
"श्री कृष्ण श्रेष्ठ" [ne] → given="श्री"
"Lady Heidenreich" → title="Lady"
"Lady Heidenreich" [es] → given="Lady"
```

---
Expand Down
Loading
Loading