Skip to content

Commit 7a688fa

Browse files
derek73claude
andauthored
Take ud out of the credentials; document removing bt for Malay names (#1467) (#1490)
`ud` is the connective of a South Asian compound name (`Zia ud Din`), between name words in 121 distinct names of eight local corpora against 7 ending one, and as a credential it started a run that took the rest of the name (`NADIR ZIA UD DIN` read suffix 'UD DIN', 2.4.0 through 3.1.0). Its reading is removed with an `excluded` entry holding the counts, and 1.4.0's reading returns; none of the 7 names ending in it writes a credential. `bt` keeps its credential reading, as decided, and docs/customize.rst gives the recipe for removing it and its cost on a baronet. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 13cf07c commit 7a688fa

9 files changed

Lines changed: 86 additions & 8 deletions

File tree

‎docs/customize.rst‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,31 @@ falls through to nickname parsing (``"John Smith (Ba)"``,
840840
``"Jeffrey (JD) Bricken"``), reported as a ``suffix-or-nickname``
841841
ambiguity.
842842

843+
Malay names and bt
844+
^^^^^^^^^^^^^^^^^^
845+
846+
``bt`` is listed as a credential, Baronet (``Sir John Smith Bt``),
847+
and Malay names write it for *binti*, between a woman's name and her
848+
father's. Written any way but in Title case, the credential reading
849+
takes the father's name into the suffix. A caller reading Malay names
850+
removes the reading:
851+
852+
.. doctest::
853+
854+
>>> parse("Nur Aina bt Rosli").suffix
855+
'bt Rosli'
856+
>>> malay = Parser(lexicon=Lexicon.default().remove("bt", kind="credential"))
857+
>>> aina = malay.parse("Nur Aina bt Rosli")
858+
>>> aina.suffix, aina.family
859+
('', 'Rosli')
860+
861+
Removing it costs a baronet his post-nominal: ``Sir John Smith Bt``
862+
then reads family ``Bt``, and ``Sir John Smith, Bt`` reads given
863+
``Bt``, the name before the comma the family. The default keeps the
864+
reading because ``bt`` is rare on the lists measured, a Malaysian one
865+
included (:issue:`1467`), and ``Bt`` written in Title case reads as a
866+
name word already (``Nur Aina Bt Rosli``).
867+
843868
Generation words that are also surnames
844869
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
845870

‎docs/design/decisions/suffix-acronym-collisions.md‎

Lines changed: 2 additions & 0 deletions
Large diffs are not rendered by default.

‎docs/migrate.rst‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,3 +2276,20 @@ name). To read such a word as a name, remove its reading:
22762276
>>> as_31 = Parser(lexicon=Lexicon.default().remove("student", kind="occupation"))
22772277
>>> as_31.parse("Student Mary Jones").given
22782278
'Student'
2279+
2280+
ud inside a compound name
2281+
^^^^^^^^^^^^^^^^^^^^^^^^^
2282+
2283+
``ud`` is no longer a credential, so a South Asian compound name
2284+
holding it reads as 1.4 and 2.0 through 2.3 read it, where 2.4 through
2285+
3.1 read ``ud`` and every word after it as the suffix. Alone after a
2286+
name and a comma it now reads as initials run together, as any
2287+
unlisted pair of capitals does there:
2288+
2289+
.. doctest::
2290+
2291+
>>> zia = parse("NADIR ZIA UD DIN")
2292+
>>> zia.middle, zia.family, zia.suffix
2293+
('ZIA UD', 'DIN', '')
2294+
>>> parse("Anke Vissering, UD").given
2295+
'UD'

‎docs/release_log.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Log
55
nameparser 3.2 is under development.
66

77
- **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`
8+
- **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`
89
- **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`
910
- **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`
1011
- **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`

‎nameparser/config/_compiled.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3700,7 +3700,6 @@
37003700
'td',
37013701
'thd',
37023702
'thm',
3703-
'ud',
37043703
'usa',
37053704
'usaf',
37063705
'usar',

‎nameparser/config/_index.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2742,7 +2742,6 @@
27422742
('ty', (('en', 'familiar', (('short_for', ('tyler',)),)),)),
27432743
('u', (('my', 'salutation', (('default', False),)),)),
27442744
('ua', (('ga', 'clan', (('cased', 'Ua'), ('same_as', 'ó'))), ('ga', 'given', ()))),
2745-
('ud', (('en', 'credential', ()),)),
27462745
('uk', (('en', 'modifier', (('dotted', True),)),)),
27472746
('ul-', (('ar', 'article', (('same_as', 'al-'),)), ('ur', 'article', (('same_as', 'al-'),)))),
27482747
('ula', (('pl', 'familiar', (('short_for', ('urszula',)),)),)),

‎nameparser/vocab/en.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5866,7 +5866,7 @@ credential = { cased = "ThM" }
58665866

58675867
[[word]]
58685868
text = "ud"
5869-
credential = {}
5869+
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 } }
58705870

58715871
[[word]]
58725872
text = "usa"

‎tests/v2/cases.py‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21532,4 +21532,36 @@ def _check_cjk_shape_purity(self) -> None:
2153221532
"family": "Nadir Qassoumi"},
2153321533
notes="boundary: the possessive is left unlisted (#1457), so "
2153421534
"the part still takes the name over"),
21535+
# #1467: `ud` loses its credential reading; `bt` keeps its own.
21536+
Case("ud_inside_a_compound_name_in_capitals_is_a_name_word",
21537+
"NADIR ZIA UD DIN",
21538+
{"given": "NADIR", "middle": "ZIA UD", "family": "DIN"},
21539+
notes="#1467 restores 1.4.0's reading: 2.4.0 through 3.1.0 "
21540+
"read family 'ZIA', suffix 'UD DIN', reported "
21541+
"suffix-or-name, the credential reading starting a run "
21542+
"that took the rest of the name"),
21543+
Case("ud_in_lower_case_inside_a_compound_name_is_a_name_word",
21544+
"Nadir Zia ud Din",
21545+
{"given": "Nadir", "middle": "Zia ud", "family": "Din"},
21546+
notes="#1467 restores 1.4.0's reading: 2.4.0 through 3.1.0 "
21547+
"read family 'Zia', suffix 'ud Din', reported "
21548+
"suffix-or-name; the compound is not joined (decided on "
21549+
"#1467)"),
21550+
Case("ud_after_a_full_name_and_a_comma_reads_as_initials",
21551+
"Anke Vissering, UD",
21552+
{"given": "UD", "family": "Anke Vissering"},
21553+
classification="fix(#1467)",
21554+
notes="the accepted cost: an unlisted pair of capitals after the "
21555+
"name and a comma reads as initials run together, as 'XQ' "
21556+
"does; read suffix 'UD' 1.4.0 through 3.1.0"),
21557+
Case("bt_in_lower_case_before_the_last_word_stays_the_credential",
21558+
"Nur Aina bt Rosli",
21559+
{"given": "Nur", "family": "Aina", "suffix": "bt Rosli"},
21560+
ambiguities=("suffix-or-name",),
21561+
classification="fix(#602)",
21562+
notes="boundary: #1467 decided `bt` keeps its credential "
21563+
"reading, whose run here came with #602's in 2.4.0 "
21564+
"(1.4.0 through 2.3.0 read middle 'Aina bt', family "
21565+
"'Rosli'); a caller with Malay names removes it "
21566+
"(docs/customize.rst)"),
2153521567
)

‎tests/v2/test_cases.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,10 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None:
502502
# its declared policy; 2192 -> 2195 the same day, #1471's 'Emerita
503503
# Smith' reporting title-or-name under three orders; 2195 -> 2198 the
504504
# same day, #1457's 'Mr Masters' reporting title-or-name under three
505-
# orders.
506-
assert claims == 2198, (
507-
f"the field sweep checks {claims} claims, recorded as 2198 on "
505+
# orders; 2198 -> 2201 the same day, #1467's 'Nur Aina bt Rosli'
506+
# reporting suffix-or-name under three orders.
507+
assert claims == 2201, (
508+
f"the field sweep checks {claims} claims, recorded as 2201 on "
508509
f"2026-11-19")
509510

510511

@@ -985,8 +986,10 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None:
985986
# #1468's 'Kwame Mensah Anak' under FAMILY_FIRST, a `name` stand-in;
986987
# the 'Anak Agung Made Putra' reports name a patronymic alternative,
987988
# which has no stand-in; 604 -> 605 the same day, its review's
988-
# FAMILY_FIRST row of that name
989-
assert (checked, skipped) == (605, 494), (checked, skipped)
989+
# FAMILY_FIRST row of that name; 494 -> 497 the same day, #1467's
990+
# 'Nur Aina bt Rosli' under the three orders, its suffix-or-name
991+
# reports all skipped
992+
assert (checked, skipped) == (605, 497), (checked, skipped)
990993

991994

992995
def test_every_case_name_is_unique() -> None:

0 commit comments

Comments
 (0)