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
1 change: 1 addition & 0 deletions docs/design/decisions/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ Not standing: what a v1 caller's `titles` list did to a title that may be a give
- `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.
- 2026-11-19 #1457 — nineteen job and degree qualifiers join the modifiers (`medical`, `clinical`, `study`, `head`, `child`) and thirty-nine jobs and degrees the titles, read after a comma as any title is (`Nadir Qassoumi, Medical Doctor` → title 'Medical Doctor') and, for a modifier, in the given part after a family comma too (`Qassoumi, Medical Nadir`); none takes a `given` reading. The words, their counts and the costs are decisions/salutation-titles' 2026-11-19 #1457 entry.
9 changes: 9 additions & 0 deletions docs/design/decisions/salutation-titles.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Closes #606 (#662 later added owura and bapak, its bullet below, and #847 cllr).

Elsewhere: `justice` and `marshal`, excluded here as common leading-position names, are titles only inside a title phrase since 2026-10-25 and 2026-10-26 (`Chief Justice John Roberts` reads title 'Chief Justice' and `Field Marshal Bernard Montgomery` title 'Field Marshal', `Justice Smith` and `Marshal Yanda` the given name) — decisions/H9's 2026-10-25 #752, phase 2i entry; decisions/H9's 2026-10-26 #752, phase 2i (Derek) entry.
- A Persian title is a plain title that addresses the family name (`دکتر رضایی` reads family), written in fa.toml, and an Arabic title typed with Persian yeh and kaf is a `same_as` spelling of ar.toml's, listed rather than folded; the words that open real Persian family names (`شیخ`, `حاج`, `حاجی`, `آقا`) stay out — 2026-11-10 #1151
- A job or a degree written out after the name and a comma (`Nadir Qassoumi, Bachelor`) is an `occupation` title, and a word that qualifies one (`Medical Doctor`, `Clinical Research Coordinator`) a `modifier`, in English, word by word on the counts on each entry; as a title the word is claimed in front of a name too, so a surname that mostly qualifies a head is listed as a modifier, which claims none alone (`head`, `child`), and the surnames listed as heads ship on the graf exception with their counts (`masters`, `student`, `bachelor`, `degree`): the 2026-11-19 #1457 entry lists the 58 words, the words refused, and the costs taken — 2026-11-19 #1457.

## Log

Expand Down Expand Up @@ -60,3 +61,11 @@ Elsewhere: `justice` and `marshal`, excluded here as common leading-position nam
- **`خانم` is a title only in front** (rules/H1's accepted cost): after the name it is Khanum, a suffix of Persian and Azerbaijani women's names, which the title claim does not reach (`زهرا خانم` reads family `خانم`). It has no `given` reading. DECLINED for now: a `given` reading, which would make it a title only in a phrase (rules/H9) with no count of a name opening with it to justify the cost.
- **Left open, with the measurement the issue holds:** the spaced `آیت الله`, `حجت الاسلام` and the qualifiers `والمسلمین` and `العظمی` after them, which need rules/H9's `attaches`; a ZWNJ typed at a word's edge, and the same words with no ZWNJ at all (`آیتالله`) (`مهندس‌ علی`), which decisions/T1 leaves to the caller; `مرحوم` and `شهید` as `status` readings, since a plain `مرحوم` title made `رضایی، حسن (مرحوم)` read title where it read nickname (so it is not listed); and `حاج`, `حاجی`, `شیخ` and `آقا`, which open real family names (9 of the 315 Assembly of Experts names, peeled by rules/H6's `شیخ احمدی، حسن`) and stay out as bare `شيخ` does in ar.toml (#269), each an `excluded` entry in fa.toml with that reason, so a contributor who re-adds one meets it as a build error. A Persian-letter `سید` has no entry: it is not measured.
- **Moves:** two of CLDR's fictional `fa` renderings (`آقای امیر هوشنگ رستگار دکتر`, and its family-first twin) read title `آقای` where they read it as the given name; both records re-recorded as progress.
- **2026-11-19 #1457 — JOB AND DEGREE WORDS WRITTEN AFTER THE NAME AND A COMMA ARE TITLES.** ClinicalTrials.gov's officials and contacts write a job or a degree spelled out after the name and a comma (`Nadir Qassoumi, Bachelor`, `Nadir Qassoumi, Medical Doctor`), and an unlisted word there is read as the given name and the whole name before the comma as the family, in 1.4.0 through 3.1.0 (both wheels checked). Decided on the issue (its 2026-11-19 decision comment): vocabulary, not a rule; titles, which keep a surname-first `Masters, John` (a credential reading would take the family of `John Masters`); the words after the first joined by title modifiers; the field `title`, for a degree too; no new report of the reversal; misspellings and other languages out. A title claims the front of a name as well as the part after a comma, so the words are weighed at both.
- **THE POPULATION.** The distinct `name` values of `ctgov-officials` and `ctgov-contacts` (`raw.jsonl`, fetched 2026-11-18): 652,782. A comma part counts where the text after a comma opens with `[A-Za-z][a-z]{3,}` not followed by a letter, and master `d12af9d6` reads the token opening it as neither title nor suffix: 15,067 names, 5,617 of them `Site` in any case (`Site 0001`, not people), leaving 9,450 (the issue's 14,773 and about 9,150 used a narrower word shape). Of those, 9,273 hold two words or more before the first comma, and 9,000 of them are REVERSED: the parse reads the whole text before the comma, spaces folded, as the family. The candidates are the words opening those parts and the words after them inside the part, by count, every job or degree word down to 13 parts: 39 heads and 20 qualifiers. Ranked with `tools/vocab/word_report.py --rank`.
- **Listed, `occupation`** (each with its counts on its reading's `note`): `bachelor`, `bachelors`, `doctorate`, `masters`, `student`, `specialist`, `pharmacist`, `physiotherapist`, `oncologist`, `midwife`, `cardiologist`, `postgraduate`, `graduate`, `undergraduate`, `fellow`, `dentist`, `neurologist`, `statistician`, `demonstrator`, `coordinator`, `postdoc`, `postdoctor`, `physio`, `academician`, `anesthesiologist`, `intern`, `trainee`, `nephrologist`, `dietitian`, `nutritionist`, `urologist`, `physiatrist`, `optometrist`, `gastroenterologist`, `radiologist`, `therapist`, `degree`, `diploma`, `candidate`. **Listed, `modifier`**: `medical`, `clinical`, `research`, `study`, `doctoral`, `full`, `attending`, `associated`, `registered`, `project`, `teaching`, `adjunct`, `occupational`, `physical`, `postdoctoral`, `pediatric`, `child`, `lead`, `head`. A modifier claims no front of a name without a head title behind it (rules/H9), so the surnames `head`, `child`, `lead`, `full` and `study` are modifiers and keep a name they open (`Head Mary Smith` reads given 'Head').
- **THE GIVEN-NAME WEIGHING (C-i, decisions/vocabulary-collisions).** No word takes a `given` reading, so none is a title only in a phrase. ORCID's given boxes over its whole extract (24,990,909 people, `tools/name_usage.py --boxes`, 2026-11-19) hold `research` 374 times, `medical` 160, `clinical` 65, `study` 63 and `student` 48, each the word typed into the box rather than a name (`Research Group`). The words borne as given names at all are few: `child` 131 US SSA births since 1880, `head` 26 Wikidata given-name statements, `masters` 2 and 13 ORCID given boxes, `degree` 10 ORCID given boxes. `child` and `head` are modifiers, which claim no leading name word alone. The heads that are surnames, `masters` (US Census 23,533), `bachelor` (1,186), `degree` (1,139) and `student` (733), ship on this file's graf exception, a word borne as a name only rarely in the leading position, with the counts on their notes: a surname opens a name only written family-first, which FEC writes with a comma that keeps a one-word surname (`MASTERS, X`, 182 names, corpus.jsonl lines opening `"MASTERS,`) and not a double one (4 names, the cost below), and ORCID's `orcid-researchers` (1,831,533 records) opens a given box with `Degree` twice.
- **Refused:** `principle`, `principal` misspelled (`Principle Investigator`), opening 16 of the 9,450 parts, an `excluded` entry. Left unlisted, outside the decision rather than refused, each counted as the opening word of the 9,450 parts: misspellings (`proffesor` 68, `proffessor` 63, `docter` 44, `assisstant` 21), fields of study written where the job would be (`medicine` 232, `psychology` 53, `cardiology` 46, `nursing` 43, `physiotherapy` 32), abbreviations (`pharm` 47, `cand` 20, `asist` 20), other languages (`docteur` 31), and `post` (73 parts, 20 of them `post doc`), a surname written before an unlisted word.
- **MEASURED** against master `d12af9d6` (2026-11-19, py3.11). Of the 9,000 reversed names, 4,972 now read the name before the comma apart, 3,685 still read the opening word as the given name (the unlisted words above), and 343 read a listed word as the title but stay reversed, an unlisted word behind it taken as the given name (`Nadir Qassoumi, Clinical Pharmacologist` → title 'Clinical', given 'Pharmacologist', family 'Nadir Qassoumi'; a title run with `in` behind it, 74 of the 343, `Masters in Physiotherapy`, `Medical Degree in Surgery`); no name of the 9,450 reads reversed that did not. By country, the ten with most names read apart, reversed names before → after and their share of the country's distinct names: China 1,599 → 415 (2.6% → 0.7% of 61,369), Turkey 800 → 304 (3.7% → 1.4%), Egypt 776 → 345 (4.7% → 2.1%), France 521 → 201 (1.0% → 0.4%), Spain 740 → 447 (3.2% → 1.9%), no country stated 563 → 290 (1.0% → 0.5%), Brazil 424 → 203 (4.0% → 1.9%), the United States 371 → 163 (0.2% → 0.1%), Italy 398 → 244 (1.8% → 1.1%), Denmark 222 → 75 (2.1% → 0.7%); Iraq, the issue's highest share, 49 → 11 of 609 (8.0% → 1.8%). A name in several countries' studies counts in each. `tools/differential/snapshot.py --local <corpus> --base <master>` moves ctgov-contacts' 4,638 entries and ctgov-officials' 3,704: beside the reversals, a title moving out of the suffix or the nickname with the name fields kept (`Nadir Qassoumi, PhD Student` → title 'Student', suffix 'PhD'; `Nadir Qassoumi (Medical Doctor)` → title 'Medical Doctor'), and labels that name no person read wrong before and after (`Medical Director`, given 'Medical' before and title 'Medical' after). The committed snapshot moves one name (`Doe, John, MD PhD - FACS Fellow` → title 'Fellow', its `comma-structure` report gone), CLDR and GND none.
- **THE COSTS, accepted:** a name the word opens reads it as the title under every order, as any title does (`Student Mary Jones` → title 'Student'; `Masters John` under `FAMILY_FIRST` → title 'Masters', family 'John'); local_agreement scores 4 orcid-researchers records as regressions, the 2 given boxes opening with `Degree`, a box typed `Child.org` and one typed with a job and a name, while psc-individuals' one filer opening with `Student` typed it in the title box. A word alone after a surname and a comma leaves no given name (`Qassoumi, Student`), as `Smith, Dr.` does; a modifier opening the given part after a family comma is the title (`Qassoumi, Medical Nadir`, rules/H9's `Hudson, Rock`); a salutation and the word alone now reports `title-or-name` (`Mr Masters`, as `Mr. Bishop` does; no local corpus writes the shape). For `masters`, a surname (US Census 23,533): opening a double surname before a family comma it is the title by rules/H6 (`Masters Boyd, Helen` → title 'Masters', family 'Boyd'), 4 of FEC's 1,893,964 names; in a part past the second comma it is the title by rules/C2 (`Jones, Mary, Masters`), 1 FEC name; written with a full stop ending a name it is the title by rules/H5 (`John Masters.`, as `John Bishop.`). FEC moves 6 names in all, the sixth a label. No listed word stands after a comma as a given name in FEC, and its other names opening with `HEAD` (186), `CHILD` (53) or `MASTERS` written `MASTERS, X` keep their family; a surname ending a name without a full stop keeps it (`Anna Child`, `Mary Head`, `John Masters`). govuk-people moves 2 names toward their title (a deputy head of mission, written with the name behind the title), jrc-names 2 (an academician's title, and a label), psc-individuals 4 (3 scored as progress), orcid-researchers 43: a job or degree typed into a name box, read as the title where it was a given or family name (`X Y, Masters`, `X Y, Physical Therapist`, `PhD Student` leaving the suffix), and junk boxes reshaped (a box opening `Specialist in` now reads given 'in'), its agreement scoring the 4 regressions above and 16 records changed between two wrong readings; cz-candidates, ukec-individuals, patentsview-inventors, tse-donors and the rest none.
- **`Master's degree`, weighed apart and not listed.** The possessive is one word, so it needs readings of its own: `master's`, `bachelor's` and `doctor's` as `occupation` beside `degree` would read 248 of the 277 registry names whose part after a comma opens with one of them written with an apostrophe (`master's` 166, `bachelor's` 73, `doctor's` 34; the rest written with `´`), measured with a caller's lexicon on 2026-11-19. The files hold possessives already, as modifiers (`king's`, `queen's`), so the reading is expressible; whether a degree's possessive is a title is left for its own decision, the issue weighing it apart.
2 changes: 2 additions & 0 deletions docs/design/rules/H9-title-phrase.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"John Smith, Vice" → title="Vice"
"Lau, Wing" → given="Wing"
"Lau, Wing Commander" → title="Wing Commander"
"Nadir Qassoumi, Medical Doctor" → title="Medical Doctor"
"John Smith Wing." → family="Wing."
```
- **A title that may be a given name, 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 as `title-or-name` where a phrase the vocabulary lists holds it; inside a phrase, later in the name, or in the given part after a family comma, it is not. A word no listed phrase holds is a title only behind a style or a modifier, or before `of`, the partners every such word shares, so standing alone it is no title a reader would hesitate over.
Expand Down Expand Up @@ -145,6 +146,7 @@
- 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.
```
"Hudson, Rock" → title="Rock"
"Qassoumi, Medical Nadir" → title="Medical"
```
- A phrase that is the whole given part after a family comma leaves the given name empty, as a lone title there does.
```
Expand Down
30 changes: 30 additions & 0 deletions docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2246,3 +2246,33 @@ father's name with its marker under ``PatronymicRule.TURKIC``
3.0 and 3.1 gave ``Hasan`` and ``oglu``). With ``capitals_as_family``
on too, the family the capitals name is divided (``Ana GARCÍA LÓPEZ``
gives ``GARCÍA`` and ``LÓPEZ``), where 3.1 left it whole.

A job or degree after a comma
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

A job or degree written out after the name and a comma is the title,
where 1.4 through 3.1 read it as the given name and the whole name
before the comma as the family. A word that qualifies the job joins it
(``Medical Doctor``, ``Clinical Research Coordinator``). The words are
English, as ClinicalTrials.gov, where the shape was measured, fills its
forms in English, and a misspelling (``Proffesor``) or a possessive
(``Master's degree``) still reads the old way:

.. doctest::

>>> qassoumi = parse("Nadir Qassoumi, Medical Doctor")
>>> qassoumi.title, qassoumi.given, qassoumi.family
('Medical Doctor', 'Nadir', 'Qassoumi')
>>> parse("Masters, John").family
'Masters'

A name the word opens reads it as the title too, as with any title
(``Student Mary Jones`` gives title ``Student``), and so does one
alone after a surname and a comma (``Qassoumi, Student`` gives no given
name). To read such a word as a name, remove its reading:

.. doctest::

>>> as_31 = Parser(lexicon=Lexicon.default().remove("student", kind="occupation"))
>>> as_31.parse("Student Mary Jones").given
'Student'
Loading