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
9 changes: 7 additions & 2 deletions docs/design/decisions/salutation-titles.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +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.
- 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. A degree's possessive (`master's`, `bachelor's`, `doctor's`, each also with the typographic apostrophe) is a `modifier`: after a comma it is the title alone or before its head, and opening a name it is the title only before a head (`Master's degree Nadir Qassoumi`), never alone (`Master's Nadir` keeps given 'Master's' given-first, family 'Master's' under a family-first order, as before) — 2026-11-19 #1487.

## Log

Expand Down Expand Up @@ -68,4 +68,9 @@ Elsewhere: `justice` and `marshal`, excluded here as common leading-position nam
- **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.
- **`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 (listed since the 2026-11-19 #1487 entry below, as `modifier`).
- **2026-11-19 #1487 — A DEGREE'S POSSESSIVE IS A MODIFIER.** The #1457 entry left `Master's degree` apart: the possessive is one word with readings of its own. `master's`, `bachelor's` and `doctor's` are listed as `modifier` titles, not `occupation` as that entry's caller's-lexicon measure listed them: after a comma a modifier is read as any title is, alone (`Nadir Qassoumi, Bachelor's`) or before its head (`Master's degree`, `Master's student`, `Master's Candidate`), and in front of a name a modifier with no head after it claims nothing, so `Master's Nadir` keeps given 'Master's' as before; after a family comma a possessive opening the given part is the title, as any modifier is (`Qassoumi, Master's Nadir` → title "Master's"), the cost the #1457 entry takes for `Qassoumi, Medical Nadir`.
- **The apostrophe.** `Lexicon` folds no apostrophe into another (`_normalize` keeps `’`), so each word is listed again written with the typographic apostrophe, as fr.toml lists `d’` beside `d'`; `Master’s degree` reads as `Master's degree` does. No registry name writes the typographic one; 4 write `´` (`MASTER´S`), left unlisted as a misspelling.
- **Collisions.** No name reading: US Census folds the apostrophe (`Masters` 23,533, `Bachelors` and `Doctors` under 100), and `masters` keeps its own reading (`Masters, John` family 'Masters'). `Doctor`, a listed title, is a different word and reads as before; a surname with an apostrophe (`O'Master`) and a possessive ending a name (`Nadir Master's`, family) do not move.
- **MEASURED** against master `13cf07cd` (2026-11-19, py3.11), `tools/differential/measure.py --base`: 30 steps, two moving, `ctgov-contacts` 183 entries and `ctgov-officials` 98, 274 distinct names (`master's` 167, `bachelor's` 73, `doctor's` 34; the #1457 entry's 166 for `master's` counts parts after a comma, and the 167th name writes it with no comma before it, `Master's Degree Candidate`); `fec-individuals` and every other local corpus, the committed snapshot and the CLDR and GND records move none. Each moved name was read: 258 now read the name before the comma apart with the possessive in the title (`master's` 160, `bachelor's` 64, `doctor's` 34): 251 the base read reversed, and 7 it read apart already, the possessive moving out of the suffix into the title with the name fields kept (`Nadir Qassoumi, MD, Master's degree`), one of them leaving the field it was written with in the suffix (`…, MD, Master's in epi` → title "Master's", suffix 'MD, in epi'). 16 read wrong as they did before, the name before the comma still the family: a field written after `in` or `of` (10, `Master's Degree in Medicine` → given 'in'), a field written bare (1, `Master's Nursing`), a word cut short or misspelled (4, `Bachelor's deg`, `Master's Stu`, `bachelor's physical thrapy`), and one part holding no name. None reads worse in its name fields. Two shapes that are no person's name, probed rather than found in the corpora, move too: a label with no comma (`Master's degree` → title "Master's", family 'degree', reporting `title-or-name`) and a possessive before `of` (`Master's of Science Nadir` → title "Master's of Science").
- Recompute: `uv run python tools/differential/measure.py --base <a checkout of 13cf07cd>`; the moved names are the entries listed in its ctgov steps, each classed by reading it.
11 changes: 8 additions & 3 deletions docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2255,21 +2255,26 @@ 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:
forms in English, and a degree's possessive joins it too (``Master's
degree``); a misspelling (``Proffesor``) still reads the old way:

.. doctest::

>>> qassoumi = parse("Nadir Qassoumi, Medical Doctor")
>>> qassoumi.title, qassoumi.given, qassoumi.family
('Medical Doctor', 'Nadir', 'Qassoumi')
>>> parse("Nadir Qassoumi, Master's degree").title
"Master's degree"
>>> 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:
name). A word that only qualifies a job, the possessive among them,
does not claim a name it opens alone (``Master's Nadir`` keeps given
``Master's``). To read such a word as a name, remove its reading, a
job's as ``kind="occupation"`` and a qualifier's as ``kind="modifier"``:

.. doctest::

Expand Down
2 changes: 1 addition & 1 deletion docs/release_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Release Log
- **Fix ud inside a South Asian compound name, which read as a credential and took the rest of the name.** ``parse("NADIR ZIA UD DIN")`` gives middle ``ZIA UD``, family ``DIN``, as 1.4.0 through 2.3.0 did, where 2.4.0 through 3.1.0 gave family ``ZIA``, suffix ``UD DIN``; ``UD`` alone after a name and a comma now reads as initials (``Anke Vissering, UD`` gives given ``UD``, family ``Anke Vissering``, where 1.4.0 through 3.1.0 gave suffix ``UD``). ``bt`` stays a credential: for Malay names remove it, as :doc:`customize` shows. :issue:`1467`
- **Fix the surname1 and surname2 views, which left a family of two surnames whole before a family comma, opening with a particle, or behind a given name a particle completes.** Under ``two_family_names``, as ``locales.ES``, ``ES_AR``, ``CS``, ``SK``, ``PT_BR`` and ``PT_PT`` turn it on, ``parser_for(locales.ES).parse("García Márquez, Gabriel")`` gives surname1 ``García``, surname2 ``Márquez``, as ``Gabriel García Márquez`` does, where 3.0.0 through 3.1.0 gave surname1 ``García Márquez``, surname2 ``''``. No field moves; a family joined by ``y`` or written as one hyphenated word stays whole, and so, where 3.0.0 through 3.1.0 divided them, do a lone particle and the word after it under a family-first order (``Van Gogh``) and a Turkic father's name with its marker; with ``capitals_as_family`` on too, the family the capitals name is divided. :issue:`1456`, :issue:`1479`
- **Change Parser.suggest() to read common surnames beyond the Chinese, Korean and Vietnamese ones, most of them Spanish.** ``Parser().suggest(["García Zorvan", "Quispe Qelliot"]).patch`` gives ``PolicyPatch(name_order=FAMILY_FIRST)``, where 3.1.0 found no evidence in either name and suggested nothing; a list of two to five Spanish names written family first now moves a given-first parser more often. :issue:`1364`
- **Fix a job or degree written out after a name and a comma, which took the name over.** ``parse("Nadir Qassoumi, Bachelor")`` gives title ``Bachelor``, given ``Nadir``, family ``Qassoumi``, where 1.4.0 through 3.1.0 gave given ``Bachelor``, family ``Nadir Qassoumi``; ``Medical Doctor`` and ``Clinical Research Coordinator`` read as one title. A name the word opens reads it as the title too (``Student Mary Jones`` gives title ``Student``), and the possessive ``Master's degree`` still takes the name over. :issue:`1457`
- **Fix a job or degree written out after a name and a comma, which took the name over.** ``parse("Nadir Qassoumi, Bachelor")`` gives title ``Bachelor``, given ``Nadir``, family ``Qassoumi``, where 1.4.0 through 3.1.0 gave given ``Bachelor``, family ``Nadir Qassoumi``; ``Medical Doctor`` and ``Clinical Research Coordinator`` read as one title. A name the word opens reads it as the title too (``Student Mary Jones`` gives title ``Student``). A degree's possessive after the comma is the title as well (``Master's degree``, ``Bachelor's``), though one opening a name alone stays the given name. :issue:`1457`, :issue:`1487`
- **Fix Malaysian a/l, a/p and anak, which read as middle names and cut the father's name.** ``parse("KUMAR A/L RAJAN NAIDU")`` gives family ``A/L RAJAN NAIDU`` and the same ``patronymic``, as ``bin`` reads, where 1.4.0 through 3.1.0 gave middle ``A/L RAJAN``, family ``NAIDU``; ``anak`` opening a name written without a comma (Balinese ``Anak Agung``) is left to position, the given name by default, and reported. :issue:`1468`
- **Fix Dutch Oude, which read as a middle name.** ``parse("Piet Oude Luttikhuis")`` gives family ``Oude Luttikhuis``, where 1.4.0 through 3.1.0 gave middle ``Oude``, family ``Luttikhuis``; ``Oude`` opening a name stays the given name, reported, being a rare Dutch given name too. :issue:`1455`
- **Add locales.NL, which reads ten as a family-name particle.** ``parser_for(locales.NL).parse("Jan ten Brink")`` gives family ``ten Brink``, where the default, as 1.4.0 through 3.1.0, gives middle ``ten``; a ``Ten`` opening a name stays the given name, reported, save under ``strict=True``. It also takes a Chinese given-name syllable inside a name into the family (``Kheng Ten Choo`` gives family ``Ten Choo``), and choosing Dutch reads ``VD`` as ``van der`` rather than the credential (``John Smith, VD`` gives family ``John Smith VD``). See :ref:`dutch-particles`. :issue:`1455`
Expand Down
12 changes: 12 additions & 0 deletions nameparser/config/_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@
'ayatollah',
'baba',
'bachelor',
"bachelor's",
'bachelors',
'bachelor’s',
'bailiff',
'ballet',
'bandleader',
Expand Down Expand Up @@ -527,9 +529,11 @@
'docent',
'docket',
'doctor',
"doctor's",
'doctora',
'doctoral',
'doctorate',
'doctor’s',
'domnișoara',
'domnul',
'dott.ssa',
Expand Down Expand Up @@ -748,7 +752,9 @@
'marketing',
'marquess',
'master',
"master's",
'masters',
'master’s',
'mathematician',
'mathematics',
'matriarch',
Expand Down Expand Up @@ -1595,6 +1601,8 @@
'asst',
'attending',
'award-winning',
"bachelor's",
'bachelor’s',
'ballet',
'banner',
'baseball',
Expand All @@ -1621,7 +1629,9 @@
'district',
'division',
'docket',
"doctor's",
'doctoral',
'doctor’s',
'edmi',
'emerita',
'emeritus',
Expand Down Expand Up @@ -1658,6 +1668,8 @@
'literary',
'marcher',
'marketing',
"master's",
'master’s',
'mathematics',
'medical',
'military',
Expand Down
Loading