diff --git a/docs/customize.rst b/docs/customize.rst index 842b062a9..fef2a131c 100644 --- a/docs/customize.rst +++ b/docs/customize.rst @@ -840,6 +840,31 @@ falls through to nickname parsing (``"John Smith (Ba)"``, ``"Jeffrey (JD) Bricken"``), reported as a ``suffix-or-nickname`` ambiguity. +Malay names and bt +^^^^^^^^^^^^^^^^^^ + +``bt`` is listed as a credential, Baronet (``Sir John Smith Bt``), +and Malay names write it for *binti*, between a woman's name and her +father's. Written any way but in Title case, the credential reading +takes the father's name into the suffix. A caller reading Malay names +removes the reading: + +.. doctest:: + + >>> parse("Nur Aina bt Rosli").suffix + 'bt Rosli' + >>> malay = Parser(lexicon=Lexicon.default().remove("bt", kind="credential")) + >>> aina = malay.parse("Nur Aina bt Rosli") + >>> aina.suffix, aina.family + ('', 'Rosli') + +Removing it costs a baronet his post-nominal: ``Sir John Smith Bt`` +then reads family ``Bt``, and ``Sir John Smith, Bt`` reads given +``Bt``, the name before the comma the family. The default keeps the +reading because ``bt`` is rare on the lists measured, a Malaysian one +included (:issue:`1467`), and ``Bt`` written in Title case reads as a +name word already (``Nur Aina Bt Rosli``). + Generation words that are also surnames ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/design/decisions/suffix-acronym-collisions.md b/docs/design/decisions/suffix-acronym-collisions.md index 847fc1b60..c4aaa18a1 100644 --- a/docs/design/decisions/suffix-acronym-collisions.md +++ b/docs/design/decisions/suffix-acronym-collisions.md @@ -6,6 +6,7 @@ Closes #342 (a wordlist question) and #454 (a rules.md question) together, becau - A suffix acronym that is also a name borne in the trailing position gets one of three answers, by how common each reading is there: the name reading dominating removes the word from the vocabulary (a caller who needs it adds it back), rough balance marks it ambiguous, and the credential dominating leaves it unambiguous; length is a correlate, not the test — 2026-09-07 #342. - `rai`, `cha` and `mai` are out of the suffix acronyms, their trailing name readings being far more common than the credentials, and the cost is accepted: `John Smith RAI` and `John Smith MAI` read the letters as the family name — 2026-09-07 #342; 2026-10-16 #687. +- `ud` is out of the suffix acronyms, the connective of a South Asian compound name (`Zia ud Din`) written between name words about 17 times for each time it ends one, and `bt` stays, a caller with Malay names removing it in a lexicon of their own — 2026-11-19 #1467. - `gc` is out of the suffix acronyms, the Nepali surname G.C. (Gharti Chhetri) being far more common at the end of a name than the credential GC, and the cost is accepted: `John Smith GC` reads the letters as the family name, and `John Smith G.C.` the paired initials rules/S3 leaves to the name — 2026-10-24 #864. - `ba`, `meng`, `lac`, `si` and `chi` are marked ambiguous rather than removed, so each is read as the ambiguous class is, by the case it is written in, the words to spare and the comma (rules/S6, S4 and C4): `JOHN SMITH SI` keeps the credential and reports the fork (`John Smith SI` keeps it unreported, its capitals settling it in a mixed-case name; 2026-10-25 #785, decisions/S6), while `John Smith Si`, `Anna Ba` and `Wang, Meng` read the surname or the given name, reported — 2026-09-07 #342; 2026-09-25 #540; 2026-10-21 #791. - `meng` and `lac` carry no case mask, since a mask applies in every role and would re-spell the surnames the marking keeps (`wang meng` would render `Wang MEng`) — 2026-09-25 #540. @@ -90,3 +91,4 @@ Open: #1053, carried over from #965 (telling the credential `FREng`, written in - **2026-11-03 (Derek) — `mba` IS MARKED AMBIGUOUS, A FAMILY READING BESIDE THE CREDENTIAL; THE 2026-10-21 HOLD-OUT IS SUPERSEDED.** Decided in chat on 2026-11-03, shown the hold-out, with the mul.toml audit (decisions/vocabulary-model's 2026-11-03 #1005, the mul.toml audit entry), which found the default reading `Chinedu Mba` suffix 'Mba' with no family, as 2.0.0 through 2.8.1 do, where 1.4.0 read family 'Mba'. The 2026-10-21 entry held `mba` out because the credential dominates: 5,895 US healthcare providers write it (NPPES, August 2026) against 320 Census 2010 surname bearers, the revised rule marking only where the surname reading is the larger. What that count does not see is where the name is borne: Mba is an Igbo surname (ORCID's Nigeria family boxes, `Chinedu Mba`; 10 PSC surname boxes) and a Fang name part (`Léon Mba`; `Patrick Arthur MBA ABESSO`), and the degree is written after a comma or among other credentials, where a marked word keeps it. Measured (the default before and after, over the 29,097 names of every local corpus holding `ing` or `mba`): 58 names read differently and 179 more only in their ambiguity reports; about 49 of the 58 read the name better (`Léon Mba` → family 'Mba', `GREGOIRE, MBA GERARD` → given 'MBA'), about 9 read a degree into the name, each a degree in the family part before a comma or inside a credential run (`GULLEY MBA, KELLEY D.` → family 'GULLEY MBA', `JOHNSTON PHD MBA, LLOYD` → family 'JOHNSTON MBA', `SACHDEV MD MBA MS, AMIT`), the cost the ambiguous class pays for `ma` and `meng` (`Smith MA, John` → family 'Smith MA'). The same cost after a comma, found by the PR's review: `RUH MD,MBA, RICHARD` and `DELLACONA, MBA, TRACEY L. R.N., ESQ.` read given 'MBA' (suffix 'MD, MBA, RICHARD' before), as do the empty head `, MBA` and `Smith, MBA Jane`; `Dr.A.RAVISANKAR MBA` reads family 'MBA' (suffix before) and `Pərviz Həsənov MBA - müəllim` family 'müəllim' (suffix 'MBA - müəllim' before); a period-marked `Smith, Mba.` reads title 'Mba.', as `Smith, Meng.` and `Smith, Lat.` do. The committed corpora move `john smith mba` in its ambiguities only; `John Smith (PhD MBA)`, which moved the same way, left the corpus with the rules/S1 example it came from. Two rule examples that used it as the unambiguous credential take another: rules/S1's run with no ambiguous member is `(PhD MSc)` (`(PhD MBA)` reports suffix-or-nickname now, as `(MA PhD)` does), and rules/M1's suffix-shaped clause under a maiden pair is `(PhD)`, since `Andrew Perkins (MBA)` with brackets configured as maiden reads maiden 'MBA', as `(MEng)` does, S1's escape declining an ambiguous member; the capitals keep `Andrew Perkins (MBA)` suffix 'MBA' by default. Unmoved: `John Smith, MBA`, `John Smith MBA` (the case signal, rules/S6), `John Smith, M.B.A.`. The reading is in mul.toml beside the credential, so the gate is alike under every choice. The class of the hold-out is worth naming: a provider count measures how often a credential is written, not where the name it collides with is borne, so a surname concentrated in one population can be common there and small in the Census. - **2026-11-09 (#998) — credentials written in two chunks joined at a full stop, a batch.** rules/S3 read an unlisted `B.Pharm` or `M.Kes` by its shape: a suffix with a suffix-or-name report where a word was to spare, a name word where none was (`Ali C.Psych` → family 'C.Psych'), and a title where a chunk is a listed title (`Ayu Pangestu, S.Pd, M.Pd` → title 'S.Pd M.Pd', `pd` being one). The same spellings without stops reversed a comma name (`Anna Gelavis, BPharm` → given 'BPharm'). **Candidates**: the spellings #998's recipe found ending a name in the six local corpora it counted, with second chunks of any length, sorted by hand. Each was put through `tools/vocab/query.py --word` (none had a reading or an exclusion) and `tools/name_usage.py` (counts taken 2026-11-09, recorded in each word's `note`). **Added** (43): 26 in en.toml (`bpharm`, `cpsych`, `mpharm`, `msci`, `mtech`, `dsci`, `mmath`, `moptom`, …), 16 in id.toml (`mkes`, `mkep`, `mkom`, `skom`, `mpd`, `spd`, `mhum`, `mkn`, `msi`, …) and `menf` in pt.toml. All but `msi` have no Census 2010, SSA or Wikidata bearer above each source's floor, and each carries its `cased` mask but `msci` (written MSCI 152 times against MSci 28 by ClinicalTrials.gov officials, so a mask would re-spell the common form) and `msi`. **Marked ambiguous**: `msi`, with a family reading and no mask, Msi being a Xhosa surname. Listed plain, it took the surname from `Andiswa Zanele Msi` in ORCID and `Mr Afikile Manduleli Msi` in PSC (suffix 'Msi'); marked, both keep it, reported. A name in one case with a word to spare still loses it (`ANDISWA ZANELE MSI` → suffix 'MSI'), the cost `mot` pays (#993), accepted because no local corpus writes the shape. Refusing it was tried and measured worse: a comma name reversed (`Jane Doe, MSi` → given 'MSi') and `Saprudin S.Sos., M.Si.` read given 'M.Si.'. **Refused**, each with an `excluded` entry giving its counts: `peng`, `ceng`, `barch`, `bchir`, `mendo`, `bed`, `ssi` (the romanized Korean honorific 씨, `Park Ji-hoon ssi`, which the committed snapshot holds), `sked`, `shut`, `merg`, `mak` and `mor`. `bed` is the Nepali given name Bed (59 nepal-candidates names), refused for the given part after a family comma: listed, `Thapa, Bed` reads suffix 'Bed'. No local corpus writes that shape. The gain refused is 6 readings of the 10 records writing the credential, 3 of them in a field (`Karina A Thiessen, BA BEd`, `John Zengulaaru (M.Phil., B.Ed)`), the other 4 already reading the suffix by rules/S3 or the comma. The same position, and the trailing given name under a family-first order, reaches `ded` and `edd`, whose Standing line this entry amends. `btech` is left unlisted, being the example of an unlisted dotted credential in eleven files; `mpdk` (`M.Pd.K.`, three chunks) was not a candidate and still reads as a title by its `pd` chunk. **Measured** (`tools/differential/measure.py --base` against master b89c5482, then ctgov-officials, orcid-researchers, psc-individuals, cz-candidates and jrc-names again on the final tree): ctgov-officials moves 407 of 536,981 readings, 122 of them in a field, each sampled one a credential leaving the given name, middle name, title or family name for the suffix (`Anna Gelavis, BPharm`, `Janice Pellow, M.Tech Hom` → suffix 'M.Tech Hom', `Veronique Michaud, BPharm. PhD`), the rest reports and case views; orcid-researchers moves 81, 50 in a field, mostly Indonesian degrees that had read as titles (`Dr. Rajab Agustini, S.Pd., M.Pd.` → title 'Dr.', suffix 'S.Pd., M.Pd.'); cz-candidates 2, jrc-names 1 (`Bernd Lange SPD` → family 'Lange', suffix 'SPD'), psc-individuals 1, its report only (`Mr Afikile Manduleli Msi`); the other local corpora, the committed snapshot and the CLDR, GND and Wikidata records do not move (opensanctions-parliaments not measured, its cache predating the datasets the tool reads). Scored: orcid-researchers 9 records agree that did not and 1 no longer does (`Saprudin S.Sos., M.Si.`, one name word, read family where the filer's given box holds it), cz-candidates 1 more agrees, psc-individuals and patentsview-inventors do not move. **Accepted**: `Ahmed Ali M.Hassan` keeps reading suffix 'M.Hassan', reported, the cost #998's proposal accepts; the division's count against it is in decisions/period-joined-words' 2026-11-09 #998 bullet. Pinned by the `two_chunk_credential_is_listed`, `two_chunk_credential_with_no_word_to_spare`, `family_comma_given_part_ends_in_two_chunk_credential`, `indonesian_credentials_after_a_comma`, `glued_initial_and_surname_still_read_by_position`, `two_chunk_credential_written_without_stops_after_a_comma`, `two_chunk_credential_in_capitals_without_stops`, `indonesian_credentials_with_no_comma`, `two_chunk_credential_after_a_one_word_head`, `ambiguous_msi_keeps_the_surname`, `ambiguous_msi_after_a_comma_is_the_credential`, `ambiguous_msi_in_capitals_takes_the_surname`, `refused_peng_keeps_the_surname`, `refused_bed_keeps_the_given_name` and `refused_ssi_keeps_the_word` case rows, and the masks by `tests/v2/test_render.py`'s `test_a_credential_written_in_two_chunks_takes_its_mask`. **Recompute**: `uv run python tools/vocab/query.py --issue 998` lists the entries; the moves by the command above against a master checkout. - **2026-11-10 (#1315) — the Royal Colleges' fellowships and memberships, a batch.** `John Smith FRCS` gave middle 'Smith', family 'FRCS', as did `Tanaka Hiroshi FRCS` under a family-first base (so #1310's group suggester voted given-first on it), and `Smith, John MRCP` gave middle 'MRCP': C6's caps shape needs a comma or a word the listing holds, and only `FACS` and `FACP` of the family were listed. 34 words listed (`en.toml`, `uv run python tools/vocab/query.py --issue 1315`): the Colleges of Surgeons, Physicians, Radiologists, Obstetricians and Gynaecologists, Ophthalmologists, Pathologists, Psychiatrists, Emergency Medicine, General Practitioners, Anaesthetists and Paediatrics, the Veterinary Surgeons (`mrcvs`), and the Canadian and Australasian royal colleges (`frcsc`, `frcpc`, `fracs`, `fracp`). **Vetted** by `tools/name_usage.py` and the local corpora: none has a Census 2010, SSA, nam_dict or Wikidata bearer, and none sits where a surname would in any local corpus (ctgov-officials, orcid-researchers, govuk-people, psc-individuals and fec-individuals hold them, all as credential runs; tse-donors, where #993 found `cota`, holds none), so none is marked ambiguous. The #993 screens were run over all 34 in lower, Title and upper case: `Jane Doe X`, `Jane Doe, X`, `JANE DOE, X`, `jane doe, x`, `Doe, Jane X`, `Jane Doe X, PhD`, and the capitals shapes with a word to spare and no comma (`JANE ANN DOE X`), and every one read the word as the suffix with no report. Each note records NPPES's count and ClinicalTrials.gov's after a comma (data 2026-10-21); `frcpglas`, `frcvs` and `frcsglasg` were left out as unwritten in every corpus, and `fasn`, `facg` and `fcps` (699 officials, Pakistan's College of Physicians and Surgeons) as not Royal College words, each worth a batch of its own. Six mixed-case ones carry a `cased` mask (`FRCPath`, `FRCOphth`, `FRCPsych`, `MRCPsych`, `FRCSEd`, `MRCSEd`). **Measured** over the committed corpora, the snapshot moved two names and none of the seven role fields: `Alex Green, FRCS (SN)` and `Andrew Wilson, MRCP (UK)` lost their `suffix-or-name` report, a listed word needing no fork. **Measured over the local corpora against master** (`tools/differential/measure.py`, 2026-11-10): ClinicalTrials.gov's officials moved 5,508 entries, 241 of them a role field; 225 of those put a listed word in the suffix where the base had it in the given, family, middle or title (`Troy Puar, MRCP UK` was given `MRCP`), and 16 went from right to wrong: 13 runs opening with `BM`, 2 with `MA BM` and 1 with `AO` after a comma (`Keith Godfrey, BM PhD FRCP`, given `BM` now). The cause was there before: `Keith Godfrey, BM PhD` and `..., BM PhD FACS` read given `BM` on master, and the unlisted `FRCP` ending the run kept it a suffix by accident, which listing it removes. Accepted as a cost of listing, and filed apart as the bug it is (#1323). **Declined: listing `bm` (Bachelor of Medicine) to remove it** (2026-11-10): it has no Census, SSA or Wikidata bearer, but an acronym is matched with every full stop removed, so it lists `B.M.` too, which Nepal's candidates write as surname initials (rules/S3's paired-initials Except, #864). Measured against master it fixed 15 ClinicalTrials.gov runs, 2 FEC names and `Whinnett, BM.BS`, and moved 6 Nepal candidates (`Chacra Bahadur B.M.`, family `B.M.` to a suffix) and 5 ORCID names where `BM` is a family-name initial (`Avinash BM`) to a suffix with the family name gone, the worse direction; the fix belongs in how a part opening with an unlisted two-capital word is read, not in the vocabulary. `ao` was left out for its own reason: a Census 2010 family reading (524) and an SSA given one (18), so it needs the ambiguous marking, and it moved 1 name. FEC, GOV.UK, ORCID and Companies House moved 1, 8, 16 and 3 entries, by the same readings, and tse-donors (where `cota` was found) and the other corpora moved none (opensanctions-parliaments could not be measured, its cached copy being stale); the committed snapshot, CLDR and GND records moved only the two reports above. A test that used `FRCS` as its example of an unlisted capitals credential (`tests/v2/pipeline/test_comma.py`) now uses `XYZW`, a word no listing will take. **Recompute**: `git diff origin/master...HEAD -- tools/differential/snapshot.jsonl` on the branch for the two moves (`snapshot.py --since v3.0.1` lists every move of the cycle, 325 entries on 2026-11-10, not this change's); the old readings are 1.4.0's too (`HumanName("John Smith FRCS")` gives last 'FRCS'). +- **2026-11-19 (#1467) — `ud` LEAVES THE CREDENTIALS; `bt` STAYS.** Decided on the issue (its 2026-11-19 decision comment). `ud` came with the bulk list and is the Urdu and Arabic connective of a compound name (`Zia ud Din`). Counted over the distinct names of eight local corpora (ctgov-officials, ctgov-contacts, govuk-people, ukec-individuals, psc-individuals, fec-individuals, orcid-researchers, my-candidates), the words split at spaces with commas and full stops removed, as the vocabulary matches an acronym, 2026-11-19: `ud` stands between name words in 121 and ends a name in 7 (4 after a comma, 3 with none), and `bt` stands between name words in 35 and ends a name in 16 (7 after a comma, 9 with none), by position alone, so the 35 hold baronets with more post-nominals behind (`Bt, FRICS`) and the 16 surname-first initials (`B.T.`) among them (the decision comment's 127 and 34 counted records rather than distinct names, and its 7 and 11 another split). In lower case, in capitals within a mixed-case name, or in a name of one case, the credential reading started a run that took the rest of the name (`NADIR ZIA UD DIN` → family 'ZIA', suffix 'UD DIN', 2.4.0 through 3.1.0; 1.4.0 through 2.3.0 read middle 'ZIA UD', family 'DIN', which the change restores). The reading is removed with an `excluded` entry in en.toml carrying the counts. **The 7 names ending in it** write no credential: four are initials written `U.D`, the full stops being what the vocabulary's match removes: three ORCID holders' with no comma, now read as the family, as an unlisted pair of initials ending a name is, and an FEC donor's after a comma, read as initials before and after; one is the compound written surname first (FEC, now middle 'UD' where it read suffix 'UD'); and two are one Dutch study chair in two ClinicalTrials.gov records writing the rank universitair docent after the name and a comma, which now reads as an unlisted pair of capitals there does, initials run together: given 'UD', the name before the comma the family (written here with an invented name, `Anke Vissering, UD`), the accepted cost. Written with its full stops after a comma it reads as initials too (`Anke Vissering, U.D.` → given 'U.', middle 'D.'), and with a final full stop as a title by rules/H2's shape (`UD.`), as any unlisted word of that shape does. **`bt` is not changed**: a name reading beside the credential reads `Nur Aina bt Rosli` with family 'Rosli' and `Sir John Smith Bt` with family 'Bt', and the counts are too few to choose by; docs/customize.rst gives the recipe for a caller with Malay names (`Lexicon.default().remove("bt", kind="credential")`) and its cost on a baronet. The compound itself is not joined: `X ul/ur/ud Y` reads family 'Y'. **Measured** (`tools/differential/measure.py --base` against master 12b568f8): ctgov-officials and ctgov-contacts 1 entry each (the Dutch chair), fec-individuals 2, jrc-names 8, orcid-researchers 12, opensanctions-parliaments 1, patentsview-inventors 1; every other local corpus, the committed snapshot and the CLDR and GND records none. Scored against the filed boxes, orcid-researchers 3 records agree that did not (a Bangladeshi name holding `ud` in the given box and two Sri Lankan ones ending in `U.D`) and 6 no longer do, Pakistani holders who filed the whole compound in the family box (`ud Din` and the word before it), which the run's suffix had matched where the unjoined compound does not, with 2 more changing between two disagreements; patentsview-inventors 1 Hungarian record no longer agrees. Pinned by the `ud_inside_a_compound_name_in_capitals_is_a_name_word`, `ud_in_lower_case_inside_a_compound_name_is_a_name_word`, `ud_after_a_full_name_and_a_comma_reads_as_initials` and `bt_in_lower_case_before_the_last_word_stays_the_credential` case rows. diff --git a/docs/migrate.rst b/docs/migrate.rst index c88460950..b0a5fea7b 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -2276,3 +2276,20 @@ name). To read such a word as a name, remove its reading: >>> as_31 = Parser(lexicon=Lexicon.default().remove("student", kind="occupation")) >>> as_31.parse("Student Mary Jones").given 'Student' + +ud inside a compound name +^^^^^^^^^^^^^^^^^^^^^^^^^ + +``ud`` is no longer a credential, so a South Asian compound name +holding it reads as 1.4 and 2.0 through 2.3 read it, where 2.4 through +3.1 read ``ud`` and every word after it as the suffix. Alone after a +name and a comma it now reads as initials run together, as any +unlisted pair of capitals does there: + +.. doctest:: + + >>> zia = parse("NADIR ZIA UD DIN") + >>> zia.middle, zia.family, zia.suffix + ('ZIA UD', 'DIN', '') + >>> parse("Anke Vissering, UD").given + 'UD' diff --git a/docs/release_log.rst b/docs/release_log.rst index 3a4f97495..3fec6bcaf 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -5,6 +5,7 @@ Release Log nameparser 3.2 is under development. - **Change Parser.suggest() to read where a Russian-style patronymic stands as a vote on the order, and add Signal.PATRONYMIC_POSITION, the signal that casts it.** ``Parser().suggest(["Sidorov Ivan Petrovich", "Volkov Pavel Sergeevich", "Orlova Anna Ivanovna", "Zaitsev Oleg Nikolaevich", "Belova Vera Andreevna"]).patch`` gives ``PolicyPatch(name_order=FAMILY_FIRST, patronymic_rules=...)``, where 3.1.0 gave the rule with the given-first order, which misread any name of two words in such a list (``Sidorov Ivan`` gave family ``Ivan``); a patronymic in the middle votes given-first. :issue:`1447` + - **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` diff --git a/nameparser/config/_compiled.py b/nameparser/config/_compiled.py index 4a78d5b15..957af545e 100644 --- a/nameparser/config/_compiled.py +++ b/nameparser/config/_compiled.py @@ -3700,7 +3700,6 @@ 'td', 'thd', 'thm', - 'ud', 'usa', 'usaf', 'usar', diff --git a/nameparser/config/_index.py b/nameparser/config/_index.py index d4d7468c0..9d227bffc 100644 --- a/nameparser/config/_index.py +++ b/nameparser/config/_index.py @@ -2742,7 +2742,6 @@ ('ty', (('en', 'familiar', (('short_for', ('tyler',)),)),)), ('u', (('my', 'salutation', (('default', False),)),)), ('ua', (('ga', 'clan', (('cased', 'Ua'), ('same_as', 'ó'))), ('ga', 'given', ()))), - ('ud', (('en', 'credential', ()),)), ('uk', (('en', 'modifier', (('dotted', True),)),)), ('ul-', (('ar', 'article', (('same_as', 'al-'),)), ('ur', 'article', (('same_as', 'al-'),)))), ('ula', (('pl', 'familiar', (('short_for', ('urszula',)),)),)), diff --git a/nameparser/vocab/en.toml b/nameparser/vocab/en.toml index f2f3cc14e..23b5fa299 100644 --- a/nameparser/vocab/en.toml +++ b/nameparser/vocab/en.toml @@ -5866,7 +5866,7 @@ credential = { cased = "ThM" } [[word]] text = "ud" -credential = {} +excluded = { credential = { reason = "the Urdu and Arabic connective of a compound name (Zia ud Din, Mohi ud Din): between name words in 121 distinct names of eight local corpora (ctgov-officials, ctgov-contacts, govuk-people, ukec-individuals, psc-individuals, fec-individuals, orcid-researchers, my-candidates), the words split at spaces with commas and full stops removed, as the vocabulary matches an acronym, 2026-11-19, against 7 ending a name, where the credential reading started a run that took the rest of the name (NADIR ZIA UD DIN read suffix 'UD DIN'). The 7 write no credential: initials written U.D (four: three ORCID holders', now read as the family, as an unlisted pair of initials ending a name is, and an FEC donor's after a comma, read as initials before and after), the compound written surname first (one; DIN, NADIR UD-shape, now middle 'UD'), and a Dutch study chair in two ClinicalTrials.gov records writing the rank universitair docent after the name and a comma, which now reads as an unlisted pair of capitals there does, as initials run together, given 'UD' and the name before the comma the family (Anke Vissering, UD, an invented name of that shape), the accepted cost. Never reviewed as a credential, having come with the bulk list (decisions/suffix-acronym-collisions)", issue = 1467, decided = 2026-11-19 } } [[word]] text = "usa" diff --git a/tests/v2/cases.py b/tests/v2/cases.py index 89c122d27..2a285d873 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -21532,4 +21532,36 @@ def _check_cjk_shape_purity(self) -> None: "family": "Nadir Qassoumi"}, notes="boundary: the possessive is left unlisted (#1457), so " "the part still takes the name over"), + # #1467: `ud` loses its credential reading; `bt` keeps its own. + Case("ud_inside_a_compound_name_in_capitals_is_a_name_word", + "NADIR ZIA UD DIN", + {"given": "NADIR", "middle": "ZIA UD", "family": "DIN"}, + notes="#1467 restores 1.4.0's reading: 2.4.0 through 3.1.0 " + "read family 'ZIA', suffix 'UD DIN', reported " + "suffix-or-name, the credential reading starting a run " + "that took the rest of the name"), + Case("ud_in_lower_case_inside_a_compound_name_is_a_name_word", + "Nadir Zia ud Din", + {"given": "Nadir", "middle": "Zia ud", "family": "Din"}, + notes="#1467 restores 1.4.0's reading: 2.4.0 through 3.1.0 " + "read family 'Zia', suffix 'ud Din', reported " + "suffix-or-name; the compound is not joined (decided on " + "#1467)"), + Case("ud_after_a_full_name_and_a_comma_reads_as_initials", + "Anke Vissering, UD", + {"given": "UD", "family": "Anke Vissering"}, + classification="fix(#1467)", + notes="the accepted cost: an unlisted pair of capitals after the " + "name and a comma reads as initials run together, as 'XQ' " + "does; read suffix 'UD' 1.4.0 through 3.1.0"), + Case("bt_in_lower_case_before_the_last_word_stays_the_credential", + "Nur Aina bt Rosli", + {"given": "Nur", "family": "Aina", "suffix": "bt Rosli"}, + ambiguities=("suffix-or-name",), + classification="fix(#602)", + notes="boundary: #1467 decided `bt` keeps its credential " + "reading, whose run here came with #602's in 2.4.0 " + "(1.4.0 through 2.3.0 read middle 'Aina bt', family " + "'Rosli'); a caller with Malay names removes it " + "(docs/customize.rst)"), ) diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index 91b3b67d8..c9b285153 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -502,9 +502,10 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # its declared policy; 2192 -> 2195 the same day, #1471's 'Emerita # Smith' reporting title-or-name under three orders; 2195 -> 2198 the # same day, #1457's 'Mr Masters' reporting title-or-name under three - # orders. - assert claims == 2198, ( - f"the field sweep checks {claims} claims, recorded as 2198 on " + # orders; 2198 -> 2201 the same day, #1467's 'Nur Aina bt Rosli' + # reporting suffix-or-name under three orders. + assert claims == 2201, ( + f"the field sweep checks {claims} claims, recorded as 2201 on " f"2026-11-19") @@ -985,8 +986,10 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None: # #1468's 'Kwame Mensah Anak' under FAMILY_FIRST, a `name` stand-in; # the 'Anak Agung Made Putra' reports name a patronymic alternative, # which has no stand-in; 604 -> 605 the same day, its review's - # FAMILY_FIRST row of that name - assert (checked, skipped) == (605, 494), (checked, skipped) + # FAMILY_FIRST row of that name; 494 -> 497 the same day, #1467's + # 'Nur Aina bt Rosli' under the three orders, its suffix-or-name + # reports all skipped + assert (checked, skipped) == (605, 497), (checked, skipped) def test_every_case_name_is_unique() -> None: