From 4fc00046fc5f0b47dd7d912185a3a33927f5e326 Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Thu, 19 Nov 2026 10:08:48 -0800 Subject: [PATCH 1/3] Read Malaysian a/l, a/p and anak as patronymic particles, as bin is (#1468) Malaysian Indian names write a/l (son of) or a/p (daughter of) between the bearer's name and the father's, and Iban and Bidayuh names write anak; all three read as middle names, cutting a father's name of two words (KUMAR A/L RAJAN NAIDU read middle 'A/L RAJAN', family 'NAIDU'). Each is now a patronymic reading in ms.toml, so the family opens at it and the patronymic view holds the father's name. a/l and a/p are never given; anak keeps a given reading, so Balinese Anak Agung at the head stays the given name, reported, as binti does. my-candidates: 115 of 3,683 spellings move, every one a name holding A/L, A/P or ANAK, all now read with the father's whole name. opensanctions-parliaments: the 25 my_parliament names move the same way; three ANAK AGUNG names gain the particle-or-given report. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/R9-patronymic-view.md | 9 +++- .../family-without-an-inherited-name.md | 2 +- docs/design/rules/R9-patronymic-view.md | 6 ++- docs/migrate.rst | 23 ++++++++- docs/release_log.rst | 1 + nameparser/config/_compiled.py | 8 +++ nameparser/config/_index.py | 3 ++ nameparser/vocab/ms.toml | 29 +++++++++++ tests/v2/cases.py | 50 +++++++++++++++++++ tests/v2/test_cases.py | 15 +++--- tools/differential/conventions_agreement.json | 16 ++---- tools/differential/corpus_rules.jsonl | 4 ++ tools/differential/snapshot.jsonl | 8 ++- 13 files changed, 150 insertions(+), 24 deletions(-) diff --git a/docs/design/decisions/R9-patronymic-view.md b/docs/design/decisions/R9-patronymic-view.md index 7e7b48c18..8b3fd3189 100644 --- a/docs/design/decisions/R9-patronymic-view.md +++ b/docs/design/decisions/R9-patronymic-view.md @@ -5,10 +5,11 @@ - `ParsedName.patronymic` holds the words read as a patronymic, in whichever field the parse put them, which keep them; it is a view, not a role, so `family`, `middle`, `as_dict()`, `replace()`'s fields and the repr are unchanged, item 3 of decisions/vocabulary-model's 2026-10-28 #754 output-model entry — 2026-10-29 #754, sub-phase 4c. - A patronymic particle and the words after it in its field all read `patronymic`, the particle by vocabulary and the rest by position, so the view is the tokens whose reading is `patronymic` — 2026-10-29 #754, sub-phase 4c. - The East Slavic and Turkic rules write the reading wherever a policy turns them on, not only where their rotations fire: a middle word carrying the ending, and a marker with the name word before it — 2026-10-29 #754, sub-phase 4c. +- Malaysian `a/l` and `a/p` (anak lelaki, anak perempuan) and Sarawak's `anak` are patronymic particles in the default vocabulary (`ms.toml`), read as `bin` is; `a/l` and `a/p` are never given names, and `anak` holds a `given` reading beside its patronymic one, so a name it opens (Balinese `Anak Agung`) is left to position and reports the fork — 2026-11-19 #1468. Elsewhere: why the view leaves `family` and `middle` as they are, and the fielded-corpora measurements behind it, decisions/vocabulary-model's 2026-10-28 #754 entry, item 3; the rotations the two ending rules are named for, decisions/O1 and decisions/O2; the `clan`/`patronymic` line in the particle kinds, decisions/vocabulary-model's 2026-10-19 #749 entry; a father's name nothing in the text marks, which fills no view, and a view that overlaps the family, decisions/family-without-an-inherited-name. -Open: the Icelandic ending rule, which an `is` pack would turn on (the RFC's work order: 3b, 4c and 4f); whether the East Slavic endings should take the Ukrainian `-ivna`/`-ївна` and `-ovych`/`-ович` spellings, which would move O1's rotation too. +Open: the Icelandic ending rule, which an `is` pack would turn on (the RFC's work order: 3b, 4c and 4f); whether the East Slavic endings should take the Ukrainian `-ivna`/`-ївна` and `-ovych`/`-ович` spellings, which would move O1's rotation too. Whether `a/k`, written once among Malaysia's election candidates for `anak`, and `a/l` written spaced (`A / L`), which no list measured writes, should read as `a/l` does (#1468); India's and Pakistan's `S/O`, `D/O` and `W/O`, which name a parent or a husband outside the legal name (#1165). ## Log @@ -24,3 +25,9 @@ Open: the Icelandic ending rule, which an `is` pack would turn on (the RFC's wor 9. **Accepted after the second review.** R2 reads a name part made only of particles as name words, and O3's fold can give such a part a base, so its particle reads as one under the fold alone (`Ali, bin bin Abu` gives 'bin Abu' under `middle_as_family`, none without); `test_middle_as_family_moves_no_patronymic_r2_does_not_move` holds the two policies to the same patronymic words wherever R2's marks agree, 4,494 of 5,080 parses of its grid. Two Turkic patronymics, one in the name and one in the maiden name, are one view (`Leyla Vali qizi née Rasim qizi`), as two nasab particles are. - Measured 2026-10-29 on the 4c branch over `a9884bfb`. The committed snapshot's 6,570 readings of the base: 23 gain a `patronymic` key, every one a patronymic particle's run (the snapshot parses no pack), and one row's alternative moves (`bin Stromae Elizabeth Windsor Maria Teresa MP` under FAMILY_FIRST, `particle as family` to `patronymic as family`); no field moves; rules/R9's examples add 31 names, 6,601 readings in all. Recompute: compare each row of `snapshot.jsonl` with its base row, `patronymic` and `alternatives` set apart. The agreement records gain only `patronymic` entries, each a patronymic stated and not read, none read where the source states none or another: Wikidata 334 (its `patronymic-ru` 126, `patronymic-ri` 41, `patronymic-su` 62, `patronymic-is` 100 and `patronymic-my` 5), the native-script source 17 (`uk-ua` 14, `kk-kz` 3), conventions 6. Under the RU pack, Wikidata's `patronymic-ru` agrees 126 of 126, `patronymic-ri` 41 of 41 and `patronymic-su` 61 of 62, the miss `Оксана Сергіївна Баюл`'s Ukrainian ending; `patronymic-my` agrees 4 of 9 in the default, the five misses written without `bin`. Recompute: parse each `wikidata_fields.jsonl` row stating a patronymic with `cldr_agreement.parse_rendering`, with and without `RU`, and compare `got_roles(...)["patronymic"]` with `expected_roles(...)["patronymic"]` by `same`. Frames per parse (`sys.setprofile` call events, a warm parse), re-taken after the second review's fixes: the reference row `Dr. Juan Q. Xavier de la Vega III` 369 and `John Smith` 153 on both trees under the default policy; a patronymic particle adds two (`Mahathir bin Mohamad` 217 to 219), P6's attached shape nine (`Mohamad, Mahathir bin` 263 to 272, `Bakar, Ali bin Abu` 289 to 298, its family's tokens rebuilt; the look for a family word not folded is a loop, a generator there costing two more and one per word behind an empty head). The opt-in rules pay per word, which is frame question (1) of root AGENTS.md, a cost that scales with the input, recorded here and guarded by the `patronymic_rules` row of `tests/v2/test_benchmark.py`'s `_POLICY_SHAPES`: RU one per middle word read as a name (`Ivan Ivanovich Ivanov` 211 to 213, `John Paul George Ringo Smith` 270 to 273, the reference row 369 to 370), TR_AZ one per parse (`_turkic_patronymics`), one per word in a name field or the maiden name (`is_patronymic_marker`, which O2's rotation also asks once of the last word), and two per marker found (`comma_bucket`), the father's token built once (`John Smith` 153 to 156, the reference row 369 to 376, `Ali Ahmad Vali oglu` 243 to 251: one, four in the arm and one in O2, two). The ending and marker tests are `_vocab`'s shared predicates rather than an inline pre-check, the rules being opt-in and their per-word cost one frame. - 2026-11-02 #754, sub-phase 4i-b — A PATRONYMIC PARTICLE IS ONE THE LEXICON HOLDS AS ONE. SUPERSEDES item 4 of the 4c entry above. The compile gives `PATRONYMIC_PARTICLES`, which classify reads off the lexicon (rules/R9 amended), so `add("ben", kind="patronymic")` makes `ben` one and a word holding another particle kind is a plain particle; on the default the set is the index's, no patronymic reading being written off by default (2026-11-02), so no default parse moves. +- 2026-11-19 #1468 — `a/l`, `a/p` AND `anak` ARE PATRONYMIC PARTICLES, READ AS `bin` IS. Malaysian Indian names write `a/l` (anak lelaki, son of) or `a/p` (anak perempuan, daughter of) between the bearer's name and the father's, and Iban and Bidayuh names write `anak` (child of); the default read all three as name words, so a father's name of two words was cut (`KUMAR A/L RAJAN NAIDU` read middle 'A/L RAJAN', family 'NAIDU'). Each is now a `patronymic` reading in `ms.toml`, so the family opens at it and the patronymic view holds the father's name (family 'A/L RAJAN NAIDU', patronymic the same), as `bin` gives (rules/R9's examples). + - **The kind test** (rules/R9's Accepted clause): the words after each are the bearer's father's name, not a family name passed down. Of the 118 distinct phrases after the three words in `my-candidates` and `my_parliament` together, 109 follow one bearer; the 9 that follow two or more are one member written two ways, brothers, or a common Tamil given name (`KRISHNAN`, `MUNIANDY`, `SUBRAMANIAM`) (2026-11-19). + - **The spellings**: only the slashed ones, in capitals or lower case, are written: `A/L` 72 and `A/P` 3 in `my-candidates`' 3,683 spellings, `a/l` 12 and `a/p` 1 in OpenSanctions' `my_parliament`; neither writes `A / L` spaced, `AL` or `AP` for the particle, or a full stop (2026-11-19). A slashed word listed whole is one token and one word (the slash parts only standing alone, decisions/C10), so the readings need no new shape; `A/L.` with a final full stop reads as `a/l` by the fold, unmeasured. + - **`anak` is also a given name at the head.** Balinese names open with `Anak Agung` (ORCID's given boxes; Indonesia's DPR, DPD and 2018 regional heads in `opensanctions-parliaments`), and a never-given particle opening a name would take the whole name into the family (rules/P1). So `anak` keeps a `given` reading beside the patronymic one, as `binti` does: at the head it is left to position, given 'Anak' as before, and records `PARTICLE_OR_GIVEN`; mid-name it opens the family. `a/l` and `a/p` state `may_be_given = false`, no one bearing either as a name. Where a source composes a Balinese filer's boxes given name first (`Sari Anak Agung Ayu`), the family now reads 'Anak Agung Ayu', the family box as filed, where it read middle 'Anak Agung'. Under the family-first orders every new word reads as `bin` reads (`Kumar a/l Rajan` under FAMILY_FIRST: given 'a/l Rajan', family 'Kumar'). A surname `Anak` (Ghana, Turkey) ending the name stays the family, a particle ending its field being a name word. + - **Case repair** writes the particles in lower case, as it writes `bin` (rules/R4): `KUMAR A/L RAJAN` repairs to 'Kumar a/l Rajan' where it gave 'Kumar A/L Rajan', the Dewan Rakyat's own list writing `a/l` and `anak` in lower case. + - **Measured 2026-11-19** on this change over master `a6198e5d`, `snapshot.py --local --base `: `my-candidates` moves 115 of 3,683 spellings, every one a name holding `A/L` (69 names), `A/P` (3) or `ANAK` (43) whose family went from the father's last word to the particle and the father's whole name, the view filling; none read so before, all 115 after. `opensanctions-parliaments` moves 28 of 26,515: the 25 `my_parliament` names holding `a/l` (12), `a/p` (1) or `anak` (12), each the same move, and the three `ANAK AGUNG` names of Indonesia's lists gaining the `PARTICLE_OR_GIVEN` report, no field moved. The committed snapshot moves two corpus names, `Suresh a/l Muthu` and `Kavitha a/p Raman`, the same move. diff --git a/docs/design/decisions/family-without-an-inherited-name.md b/docs/design/decisions/family-without-an-inherited-name.md index 039afae30..22782933c 100644 --- a/docs/design/decisions/family-without-an-inherited-name.md +++ b/docs/design/decisions/family-without-an-inherited-name.md @@ -21,7 +21,7 @@ Open: #1188 (Kazakh), #1155 (`بن` chain), #1231 (Burma), each a value question - #1155 a family name after a `بن` chain: the view may be a part of the family, stopping before a family name a closed signal marks; which signal is a value question. - #1210 Hebrew `בן`: decided with #1257, a clan particle filling no view (decisions/vocabulary-collisions' 2026-11-12 #1257 entry). - #1231 Burma: a pack, the last word the `family` by position, the honorifics titles. - - #1165 `S/O`, `W/O`: out of this decision; the words after the marker are another person's name, which the model has no place for. Malaysian `a/l` and `a/p`, where the father's name is part of the legal name, read as `bin` does and are a vocabulary question. + - #1165 `S/O`, `W/O`: out of this decision; the words after the marker are another person's name, which the model has no place for. Malaysian `a/l` and `a/p`, where the father's name is part of the legal name, read as `bin` does and are a vocabulary question, answered by decisions/R9's 2026-11-19 #1468 entry, with Sarawak's `anak`. - **Measured for #1203** (dated snapshots): - House of Peoples' Representatives (OpenSanctions `et_hopr`, as `opensanctions-parliaments` fetched it on 2026-11-12, the dataset's version of that day): 2,191 distinct names, 211 of two words, 1,940 of three, 35 of four and 5 longer; the default reads 1,938 of the 1,940 three-word names as own name, father (`middle`) and grandfather (`family`), the two others being `Abu Tuke Birki` (given 'Abu Tuke', `abu` joining the word after it as a bound given name, rules/P5) and `MOHAMMED ABU HESEN` (family 'ABU HESEN'); no name fills the patronymic view. The list has no fields, so the reading expected is the convention's. #1203 counted 2,291 names, 2,039 of three words, on the 2026-11-08 fetch. Recompute: the `et_hopr` rows of `local/opensanctions-parliaments/raw.jsonl` whose `form` is `name`, distinct, each parsed with `parse()` and compared word by word with its own words. - ORCID's Ethiopian and Eritrean records, scored against the boxes their holders filed (`config_diff.py score default 'default@middle_as_family=1' --group ET --group ER`, run in a master 2b39f23d checkout on 2026-11-12): ET 91.95% by default against 70.43% under `middle_as_family` (18,794 records), ER 92.24% against 72.41% (232). #1203 measured 91.99% and 70.46% for ET on 2026-11-08; ER is unchanged. diff --git a/docs/design/rules/R9-patronymic-view.md b/docs/design/rules/R9-patronymic-view.md index 58e7f1a6d..21880562f 100644 --- a/docs/design/rules/R9-patronymic-view.md +++ b/docs/design/rules/R9-patronymic-view.md @@ -17,6 +17,9 @@ "Abdul Rahman bin Ahmad" → patronymic="bin Ahmad" "Ali bin Ahmad bin Hasan" → patronymic="bin Ahmad bin Hasan" "Siti binti Abu Bakar" → patronymic="binti Abu Bakar" +"Kumar a/l Rajan Naidu" → patronymic="a/l Rajan Naidu" +"Devi a/p Muthu" → patronymic="a/p Muthu" +"Jerry anak Jimbun" → patronymic="anak Jimbun" "Moshe bar Yosef" → patronymic="bar Yosef" "محمد بن سلمان" → patronymic="بن سلمان" "Mahathir bin Mohamad Jr." → patronymic="bin Mohamad" @@ -39,6 +42,7 @@ ``` "Mahathir, bin Mohamad" → patronymic="" "bin Mohamad" → patronymic="" + "Anak Agung Made Putra" → patronymic="" ``` - **A patronymic particle ending its field names no parent**, so a family word spelled like one stays a name word. ``` @@ -73,7 +77,7 @@ **Accepted:** - A patronymic written with no particle and no rule to read it is not read, since a position says nothing about a parent: Wikidata's Malay names with a patronymic and no family name agree 4 of 9 (measured 2026-10-29, #948), those written without `bin` read as given and family. -- The particle's kind is the word's, not the name's, by one test: it is a patronymic where, among the bearers measured, the phrase it opens names the bearer's own father more often than it is a family name passed down unchanged, and a clan particle otherwise; the test binds a word a change adds or reopens, and `bar`, `bin`, `binti`, `ibn` and `בת` stand as they are, not re-judged. So a patronymic fills the view where it opens a fixed family name, and a clan particle fills none where a name uses it for the father: `ben` and Hebrew `בן` are clan particles, their family names outnumbering their fathers' names (the Knesset list's `בן` 15 of 15), so an Arab name transcribed in Hebrew script and a Tunisian register's chain leave the view empty; Hassaniya `ould`, which the test reads as a clan particle, is a patronymic by a choice made for the Mauritanian use, so it fills the view in an Algerian surname too (decisions/vocabulary-collisions, 2026-11-12 #1257). +- The particle's kind is the word's, not the name's, by one test: it is a patronymic where, among the bearers measured, the phrase it opens names the bearer's own father more often than it is a family name passed down unchanged, and a clan particle otherwise; the test binds a word a change adds or reopens, and `bar`, `bin`, `binti`, `ibn` and `בת` stand as they are, not re-judged. Malaysian `a/l` and `a/p` (son of, daughter of) and Sarawak's `anak` (child of) pass it, the words after each being the bearer's father's name (decisions/R9, #1468). So a patronymic fills the view where it opens a fixed family name, and a clan particle fills none where a name uses it for the father: `ben` and Hebrew `בן` are clan particles, their family names outnumbering their fathers' names (the Knesset list's `בן` 15 of 15), so an Arab name transcribed in Hebrew script and a Tunisian register's chain leave the view empty; Hassaniya `ould`, which the test reads as a clan particle, is a patronymic by a choice made for the Mauritanian use, so it fills the view in an Algerian surname too (decisions/vocabulary-collisions, 2026-11-12 #1257). ``` "Karim Ould Haddou" → patronymic="Ould Haddou" "סאמר בן חליל" → patronymic="" diff --git a/docs/migrate.rst b/docs/migrate.rst index 9f6f6dd43..4a19a0d0d 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -909,7 +909,7 @@ list, with reasoning, is in each release's section of ``Md``, Thai names, credentials after a comma - :ref:`migrate-3-1` * - 3.2 - - Dutch ``Oude`` + - Dutch ``Oude``, Malaysian ``a/l``, ``a/p`` and ``anak`` - :ref:`migrate-3-2` Each entry says what it compares with. The lists of readings through @@ -2157,3 +2157,24 @@ reports the fork, as ``van`` does: ``locales.NL``, new in 3.2, reads ``ten`` the same way (``Jan ten Brink`` gives family ``ten Brink``); the default parse of a name holding ``ten`` is unchanged. + +Malaysian a/l, a/p and anak +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``a/l`` (son of), ``a/p`` (daughter of) and ``anak`` (child of) start +the family name, the father's name, as ``bin`` does, where 1.4 through +3.1 left them in the middle name and cut a father's name of two words; +the ``patronymic`` view holds the same words. ``anak`` opening a name, +as Balinese ``Anak Agung`` does, stays the given name and reports the +fork: + +.. doctest:: + + >>> malaysian = parse("KUMAR A/L RAJAN NAIDU") + >>> malaysian.middle, malaysian.family, malaysian.patronymic + ('', 'A/L RAJAN NAIDU', 'A/L RAJAN NAIDU') + >>> parse("Rita Sari anak Jerome Insol").family + 'anak Jerome Insol' + >>> balinese = parse("Anak Agung Made Putra") + >>> balinese.given, [str(report.kind) for report in balinese.ambiguities] + ('Anak', ['particle-or-given']) diff --git a/docs/release_log.rst b/docs/release_log.rst index 19390cd63..3bee9b872 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -4,6 +4,7 @@ Release Log nameparser 3.2 is under development. + - **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 (Balinese ``Anak Agung``) stays the given name, 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` - **Fix MD inside a name written in capitals, which read as the degree and took the name behind it.** ``parse("SITI NORA MD YUSRI")`` gives middle ``NORA MD``, family ``YUSRI``, as 1.4.0 through 2.3.0 did, where 2.4.0 through 3.1.0 gave family ``NORA``, suffix ``MD YUSRI``; a name in lower case reads the same way, and both report ``suffix-or-name``, the degree being the other reading. The degree written before a family name in capitals reads so too (``JOHN SMITH MD JONES`` gives family ``JONES``, reported), where ``John Smith MD Jones`` and ``JOHN SMITH M.D. JONES`` keep it. :issue:`1394` diff --git a/nameparser/config/_compiled.py b/nameparser/config/_compiled.py index 40a0f7fc5..658e65969 100644 --- a/nameparser/config/_compiled.py +++ b/nameparser/config/_compiled.py @@ -2185,6 +2185,8 @@ NON_GIVEN_NAME_PARTICLES: frozenset[str] = frozenset({ "'s", "'t", + 'a/l', + 'a/p', 'ad-', 'adh-', 'af', @@ -2270,6 +2272,8 @@ PARTICLES: frozenset[str] = frozenset({ "'s", "'t", + 'a/l', + 'a/p', 'aan', 'abu', 'ad-', @@ -2280,6 +2284,7 @@ 'al', 'al-', 'an-', + 'anak', 'ar-', 'as-', 'ash-', @@ -3980,6 +3985,9 @@ }) PATRONYMIC_PARTICLES: frozenset[str] = frozenset({ + 'a/l', + 'a/p', + 'anak', 'bar', 'bat', 'bin', diff --git a/nameparser/config/_index.py b/nameparser/config/_index.py index 6b1a88652..7a10abf5b 100644 --- a/nameparser/config/_index.py +++ b/nameparser/config/_index.py @@ -35,6 +35,8 @@ ('8-vsb', (('en', 'credential', ()),)), ('8th', (('en', 'modifier', ()),)), ('9th', (('en', 'modifier', ()),)), + ('a/l', (('ms', 'patronymic', ()),)), + ('a/p', (('ms', 'patronymic', ()),)), ('a1c', (('en', 'military', ()),)), ('aan', (('nl', 'preposition', ()), ('nl', 'given', ()))), ('aas', (('en', 'credential', ()),)), @@ -146,6 +148,7 @@ ('ams', (('en', 'credential', ()), ('en', 'family', ()))), ('an-', (('ar', 'article', (('same_as', 'al-'),)),)), ('ana', (('en', 'familiar', (('short_for', ('anastasia',)),)),)), + ('anak', (('ms', 'patronymic', ()), ('ms', 'given', ()))), ('analytics', (('en', 'modifier', ()),)), ('anarchist', (('en', 'occupation', ()),)), ('anastasiia', (('ru', 'spelling', (('spelling_of', ('anastasia',)),)),)), diff --git a/nameparser/vocab/ms.toml b/nameparser/vocab/ms.toml index 4ddae46c3..af4c6faa6 100644 --- a/nameparser/vocab/ms.toml +++ b/nameparser/vocab/ms.toml @@ -16,6 +16,35 @@ excluded = { salutation = { reason = "Malay Mrs., and an Indonesian given name ( text = "sultan" nobility = {} +[[word]] +text = "a/l" +[word.patronymic] +issue = 1468 +expands = "anak lelaki, son of: \"Kumar a/l Rajan\"" +gender = "m" +may_be_given = false +note = "Malaysian Indian names, read as 'bin' is. Written only with the slash, in capitals or lower case: Malaysia's election candidates write A/L 72 times in 3,077 names, OpenSanctions' my_parliament a/l 12 times, and neither writes it spaced (A / L) or with full stops (2026-11-19). One candidate writes A/K for anak, not listed" + +[[word]] +text = "a/p" +[word.patronymic] +issue = 1468 +expands = "anak perempuan, daughter of: \"Devi a/p Muthu\"" +gender = "f" +may_be_given = false +note = "the female partner of 'a/l'; A/P 3 times among Malaysia's election candidates, a/p once in my_parliament (2026-11-19)" + +[[word]] +text = "anak" +[word.given] +wikidata = 1 +as_of = 2026-11-19 +note = "#1468: Balinese names open with 'Anak Agung' (ORCID given boxes, Indonesia's DPR, DPD and 2018 regional heads), so the word at the head of a name stays the given name, by position, as a particle that may be given does (rules/P1); Wikidata is a lower bound; SSA under 5 a year; Nepal's local candidates 1 (Anak Alemagar)" +[word.patronymic] +issue = 1468 +expands = "child of, Iban and Bidayuh names: \"Jerry anak Jimbun\"" +note = "Sarawak names, read as 'bin' is: ANAK 55 times among Malaysia's election candidates, anak 12 times in my_parliament, every one between the given name and the father's (2026-11-19). Also the Malay and Indonesian noun 'child'" + [[word]] text = "bin" patronymic = { expands = "son of: \"Ahmad bin Ismail\"", gender = "m" } diff --git a/tests/v2/cases.py b/tests/v2/cases.py index ea79d6dee..dbcdb1531 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -9048,6 +9048,56 @@ def _check_cjk_shape_purity(self) -> None: notes="a generation word written out before a name starts no " "run (S8), so the chain takes it. 1.4.0 through 3.0.1 " "read middle 'bin Ahmad Jr.', family 'Hasan'"), + # #1468: Malaysian a/l and a/p (son of, daughter of) and Sarawak's + # anak (child of) open the father's name as bin does (rules/R9) + Case("a_slashed_son_of_opens_the_family", + "Kumar a/l Rajan", + {"given": "Kumar", "family": "a/l Rajan"}, + classification="fix(#1468)", + notes="1.4.0 through 3.1 read middle 'a/l', family 'Rajan'"), + Case("a_slashed_son_of_in_capitals_takes_the_fathers_whole_name", + "KUMAR A/L RAJAN NAIDU", + {"given": "KUMAR", "family": "A/L RAJAN NAIDU"}, + classification="fix(#1468)", + notes="1.4.0 through 3.1 read middle 'A/L RAJAN', family 'NAIDU', " + "cutting the father's name"), + Case("a_slashed_daughter_of_opens_the_family", + "Devi a/p Muthu", + {"given": "Devi", "family": "a/p Muthu"}, + classification="fix(#1468)", + notes="1.4.0 through 3.1 read middle 'a/p', family 'Muthu'"), + Case("anak_after_two_given_names_opens_the_family", + "Rita Sari anak Jerome Insol", + {"given": "Rita", "middle": "Sari", "family": "anak Jerome Insol"}, + classification="fix(#1468)", + notes="1.4.0 through 3.1 read middle 'Sari anak Jerome', family " + "'Insol'"), + Case("a_slashed_son_of_after_a_family_comma_opens_the_family", + "Rajan, Kumar a/l", + {"given": "Kumar", "family": "a/l Rajan"}, + classification="fix(#1468)", + notes="P6 attaches the trailing particle to the family before the " + "comma, as it does 'bin'. 1.4.0 through 3.1 read middle " + "'a/l'"), + Case("a_slashed_son_of_before_a_suffix_comma_opens_the_family", + "Kumar a/l Rajan, Jr.", + {"given": "Kumar", "family": "a/l Rajan", "suffix": "Jr."}, + classification="fix(#1468)", + notes="1.4.0 through 3.1 read middle 'a/l', family 'Rajan'"), + Case("anak_opening_a_balinese_name_stays_the_given_name", + "Anak Agung Made Putra", + {"given": "Anak", "middle": "Agung Made", "family": "Putra"}, + classification="parity", + ambiguities=("particle-or-given",), + notes="#1468's boundary: anak holds a given reading beside its " + "patronymic one, so at the head it is left to position as " + "binti is, and the fork is reported"), + Case("anak_ending_the_name_stays_the_family", + "Jesse Kofi Anak", + {"given": "Jesse", "middle": "Kofi", "family": "Anak"}, + classification="parity", + notes="#1468's boundary: a particle ending its field is a family " + "name word (Anak is a Ghanaian surname)"), Case("a_credential_in_capitals_inside_the_chain_starts_the_run", "Mariam binti MD Salleh", {"given": "Mariam", "family": "binti", "suffix": "MD Salleh"}, diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index 45d05d8c1..9aa67722b 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -493,10 +493,12 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # each reporting particle-or-given under three orders; 2107 -> 2187 # the same day, #1394's rows under three orders or once where a row # declares a policy: the decline's report on each moved row, and - # its boundary rows' run reports. - assert claims == 2187, ( - f"the field sweep checks {claims} claims, recorded as 2187 on " - f"2026-11-18") + # its boundary rows' run reports; 2187 -> 2191 on 2026-11-19, + # #1468's 'Anak Agung Made Putra' reporting particle-or-given under + # three orders and 'Jesse Kofi Anak' under FAMILY_FIRST. + assert claims == 2191, ( + f"the field sweep checks {claims} claims, recorded as 2191 on " + f"2026-11-19") #: The kinds that report a fork between two readings of a word, so carry @@ -972,8 +974,9 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None: # P6's report, each stand-in landing in the alternative's field; # 477 -> 494 and 598 -> 603 the same day, #1394's rows under the # three orders, the declines' reports and the boundary rows' run - # reports, three of them stand-in rereads - assert (checked, skipped) == (603, 494), (checked, skipped) + # reports, three of them stand-in rereads; 603 -> 604 on 2026-11-19, + # #1468's anak rows + assert (checked, skipped) == (604, 494), (checked, skipped) def test_every_case_name_is_unique() -> None: diff --git a/tools/differential/conventions_agreement.json b/tools/differential/conventions_agreement.json index 79635a4e1..3eede4575 100644 --- a/tools/differential/conventions_agreement.json +++ b/tools/differential/conventions_agreement.json @@ -117,15 +117,11 @@ "conventions/Kavitha a/p Raman/default": { "family": { "expected": "", - "got": "Raman" + "got": "a/p Raman" }, "given_names": { "expected": "Kavitha a/p Raman", - "got": "Kavitha a/p" - }, - "patronymic": { - "expected": "a/p Raman", - "got": "" + "got": "Kavitha" }, "text": "Kavitha a/p Raman" }, @@ -225,15 +221,11 @@ "conventions/Suresh a/l Muthu/default": { "family": { "expected": "", - "got": "Muthu" + "got": "a/l Muthu" }, "given_names": { "expected": "Suresh a/l Muthu", - "got": "Suresh a/l" - }, - "patronymic": { - "expected": "a/l Muthu", - "got": "" + "got": "Suresh" }, "text": "Suresh a/l Muthu" }, diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index cc2b5aa5b..6efd8382b 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -151,6 +151,7 @@ "Ana abdul Rahman López" "Ana de María Pérez" "Ana de Miguel de la Vega" +"Anak Agung Made Putra" "Andrew" "Andrew (Andy) Perkins" "Andrew Perkins (Andy)" @@ -267,6 +268,7 @@ "Dean. Smith" "Dean. and Mary Smith" "Del Toro" +"Devi a/p Muthu" "Dipl.-Kfm. Dalimil Ospalý" "Doe Jane Mrs" "Doe nee Smith Jr. Prof., Jane" @@ -731,6 +733,7 @@ "Jeffrey (JD) Bricken" "Jeffrey LAM Kin-fung" "Jeremy St.John Middleton" +"Jerry anak Jimbun" "Jiří Dienstbier ml." "Jiří Dienstbier st." "Joan MAS i MBA" @@ -1166,6 +1169,7 @@ "King Henry" "Kofi Junior" "Konstantin VII." +"Kumar a/l Rajan Naidu" "LAKSHMI R S" "LE GRAND Hugo" "LEVON TER PETROSYAN" diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index c34ccc266..24ed636df 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -305,6 +305,7 @@ {"name": "Ana abdul Rahman López", "given": "Ana", "middle": "abdul Rahman", "family": "López", "initials": "A. a. R. L.", "capitalized_force": "Ana Abdul Rahman López"} {"name": "Ana de María Pérez", "given": "Ana", "middle": "de María", "family": "Pérez", "initials": "A. M. P."} {"name": "Ana de Miguel de la Vega", "given": "Ana", "middle": "de Miguel", "family": "de la Vega", "initials": "A. M. V."} +{"name": "Anak Agung Made Putra", "given": "Anak", "middle": "Agung Made", "family": "Putra", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: patronymic as family (vocabulary)"], "initials": "A. A. M. P."} {"name": "Anan ben David", "given": "Anan", "middle": "ben", "family": "David", "initials": "A. b. D.", "capitalized_force": "Anan Ben David"} {"name": "Andersen Irene", "order": "FAMILY_FIRST", "given": "Irene", "family": "Andersen", "initials": "I. A."} {"name": "Andersen, Irene", "given": "Irene", "family": "Andersen", "initials": "I. A."} @@ -788,6 +789,7 @@ {"name": "Designated Judge David A. Ezra", "title": "Designated Judge", "given": "David", "middle": "A.", "family": "Ezra", "initials": "D. A. E."} {"name": "Desvalls i d’Ardena, Joan Antoni", "given": "Joan", "middle": "Antoni", "family": "Desvalls i d’Ardena", "initials": "J. A. D. d.", "capitalized_force": "Joan Antoni Desvalls i D’Ardena"} {"name": "Deventer, Willem Antonie van", "given": "Willem", "middle": "Antonie", "family": "van Deventer", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "W. A. D."} +{"name": "Devi a/p Muthu", "given": "Devi", "family": "a/p Muthu", "initials": "D. M.", "patronymic": "a/p Muthu"} {"name": "Dhòmhnallach Oighrig", "order": "FAMILY_FIRST", "given": "Oighrig", "family": "Dhòmhnallach", "initials": "O. D."} {"name": "Dhòmhnallach, Oighrig", "given": "Oighrig", "family": "Dhòmhnallach", "initials": "O. D."} {"name": "Di Caprio", "given": "Di", "family": "Caprio", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: particle as family (vocabulary)"], "initials": "D. C."} @@ -1960,6 +1962,7 @@ {"name": "Jenny Baker", "given": "Jenny", "family": "Baker", "initials": "J. B."} {"name": "Jenny Baker (Johnson)", "given": "Jenny", "family": "Baker", "nickname": "Johnson", "initials": "J. B."} {"name": "Jeremy St.John Middleton", "given": "Jeremy", "middle": "St.John", "family": "Middleton", "initials": "J. S. M."} +{"name": "Jerry anak Jimbun", "given": "Jerry", "family": "anak Jimbun", "initials": "J. J.", "patronymic": "anak Jimbun"} {"name": "Jesús Alcolea Fernández", "given": "Jesús", "middle": "Alcolea", "family": "Fernández", "initials": "J. A. F."} {"name": "Jesús Alcántara Miranda", "given": "Jesús", "middle": "Alcántara", "family": "Miranda", "initials": "J. A. M."} {"name": "Jesús Gallego Marquina", "given": "Jesús", "middle": "Gallego", "family": "Marquina", "initials": "J. G. M."} @@ -2702,7 +2705,7 @@ {"name": "Kaur del Carmen García", "given": "Kaur", "family": "del Carmen García", "initials": "K. C. G."} {"name": "Kavitha S", "given": "Kavitha", "family": "S", "ambiguities": ["ORDER"], "initials": "K. S."} {"name": "Kavitha S MA", "given": "Kavitha", "family": "S", "suffix": "MA", "ambiguities": ["ORDER"], "initials": "K. S."} -{"name": "Kavitha a/p Raman", "given": "Kavitha", "middle": "a/p", "family": "Raman", "initials": "K. a. R.", "capitalized_force": "Kavitha A/P Raman"} +{"name": "Kavitha a/p Raman", "given": "Kavitha", "family": "a/p Raman", "initials": "K. R.", "patronymic": "a/p Raman"} {"name": "Kaya Yağız Can", "order": "FAMILY_FIRST", "given": "Yağız", "middle": "Can", "family": "Kaya", "initials": "Y. C. K."} {"name": "Kaya, Yağız Can", "given": "Yağız", "middle": "Can", "family": "Kaya", "initials": "Y. C. K."} {"name": "Kazlauskienė Irena", "order": "FAMILY_FIRST", "given": "Irena", "family": "Kazlauskienė", "initials": "I. K."} @@ -2770,6 +2773,7 @@ {"name": "Krosigk, Johann Adolf von", "given": "Johann", "middle": "Adolf", "family": "von Krosigk", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "J. A. K."} {"name": "Kulina, Hana", "given": "Hana", "family": "Kulina", "initials": "H. K."} {"name": "Kulina, Hana", "order": "FAMILY_FIRST", "given": "Hana", "family": "Kulina", "initials": "H. K."} +{"name": "Kumar a/l Rajan Naidu", "given": "Kumar", "family": "a/l Rajan Naidu", "initials": "K. R. N.", "patronymic": "a/l Rajan Naidu"} {"name": "Kusmanek, Hermann von", "given": "Hermann", "family": "von Kusmanek", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "H. K."} {"name": "Kállai, Gábor", "given": "Gábor", "family": "Kállai", "initials": "G. K."} {"name": "Kári Árnason", "given": "Kári", "family": "Árnason", "initials": "K. Á."} @@ -4262,7 +4266,7 @@ {"name": "Sultan Hassanal Bolkiah", "given": "Sultan", "middle": "Hassanal", "family": "Bolkiah", "initials": "S. H. B."} {"name": "Sultana Begum", "given": "Sultana", "family": "Begum", "initials": "S. B."} {"name": "Sumnime D.C(Oli)", "family": "Sumnime", "suffix": "D.C", "nickname": "Oli", "initials": "S."} -{"name": "Suresh a/l Muthu", "given": "Suresh", "middle": "a/l", "family": "Muthu", "initials": "S. a. M.", "capitalized_force": "Suresh A/L Muthu"} +{"name": "Suresh a/l Muthu", "given": "Suresh", "family": "a/l Muthu", "initials": "S. M.", "patronymic": "a/l Muthu"} {"name": "Surāqa Ibn-Mirdās al-Aṣġar", "given": "Surāqa", "middle": "Ibn-Mirdās", "family": "al-Aṣġar", "initials": "S. I. a.", "capitalized_force": "Surāqa Ibn-Mirdās Al-Aṣġar"} {"name": "Suzuki san", "order": "FAMILY_FIRST", "given": "san", "family": "Suzuki", "initials": "s. S.", "capitalized_force": "Suzuki San"} {"name": "Suzuki, Shōsan", "given": "Shōsan", "family": "Suzuki", "initials": "S. S."} From 645f875e005d877149580ff260d1d183c4d8df7c Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Thu, 19 Nov 2026 10:18:43 -0800 Subject: [PATCH 2/3] Address review of #1468: counts by unit, accepted costs, missing rows The reviews found the move counts dividing distinct names by records (115 of 3,077 names, 130 of 3,683 records in my-candidates, where the first commit's message and entry said 115 of 3,683 spellings), a real candidate's name in a note, an unsupported surname claim, and wording true only under the default order. They also found shapes no row pinned: a/l opening the name and the given part after a family comma (P1's fold for a never-given particle, as de reads, where bin leaves a given name), a trailing Anak under FAMILY_FIRST, case repair in capitals, and anak opening the family behind a Balinese prefix, where the patronymic view holds the title Anak Agung. That last cost is recorded as accepted in rules/R9 and decisions/R9. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/R9-patronymic-view.md | 9 +++-- docs/design/rules/R9-patronymic-view.md | 4 ++ docs/migrate.rst | 7 +++- docs/release_log.rst | 2 +- nameparser/vocab/ms.toml | 6 +-- tests/v2/cases.py | 44 ++++++++++++++++++++- tests/v2/test_cases.py | 15 ++++--- tools/differential/corpus_rules.jsonl | 1 + tools/differential/snapshot.jsonl | 1 + 9 files changed, 72 insertions(+), 17 deletions(-) diff --git a/docs/design/decisions/R9-patronymic-view.md b/docs/design/decisions/R9-patronymic-view.md index 8b3fd3189..2f006f8ae 100644 --- a/docs/design/decisions/R9-patronymic-view.md +++ b/docs/design/decisions/R9-patronymic-view.md @@ -26,8 +26,9 @@ Open: the Icelandic ending rule, which an `is` pack would turn on (the RFC's wor - Measured 2026-10-29 on the 4c branch over `a9884bfb`. The committed snapshot's 6,570 readings of the base: 23 gain a `patronymic` key, every one a patronymic particle's run (the snapshot parses no pack), and one row's alternative moves (`bin Stromae Elizabeth Windsor Maria Teresa MP` under FAMILY_FIRST, `particle as family` to `patronymic as family`); no field moves; rules/R9's examples add 31 names, 6,601 readings in all. Recompute: compare each row of `snapshot.jsonl` with its base row, `patronymic` and `alternatives` set apart. The agreement records gain only `patronymic` entries, each a patronymic stated and not read, none read where the source states none or another: Wikidata 334 (its `patronymic-ru` 126, `patronymic-ri` 41, `patronymic-su` 62, `patronymic-is` 100 and `patronymic-my` 5), the native-script source 17 (`uk-ua` 14, `kk-kz` 3), conventions 6. Under the RU pack, Wikidata's `patronymic-ru` agrees 126 of 126, `patronymic-ri` 41 of 41 and `patronymic-su` 61 of 62, the miss `Оксана Сергіївна Баюл`'s Ukrainian ending; `patronymic-my` agrees 4 of 9 in the default, the five misses written without `bin`. Recompute: parse each `wikidata_fields.jsonl` row stating a patronymic with `cldr_agreement.parse_rendering`, with and without `RU`, and compare `got_roles(...)["patronymic"]` with `expected_roles(...)["patronymic"]` by `same`. Frames per parse (`sys.setprofile` call events, a warm parse), re-taken after the second review's fixes: the reference row `Dr. Juan Q. Xavier de la Vega III` 369 and `John Smith` 153 on both trees under the default policy; a patronymic particle adds two (`Mahathir bin Mohamad` 217 to 219), P6's attached shape nine (`Mohamad, Mahathir bin` 263 to 272, `Bakar, Ali bin Abu` 289 to 298, its family's tokens rebuilt; the look for a family word not folded is a loop, a generator there costing two more and one per word behind an empty head). The opt-in rules pay per word, which is frame question (1) of root AGENTS.md, a cost that scales with the input, recorded here and guarded by the `patronymic_rules` row of `tests/v2/test_benchmark.py`'s `_POLICY_SHAPES`: RU one per middle word read as a name (`Ivan Ivanovich Ivanov` 211 to 213, `John Paul George Ringo Smith` 270 to 273, the reference row 369 to 370), TR_AZ one per parse (`_turkic_patronymics`), one per word in a name field or the maiden name (`is_patronymic_marker`, which O2's rotation also asks once of the last word), and two per marker found (`comma_bucket`), the father's token built once (`John Smith` 153 to 156, the reference row 369 to 376, `Ali Ahmad Vali oglu` 243 to 251: one, four in the arm and one in O2, two). The ending and marker tests are `_vocab`'s shared predicates rather than an inline pre-check, the rules being opt-in and their per-word cost one frame. - 2026-11-02 #754, sub-phase 4i-b — A PATRONYMIC PARTICLE IS ONE THE LEXICON HOLDS AS ONE. SUPERSEDES item 4 of the 4c entry above. The compile gives `PATRONYMIC_PARTICLES`, which classify reads off the lexicon (rules/R9 amended), so `add("ben", kind="patronymic")` makes `ben` one and a word holding another particle kind is a plain particle; on the default the set is the index's, no patronymic reading being written off by default (2026-11-02), so no default parse moves. - 2026-11-19 #1468 — `a/l`, `a/p` AND `anak` ARE PATRONYMIC PARTICLES, READ AS `bin` IS. Malaysian Indian names write `a/l` (anak lelaki, son of) or `a/p` (anak perempuan, daughter of) between the bearer's name and the father's, and Iban and Bidayuh names write `anak` (child of); the default read all three as name words, so a father's name of two words was cut (`KUMAR A/L RAJAN NAIDU` read middle 'A/L RAJAN', family 'NAIDU'). Each is now a `patronymic` reading in `ms.toml`, so the family opens at it and the patronymic view holds the father's name (family 'A/L RAJAN NAIDU', patronymic the same), as `bin` gives (rules/R9's examples). - - **The kind test** (rules/R9's Accepted clause): the words after each are the bearer's father's name, not a family name passed down. Of the 118 distinct phrases after the three words in `my-candidates` and `my_parliament` together, 109 follow one bearer; the 9 that follow two or more are one member written two ways, brothers, or a common Tamil given name (`KRISHNAN`, `MUNIANDY`, `SUBRAMANIAM`) (2026-11-19). + - **The kind test** (rules/R9's Accepted clause): the words after each are the bearer's father's name, not a family name passed down. Of the 118 distinct phrases after the three words in `my-candidates`' and `my_parliament`'s raw records together, upper-cased (each phrase the words after the particle, its bearers the words before it), 109 follow one bearer; the 9 that follow two or more are one member written two ways, brothers, or a common Tamil given name (`KRISHNAN`, `MUNIANDY`, `SUBRAMANIAM`) (2026-11-19; counted as written, 130 phrases, 122 with one bearer). - **The spellings**: only the slashed ones, in capitals or lower case, are written: `A/L` 72 and `A/P` 3 in `my-candidates`' 3,683 spellings, `a/l` 12 and `a/p` 1 in OpenSanctions' `my_parliament`; neither writes `A / L` spaced, `AL` or `AP` for the particle, or a full stop (2026-11-19). A slashed word listed whole is one token and one word (the slash parts only standing alone, decisions/C10), so the readings need no new shape; `A/L.` with a final full stop reads as `a/l` by the fold, unmeasured. - - **`anak` is also a given name at the head.** Balinese names open with `Anak Agung` (ORCID's given boxes; Indonesia's DPR, DPD and 2018 regional heads in `opensanctions-parliaments`), and a never-given particle opening a name would take the whole name into the family (rules/P1). So `anak` keeps a `given` reading beside the patronymic one, as `binti` does: at the head it is left to position, given 'Anak' as before, and records `PARTICLE_OR_GIVEN`; mid-name it opens the family. `a/l` and `a/p` state `may_be_given = false`, no one bearing either as a name. Where a source composes a Balinese filer's boxes given name first (`Sari Anak Agung Ayu`), the family now reads 'Anak Agung Ayu', the family box as filed, where it read middle 'Anak Agung'. Under the family-first orders every new word reads as `bin` reads (`Kumar a/l Rajan` under FAMILY_FIRST: given 'a/l Rajan', family 'Kumar'). A surname `Anak` (Ghana, Turkey) ending the name stays the family, a particle ending its field being a name word. - - **Case repair** writes the particles in lower case, as it writes `bin` (rules/R4): `KUMAR A/L RAJAN` repairs to 'Kumar a/l Rajan' where it gave 'Kumar A/L Rajan', the Dewan Rakyat's own list writing `a/l` and `anak` in lower case. - - **Measured 2026-11-19** on this change over master `a6198e5d`, `snapshot.py --local --base `: `my-candidates` moves 115 of 3,683 spellings, every one a name holding `A/L` (69 names), `A/P` (3) or `ANAK` (43) whose family went from the father's last word to the particle and the father's whole name, the view filling; none read so before, all 115 after. `opensanctions-parliaments` moves 28 of 26,515: the 25 `my_parliament` names holding `a/l` (12), `a/p` (1) or `anak` (12), each the same move, and the three `ANAK AGUNG` names of Indonesia's lists gaining the `PARTICLE_OR_GIVEN` report, no field moved. The committed snapshot moves two corpus names, `Suresh a/l Muthu` and `Kavitha a/p Raman`, the same move. + - **`anak` is also a given name at the head.** Balinese names open with `Anak Agung` (ORCID's given boxes; Indonesia's DPR, DPD and 2018 regional heads in `opensanctions-parliaments`), and a never-given particle opening a name would take the whole name into the family (rules/P1). So `anak` keeps a `given` reading beside the patronymic one, as `binti` does: at the head it is left to position, given 'Anak' as before, and records `PARTICLE_OR_GIVEN`; mid-name it opens the family. `a/l` and `a/p` state `may_be_given = false`, no one bearing either as a name. Under the family-first orders every new word reads as `bin` reads (`Kumar a/l Rajan` under FAMILY_FIRST: given 'a/l Rajan', family 'Kumar'), and so does a trailing `Anak`, a surname in a few ORCID records (Ghana, Turkey): the default reads it as the family, a particle ending its field being a name word, while FAMILY_FIRST opens the family with it before the first word (`Jesse Kofi Anak`: given 'Kofi', family 'Anak Jesse', reported), as `Binti` there. One word before a family comma and `a/l` after it (`Kumar, a/l Rajan`) reads family 'Kumar a/l Rajan' and no given name, P1's fold for a never-given particle, as `Kumar, de Rajan` reads, where `bin` leaves given 'bin'; neither list writes that shape. + - **ACCEPTED: `Anak Agung` inside the name.** Mid-name `anak` opens the family wherever it stands, also where it begins the Balinese title `Anak Agung` behind a prefix (`I Gusti Anak Agung Made`: family 'Anak Agung Made', the view holding the title, no father) or behind given names a source composed before the family box (ORCID's 27 family boxes opening `Anak Agung` among 99 opening `Anak`, read given first: family 'Anak Agung Ayu' as filed, where it read middle 'Anak Agung', and the view the title), and in Brunei's `Pengiran Anak` rank. No list measured writes the prefixed Balinese shape; telling the title from the particle would need a two-word exception the vocabulary does not express (rules/R9's Accepted clause). + - **Case repair** writes the particles in lower case, as it writes `bin` (rules/R4): `KUMAR A/L RAJAN` repairs to 'Kumar a/l Rajan' where it gave 'Kumar A/L Rajan', the Dewan Rakyat's own list writing `a/l` and `anak` in lower case; `initials()` drops the particle, as it drops `bin` (`K. a. R.` to `K. R.`). + - **Measured 2026-11-19** on this change over master `a6198e5d`, `snapshot.py --local --base `: `my-candidates` moves 115 of its 3,077 distinct names (130 of 3,683 records), every one a name holding `A/L` (69 names), `A/P` (3) or `ANAK` (43) whose family went from the father's last word to the particle and the father's whole name, the view filling; none read so before, all 115 after. `opensanctions-parliaments` moves 28 of its 26,400 distinct names: the 25 `my_parliament` names holding `a/l` (12), `a/p` (1) or `anak` (12), each the same move, and the three `ANAK AGUNG` names of Indonesia's lists gaining the `PARTICLE_OR_GIVEN` report, no field moved. The committed snapshot moves two corpus names, `Suresh a/l Muthu` and `Kavitha a/p Raman`, the same move. diff --git a/docs/design/rules/R9-patronymic-view.md b/docs/design/rules/R9-patronymic-view.md index 21880562f..c18f777ac 100644 --- a/docs/design/rules/R9-patronymic-view.md +++ b/docs/design/rules/R9-patronymic-view.md @@ -82,6 +82,10 @@ "Karim Ould Haddou" → patronymic="Ould Haddou" "סאמר בן חליל" → patronymic="" ``` +- A patronymic particle that also opens a title of rank reads as the particle wherever it stands inside the name, so the view holds the title and the words after it: `anak` opens Balinese `Anak Agung`, which stands at the head of a name in nearly every list measured, where a word that may be given is left to position. + ``` + "I Gusti Anak Agung Made" → patronymic="Anak Agung Made" + ``` - The particle's run is every word after it in its field, so where the parse joined more than the parent's name the view holds it too, as the family does: a never-given particle opening the name takes the rest of it by default (P1). ``` "ibn Ali Hasan" → patronymic="ibn Ali Hasan" diff --git a/docs/migrate.rst b/docs/migrate.rst index 4a19a0d0d..c77a299c7 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -2165,14 +2165,17 @@ Malaysian a/l, a/p and anak the family name, the father's name, as ``bin`` does, where 1.4 through 3.1 left them in the middle name and cut a father's name of two words; the ``patronymic`` view holds the same words. ``anak`` opening a name, -as Balinese ``Anak Agung`` does, stays the given name and reports the -fork: +as Balinese ``Anak Agung`` does, is left to position, the given name by +default, and reports the fork. Case repair writes the particles in lower +case, as it writes ``bin``: .. doctest:: >>> malaysian = parse("KUMAR A/L RAJAN NAIDU") >>> malaysian.middle, malaysian.family, malaysian.patronymic ('', 'A/L RAJAN NAIDU', 'A/L RAJAN NAIDU') + >>> str(malaysian.capitalized()) + 'Kumar a/l Rajan Naidu' >>> parse("Rita Sari anak Jerome Insol").family 'anak Jerome Insol' >>> balinese = parse("Anak Agung Made Putra") diff --git a/docs/release_log.rst b/docs/release_log.rst index 3bee9b872..02efc8483 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -4,7 +4,7 @@ Release Log nameparser 3.2 is under development. - - **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 (Balinese ``Anak Agung``) stays the given name, reported. :issue:`1468` + - **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 (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` - **Fix MD inside a name written in capitals, which read as the degree and took the name behind it.** ``parse("SITI NORA MD YUSRI")`` gives middle ``NORA MD``, family ``YUSRI``, as 1.4.0 through 2.3.0 did, where 2.4.0 through 3.1.0 gave family ``NORA``, suffix ``MD YUSRI``; a name in lower case reads the same way, and both report ``suffix-or-name``, the degree being the other reading. The degree written before a family name in capitals reads so too (``JOHN SMITH MD JONES`` gives family ``JONES``, reported), where ``John Smith MD Jones`` and ``JOHN SMITH M.D. JONES`` keep it. :issue:`1394` diff --git a/nameparser/vocab/ms.toml b/nameparser/vocab/ms.toml index af4c6faa6..dae963183 100644 --- a/nameparser/vocab/ms.toml +++ b/nameparser/vocab/ms.toml @@ -23,7 +23,7 @@ issue = 1468 expands = "anak lelaki, son of: \"Kumar a/l Rajan\"" gender = "m" may_be_given = false -note = "Malaysian Indian names, read as 'bin' is. Written only with the slash, in capitals or lower case: Malaysia's election candidates write A/L 72 times in 3,077 names, OpenSanctions' my_parliament a/l 12 times, and neither writes it spaced (A / L) or with full stops (2026-11-19). One candidate writes A/K for anak, not listed" +note = "Malaysian Indian names, read as 'bin' is. Written only with the slash, in capitals or lower case: Malaysia's election candidates write A/L 72 times in 3,683 spellings (69 of 3,077 distinct names), OpenSanctions' my_parliament a/l 12 times, and neither writes it spaced (A / L) or with full stops (2026-11-19). One candidate writes A/K for anak, not listed" [[word]] text = "a/p" @@ -39,11 +39,11 @@ text = "anak" [word.given] wikidata = 1 as_of = 2026-11-19 -note = "#1468: Balinese names open with 'Anak Agung' (ORCID given boxes, Indonesia's DPR, DPD and 2018 regional heads), so the word at the head of a name stays the given name, by position, as a particle that may be given does (rules/P1); Wikidata is a lower bound; SSA under 5 a year; Nepal's local candidates 1 (Anak Alemagar)" +note = "#1468: Balinese names open with 'Anak Agung' (ORCID given boxes, Indonesia's DPR, DPD and 2018 regional heads), so the word at the head of a name is left to position, the given name by default, as a particle that may be given does (rules/P1); Wikidata is a lower bound; SSA under 5 a year; Nepal's local candidates 1, as a given name" [word.patronymic] issue = 1468 expands = "child of, Iban and Bidayuh names: \"Jerry anak Jimbun\"" -note = "Sarawak names, read as 'bin' is: ANAK 55 times among Malaysia's election candidates, anak 12 times in my_parliament, every one between the given name and the father's (2026-11-19). Also the Malay and Indonesian noun 'child'" +note = "Sarawak names, read as 'bin' is: ANAK 55 times (43 distinct names) among Malaysia's election candidates, anak 12 times in my_parliament, every one between the given name and the father's (2026-11-19). Also the Malay and Indonesian noun 'child'" [[word]] text = "bin" diff --git a/tests/v2/cases.py b/tests/v2/cases.py index dbcdb1531..0cdea91f0 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -9096,8 +9096,48 @@ def _check_cjk_shape_purity(self) -> None: "Jesse Kofi Anak", {"given": "Jesse", "middle": "Kofi", "family": "Anak"}, classification="parity", - notes="#1468's boundary: a particle ending its field is a family " - "name word (Anak is a Ghanaian surname)"), + notes="#1468's boundary: under the default order a particle " + "ending its field is a family name word"), + Case("anak_ending_the_name_family_first_opens_the_family_as_binti_does", + "Jesse Kofi Anak", + {"given": "Kofi", "family": "Anak Jesse"}, + policy=Policy(name_order=FAMILY_FIRST), + classification="fix(#1468)", + ambiguities=("particle-or-given",), + notes="accepted: a trailing particle under a family-first order " + "opens the family before the first word, as 'Binti' does " + "there. 3.1 read given 'Kofi', middle 'Anak', family " + "'Jesse'"), + Case("a_slashed_son_of_opening_the_name_folds_it_into_the_family", + "A/L Rajan", + {"family": "A/L Rajan"}, + classification="fix(#1468)", + notes="a/l is never a given name, so P1's fold takes the name, as " + "it takes 'ibn Ali'. 1.4.0 through 3.1 read given 'A/L', " + "family 'Rajan'"), + Case("a_slashed_son_of_opening_the_given_part_folds_it_into_the_family", + "Kumar, a/l Rajan", + {"family": "Kumar a/l Rajan"}, + classification="fix(#1468)", + notes="accepted, unwritten in the lists measured: P1's fold after a " + "family comma takes the rest of the part for a never-given " + "particle, as 'Kumar, de Rajan' reads, where 'bin', which may " + "be given, leaves given 'bin'. 1.4.0 through 3.1 read given " + "'a/l', middle 'Rajan', family 'Kumar'"), + Case("anak_opening_the_given_part_stays_the_given_name", + "Kumar, anak Jimbun", + {"given": "anak", "middle": "Jimbun", "family": "Kumar"}, + classification="parity", + notes="#1468's boundary: anak may be given, so after a family " + "comma it is left to position, as binti is"), + Case("anak_agung_behind_a_prefix_opens_the_family", + "I Gusti Anak Agung Made", + {"given": "I", "middle": "Gusti", "family": "Anak Agung Made"}, + classification="fix(#1468)", + notes="accepted (decisions/R9, #1468): mid-name anak opens the " + "family even where it begins the Balinese title Anak Agung, " + "and the patronymic view then holds the title. 1.4.0 " + "through 3.1 read middle 'Gusti Anak Agung', family 'Made'"), Case("a_credential_in_capitals_inside_the_chain_starts_the_run", "Mariam binti MD Salleh", {"given": "Mariam", "family": "binti", "suffix": "MD Salleh"}, diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index 9aa67722b..12428ef7a 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -495,9 +495,11 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # declares a policy: the decline's report on each moved row, and # its boundary rows' run reports; 2187 -> 2191 on 2026-11-19, # #1468's 'Anak Agung Made Putra' reporting particle-or-given under - # three orders and 'Jesse Kofi Anak' under FAMILY_FIRST. - assert claims == 2191, ( - f"the field sweep checks {claims} claims, recorded as 2191 on " + # three orders and 'Jesse Kofi Anak' under FAMILY_FIRST; 2191 -> 2192 + # the same day, its review's FAMILY_FIRST row of that name, once under + # its declared policy. + assert claims == 2192, ( + f"the field sweep checks {claims} claims, recorded as 2192 on " f"2026-11-19") @@ -975,8 +977,11 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None: # 477 -> 494 and 598 -> 603 the same day, #1394's rows under the # three orders, the declines' reports and the boundary rows' run # reports, three of them stand-in rereads; 603 -> 604 on 2026-11-19, - # #1468's anak rows - assert (checked, skipped) == (604, 494), (checked, skipped) + # #1468's 'Jesse Kofi 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) def test_every_case_name_is_unique() -> None: diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index 6efd8382b..1eb268ea3 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -486,6 +486,7 @@ "Hugo LAC" "Hugo Lac, MA" "Huntley R P" +"I Gusti Anak Agung Made" "II Van Johnson" "IVANOV Roman MBA" "IVOI, PAUL D'" diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index 24ed636df..48f6ef26c 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -1553,6 +1553,7 @@ {"name": "Håkon III.", "given": "Håkon", "suffix": "III.", "ambiguities": ["GIVEN_OR_FAMILY"], "alternatives": ["GIVEN_OR_FAMILY: name as family (position)"], "initials": "H.", "generation": "III."} {"name": "Héctor Quintana Suárez", "given": "Héctor", "middle": "Quintana", "family": "Suárez", "initials": "H. Q. S."} {"name": "Hülsen-Haeseler, Georg von", "given": "Georg", "family": "von Hülsen-Haeseler", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "G. H."} +{"name": "I Gusti Anak Agung Made", "given": "I", "middle": "Gusti", "family": "Anak Agung Made", "initials": "I. G. A. M.", "capitalized_force": "I Gusti anak Agung Made", "patronymic": "Anak Agung Made"} {"name": "I don", "given": "I", "family": "don", "initials": "I. d.", "capitalized_force": "I Don"} {"name": "II Van Johnson", "given": "II", "family": "Van Johnson", "initials": "I. J.", "capitalized_force": "Ii van Johnson"} {"name": "III van Gogh", "given": "III", "family": "van Gogh", "initials": "I. G.", "capitalized_force": "Iii van Gogh"} From 4e6deb942341436883b50af5e232f750cdaaaa95 Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Thu, 19 Nov 2026 10:26:38 -0800 Subject: [PATCH 3/3] Address the fix commit's review of #1468: scope anak's reading exactly The review of the first fix found the new R9 bullet saying anak reads as the particle anywhere inside the name, where the head of the given part after a family comma leaves it to position (Putra, Anak Agung Made), and the release log saying anak opening a name reports the fork, where one opening the family before a family comma does not (Anak Agung Ayu, Sari). Both are now stated by position, with examples. A row note said "a family-first order" where only FAMILY_FIRST opens the family; an example name was one word from a real record and is replaced; the initials example and the ORCID count now name their input and population. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/R9-patronymic-view.md | 8 ++++---- docs/design/rules/R9-patronymic-view.md | 4 +++- docs/migrate.rst | 6 +++--- docs/release_log.rst | 2 +- tests/v2/cases.py | 17 +++++++++-------- tests/v2/test_cases.py | 4 ++-- tools/differential/corpus_rules.jsonl | 2 ++ tools/differential/snapshot.jsonl | 2 ++ 8 files changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/design/decisions/R9-patronymic-view.md b/docs/design/decisions/R9-patronymic-view.md index 2f006f8ae..6f53532b2 100644 --- a/docs/design/decisions/R9-patronymic-view.md +++ b/docs/design/decisions/R9-patronymic-view.md @@ -5,7 +5,7 @@ - `ParsedName.patronymic` holds the words read as a patronymic, in whichever field the parse put them, which keep them; it is a view, not a role, so `family`, `middle`, `as_dict()`, `replace()`'s fields and the repr are unchanged, item 3 of decisions/vocabulary-model's 2026-10-28 #754 output-model entry — 2026-10-29 #754, sub-phase 4c. - A patronymic particle and the words after it in its field all read `patronymic`, the particle by vocabulary and the rest by position, so the view is the tokens whose reading is `patronymic` — 2026-10-29 #754, sub-phase 4c. - The East Slavic and Turkic rules write the reading wherever a policy turns them on, not only where their rotations fire: a middle word carrying the ending, and a marker with the name word before it — 2026-10-29 #754, sub-phase 4c. -- Malaysian `a/l` and `a/p` (anak lelaki, anak perempuan) and Sarawak's `anak` are patronymic particles in the default vocabulary (`ms.toml`), read as `bin` is; `a/l` and `a/p` are never given names, and `anak` holds a `given` reading beside its patronymic one, so a name it opens (Balinese `Anak Agung`) is left to position and reports the fork — 2026-11-19 #1468. +- Malaysian `a/l` and `a/p` (anak lelaki, anak perempuan) and Sarawak's `anak` are patronymic particles in the default vocabulary (`ms.toml`), read as `bin` is; `a/l` and `a/p` are never given names, and `anak` holds a `given` reading beside its patronymic one, so a name it opens with no comma (Balinese `Anak Agung`) is left to position and reports the fork — 2026-11-19 #1468. Elsewhere: why the view leaves `family` and `middle` as they are, and the fielded-corpora measurements behind it, decisions/vocabulary-model's 2026-10-28 #754 entry, item 3; the rotations the two ending rules are named for, decisions/O1 and decisions/O2; the `clan`/`patronymic` line in the particle kinds, decisions/vocabulary-model's 2026-10-19 #749 entry; a father's name nothing in the text marks, which fills no view, and a view that overlaps the family, decisions/family-without-an-inherited-name. @@ -28,7 +28,7 @@ Open: the Icelandic ending rule, which an `is` pack would turn on (the RFC's wor - 2026-11-19 #1468 — `a/l`, `a/p` AND `anak` ARE PATRONYMIC PARTICLES, READ AS `bin` IS. Malaysian Indian names write `a/l` (anak lelaki, son of) or `a/p` (anak perempuan, daughter of) between the bearer's name and the father's, and Iban and Bidayuh names write `anak` (child of); the default read all three as name words, so a father's name of two words was cut (`KUMAR A/L RAJAN NAIDU` read middle 'A/L RAJAN', family 'NAIDU'). Each is now a `patronymic` reading in `ms.toml`, so the family opens at it and the patronymic view holds the father's name (family 'A/L RAJAN NAIDU', patronymic the same), as `bin` gives (rules/R9's examples). - **The kind test** (rules/R9's Accepted clause): the words after each are the bearer's father's name, not a family name passed down. Of the 118 distinct phrases after the three words in `my-candidates`' and `my_parliament`'s raw records together, upper-cased (each phrase the words after the particle, its bearers the words before it), 109 follow one bearer; the 9 that follow two or more are one member written two ways, brothers, or a common Tamil given name (`KRISHNAN`, `MUNIANDY`, `SUBRAMANIAM`) (2026-11-19; counted as written, 130 phrases, 122 with one bearer). - **The spellings**: only the slashed ones, in capitals or lower case, are written: `A/L` 72 and `A/P` 3 in `my-candidates`' 3,683 spellings, `a/l` 12 and `a/p` 1 in OpenSanctions' `my_parliament`; neither writes `A / L` spaced, `AL` or `AP` for the particle, or a full stop (2026-11-19). A slashed word listed whole is one token and one word (the slash parts only standing alone, decisions/C10), so the readings need no new shape; `A/L.` with a final full stop reads as `a/l` by the fold, unmeasured. - - **`anak` is also a given name at the head.** Balinese names open with `Anak Agung` (ORCID's given boxes; Indonesia's DPR, DPD and 2018 regional heads in `opensanctions-parliaments`), and a never-given particle opening a name would take the whole name into the family (rules/P1). So `anak` keeps a `given` reading beside the patronymic one, as `binti` does: at the head it is left to position, given 'Anak' as before, and records `PARTICLE_OR_GIVEN`; mid-name it opens the family. `a/l` and `a/p` state `may_be_given = false`, no one bearing either as a name. Under the family-first orders every new word reads as `bin` reads (`Kumar a/l Rajan` under FAMILY_FIRST: given 'a/l Rajan', family 'Kumar'), and so does a trailing `Anak`, a surname in a few ORCID records (Ghana, Turkey): the default reads it as the family, a particle ending its field being a name word, while FAMILY_FIRST opens the family with it before the first word (`Jesse Kofi Anak`: given 'Kofi', family 'Anak Jesse', reported), as `Binti` there. One word before a family comma and `a/l` after it (`Kumar, a/l Rajan`) reads family 'Kumar a/l Rajan' and no given name, P1's fold for a never-given particle, as `Kumar, de Rajan` reads, where `bin` leaves given 'bin'; neither list writes that shape. - - **ACCEPTED: `Anak Agung` inside the name.** Mid-name `anak` opens the family wherever it stands, also where it begins the Balinese title `Anak Agung` behind a prefix (`I Gusti Anak Agung Made`: family 'Anak Agung Made', the view holding the title, no father) or behind given names a source composed before the family box (ORCID's 27 family boxes opening `Anak Agung` among 99 opening `Anak`, read given first: family 'Anak Agung Ayu' as filed, where it read middle 'Anak Agung', and the view the title), and in Brunei's `Pengiran Anak` rank. No list measured writes the prefixed Balinese shape; telling the title from the particle would need a two-word exception the vocabulary does not express (rules/R9's Accepted clause). - - **Case repair** writes the particles in lower case, as it writes `bin` (rules/R4): `KUMAR A/L RAJAN` repairs to 'Kumar a/l Rajan' where it gave 'Kumar A/L Rajan', the Dewan Rakyat's own list writing `a/l` and `anak` in lower case; `initials()` drops the particle, as it drops `bin` (`K. a. R.` to `K. R.`). + - **`anak` is also a given name at the head.** Balinese names open with `Anak Agung` (ORCID's given boxes; Indonesia's DPR, DPD and 2018 regional heads in `opensanctions-parliaments`), and a never-given particle opening a name would take the whole name into the family (rules/P1). So `anak` keeps a `given` reading beside the patronymic one, as `binti` does: at the head it is left to position, given 'Anak' as before, and records `PARTICLE_OR_GIVEN`; mid-name it opens the family. `a/l` and `a/p` state `may_be_given = false`, no one bearing either as a name. Under the family-first orders every new word reads as `bin` reads (`Kumar a/l Rajan` under FAMILY_FIRST: given 'a/l Rajan', family 'Kumar'), and so does a trailing `Anak`, the family box of a few ORCID records (Ghana, Turkey, Syria, Belgium): the default reads it as the family, a particle ending its field being a name word, while FAMILY_FIRST opens the family with it before the first word (`Kwame Mensah Anak`: given 'Mensah', family 'Anak Kwame', reported), as `Binti` there, and FAMILY_FIRST_GIVEN_LAST reads it as the given name, as it reads `Binti`. One word before a family comma and `a/l` after it (`Kumar, a/l Rajan`) reads family 'Kumar a/l Rajan' and no given name, P1's fold for a never-given particle, as `Kumar, de Rajan` reads, where `bin` leaves given 'bin'; neither list writes that shape. + - **ACCEPTED: `Anak Agung` inside the name.** Mid-name `anak` opens the family wherever it stands, also where it begins the Balinese title `Anak Agung` behind a prefix (`I Gusti Anak Agung Made`: family 'Anak Agung Made', the view holding the title, no father) or opening the family before a family comma (`Anak Agung Ayu, Sari`: family 'Anak Agung Ayu', no report, the view the title), or behind given names a source composed before the family box (the 2025-10 ORCID dump's 27 family boxes opening `Anak Agung` among 99 opening `Anak`, over all 24.99M records, counted by the family box's first word case-folded; read given first: family 'Anak Agung Ayu' as filed, where it read middle 'Anak Agung', and the view the title), and in Brunei's `Pengiran Anak` rank. No list measured writes the prefixed Balinese shape; telling the title from the particle would need a two-word exception the vocabulary does not express (rules/R9's Accepted clause). + - **Case repair** writes the particles in lower case, as it writes `bin` (rules/R4): `KUMAR A/L RAJAN` repairs to 'Kumar a/l Rajan' where it gave 'Kumar A/L Rajan', the Dewan Rakyat's own list writing `a/l` and `anak` in lower case; `initials()` drops the particle, as it drops `bin` (`Kumar a/l Rajan`: `K. a. R.` to `K. R.`). - **Measured 2026-11-19** on this change over master `a6198e5d`, `snapshot.py --local --base `: `my-candidates` moves 115 of its 3,077 distinct names (130 of 3,683 records), every one a name holding `A/L` (69 names), `A/P` (3) or `ANAK` (43) whose family went from the father's last word to the particle and the father's whole name, the view filling; none read so before, all 115 after. `opensanctions-parliaments` moves 28 of its 26,400 distinct names: the 25 `my_parliament` names holding `a/l` (12), `a/p` (1) or `anak` (12), each the same move, and the three `ANAK AGUNG` names of Indonesia's lists gaining the `PARTICLE_OR_GIVEN` report, no field moved. The committed snapshot moves two corpus names, `Suresh a/l Muthu` and `Kavitha a/p Raman`, the same move. diff --git a/docs/design/rules/R9-patronymic-view.md b/docs/design/rules/R9-patronymic-view.md index c18f777ac..02a03ef0b 100644 --- a/docs/design/rules/R9-patronymic-view.md +++ b/docs/design/rules/R9-patronymic-view.md @@ -82,9 +82,11 @@ "Karim Ould Haddou" → patronymic="Ould Haddou" "סאמר בן חליל" → patronymic="" ``` -- A patronymic particle that also opens a title of rank reads as the particle wherever it stands inside the name, so the view holds the title and the words after it: `anak` opens Balinese `Anak Agung`, which stands at the head of a name in nearly every list measured, where a word that may be given is left to position. +- A patronymic particle that also opens a title of rank reads as the particle where a name word stands before it in its part, and where it opens the family before a family comma, so the view holds the title and the words after it: `anak` opens Balinese `Anak Agung`, which stands at the head of a name in nearly every list measured, where a word that may be given is left to position, as it is at the head of the given part after a family comma. ``` "I Gusti Anak Agung Made" → patronymic="Anak Agung Made" + "Anak Agung Ayu, Sari" → patronymic="Anak Agung Ayu" + "Putra, Anak Agung Made" → patronymic="" ``` - The particle's run is every word after it in its field, so where the parse joined more than the parent's name the view holds it too, as the family does: a never-given particle opening the name takes the rest of it by default (P1). ``` diff --git a/docs/migrate.rst b/docs/migrate.rst index c77a299c7..f79e6f561 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -2164,9 +2164,9 @@ Malaysian a/l, a/p and anak ``a/l`` (son of), ``a/p`` (daughter of) and ``anak`` (child of) start the family name, the father's name, as ``bin`` does, where 1.4 through 3.1 left them in the middle name and cut a father's name of two words; -the ``patronymic`` view holds the same words. ``anak`` opening a name, -as Balinese ``Anak Agung`` does, is left to position, the given name by -default, and reports the fork. Case repair writes the particles in lower +the ``patronymic`` view holds the same words. ``anak`` opening a name +written without a comma, as Balinese ``Anak Agung`` does, is left to +position, the given name by default, and reports the fork. Case repair writes the particles in lower case, as it writes ``bin``: .. doctest:: diff --git a/docs/release_log.rst b/docs/release_log.rst index 02efc8483..b53d35e63 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -4,7 +4,7 @@ Release Log nameparser 3.2 is under development. - - **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 (Balinese ``Anak Agung``) is left to position, the given name by default, and reported. :issue:`1468` + - **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` - **Fix MD inside a name written in capitals, which read as the degree and took the name behind it.** ``parse("SITI NORA MD YUSRI")`` gives middle ``NORA MD``, family ``YUSRI``, as 1.4.0 through 2.3.0 did, where 2.4.0 through 3.1.0 gave family ``NORA``, suffix ``MD YUSRI``; a name in lower case reads the same way, and both report ``suffix-or-name``, the degree being the other reading. The degree written before a family name in capitals reads so too (``JOHN SMITH MD JONES`` gives family ``JONES``, reported), where ``John Smith MD Jones`` and ``JOHN SMITH M.D. JONES`` keep it. :issue:`1394` diff --git a/tests/v2/cases.py b/tests/v2/cases.py index 0cdea91f0..b29673d7f 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -9093,21 +9093,22 @@ def _check_cjk_shape_purity(self) -> None: "patronymic one, so at the head it is left to position as " "binti is, and the fork is reported"), Case("anak_ending_the_name_stays_the_family", - "Jesse Kofi Anak", - {"given": "Jesse", "middle": "Kofi", "family": "Anak"}, + "Kwame Mensah Anak", + {"given": "Kwame", "middle": "Mensah", "family": "Anak"}, classification="parity", notes="#1468's boundary: under the default order a particle " "ending its field is a family name word"), Case("anak_ending_the_name_family_first_opens_the_family_as_binti_does", - "Jesse Kofi Anak", - {"given": "Kofi", "family": "Anak Jesse"}, + "Kwame Mensah Anak", + {"given": "Mensah", "family": "Anak Kwame"}, policy=Policy(name_order=FAMILY_FIRST), classification="fix(#1468)", ambiguities=("particle-or-given",), - notes="accepted: a trailing particle under a family-first order " - "opens the family before the first word, as 'Binti' does " - "there. 3.1 read given 'Kofi', middle 'Anak', family " - "'Jesse'"), + notes="accepted: a trailing particle under FAMILY_FIRST opens the " + "family before the first word, as 'Binti' does there " + "(FAMILY_FIRST_GIVEN_LAST reads it as the given name, as " + "it reads 'Binti'). 3.1 read given 'Mensah', middle " + "'Anak', family 'Kwame'"), Case("a_slashed_son_of_opening_the_name_folds_it_into_the_family", "A/L Rajan", {"family": "A/L Rajan"}, diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index 12428ef7a..04e694ab3 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -495,7 +495,7 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # declares a policy: the decline's report on each moved row, and # its boundary rows' run reports; 2187 -> 2191 on 2026-11-19, # #1468's 'Anak Agung Made Putra' reporting particle-or-given under - # three orders and 'Jesse Kofi Anak' under FAMILY_FIRST; 2191 -> 2192 + # three orders and 'Kwame Mensah Anak' under FAMILY_FIRST; 2191 -> 2192 # the same day, its review's FAMILY_FIRST row of that name, once under # its declared policy. assert claims == 2192, ( @@ -977,7 +977,7 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None: # 477 -> 494 and 598 -> 603 the same day, #1394's rows under the # three orders, the declines' reports and the boundary rows' run # reports, three of them stand-in rereads; 603 -> 604 on 2026-11-19, - # #1468's 'Jesse Kofi Anak' under FAMILY_FIRST, a `name` stand-in; + # #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 diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index 1eb268ea3..bb5cd2400 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -151,6 +151,7 @@ "Ana abdul Rahman López" "Ana de María Pérez" "Ana de Miguel de la Vega" +"Anak Agung Ayu, Sari" "Anak Agung Made Putra" "Andrew" "Andrew (Andy) Perkins" @@ -1441,6 +1442,7 @@ "Prof. Smith, Dr. John" "Prof. Smith, John, PhD" "Puig i V, Joan" +"Putra, Anak Agung Made" "Pérez José Luis" "Pérez Luis José" "Pérez de la Vega" diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index 48f6ef26c..2b4e55aba 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -305,6 +305,7 @@ {"name": "Ana abdul Rahman López", "given": "Ana", "middle": "abdul Rahman", "family": "López", "initials": "A. a. R. L.", "capitalized_force": "Ana Abdul Rahman López"} {"name": "Ana de María Pérez", "given": "Ana", "middle": "de María", "family": "Pérez", "initials": "A. M. P."} {"name": "Ana de Miguel de la Vega", "given": "Ana", "middle": "de Miguel", "family": "de la Vega", "initials": "A. M. V."} +{"name": "Anak Agung Ayu, Sari", "given": "Sari", "family": "Anak Agung Ayu", "initials": "S. A. A.", "capitalized_force": "Sari anak Agung Ayu", "patronymic": "Anak Agung Ayu"} {"name": "Anak Agung Made Putra", "given": "Anak", "middle": "Agung Made", "family": "Putra", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: patronymic as family (vocabulary)"], "initials": "A. A. M. P."} {"name": "Anan ben David", "given": "Anan", "middle": "ben", "family": "David", "initials": "A. b. D.", "capitalized_force": "Anan Ben David"} {"name": "Andersen Irene", "order": "FAMILY_FIRST", "given": "Irene", "family": "Andersen", "initials": "I. A."} @@ -3644,6 +3645,7 @@ {"name": "Prof. Ɖr. MƉ fan ƉAM ƉOMIŊGO Fostɛɛŋ Samʊwɛl", "order": "FAMILY_FIRST", "title": "Prof. Ɖr.", "given": "fan", "middle": "ƉAM ƉOMIŊGO Fostɛɛŋ Samʊwɛl", "family": "MƉ", "initials": "f. Ɖ. Ɖ. F. S. M.", "capitalized_force": "Prof. Ɖr. Mɖ Fan Ɖam Ɖomiŋgo Fostɛɛŋ Samʊwɛl"} {"name": "Prop. Dr. Ada Cornelia César Martín von Brühl González Domingo MD DDS", "title": "Prop. Dr.", "given": "Ada", "middle": "Cornelia César Martín", "family": "von Brühl González Domingo", "suffix": "MD DDS", "initials": "A. C. C. M. B. G. D."} {"name": "Puig i V, Joan", "given": "Joan", "family": "Puig i V", "initials": "J. P. V."} +{"name": "Putra, Anak Agung Made", "given": "Anak", "middle": "Agung Made", "family": "Putra", "initials": "A. A. M. P."} {"name": "Pèrs, Ciro di", "given": "Ciro", "family": "di Pèrs", "ambiguities": ["PARTICLE_OR_GIVEN", "SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (vocabulary)", "PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "C. P."} {"name": "Pérez José Luis", "given": "Pérez", "middle": "José", "family": "Luis", "initials": "P. J. L."} {"name": "Pérez Lucía", "order": "FAMILY_FIRST", "given": "Lucía", "family": "Pérez", "initials": "L. P."}