Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/design/decisions/R9-patronymic-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.

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

Expand All @@ -24,3 +25,10 @@ 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`'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`, 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 <corpus> --base <master checkout>`: `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.
2 changes: 1 addition & 1 deletion docs/design/decisions/family-without-an-inherited-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 11 additions & 1 deletion docs/design/rules/R9-patronymic-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
```
Expand Down Expand Up @@ -73,11 +77,17 @@
**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=""
```
- 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).
```
"ibn Ali Hasan" → patronymic="ibn Ali Hasan"
Expand Down
26 changes: 25 additions & 1 deletion docs/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2157,3 +2157,27 @@ 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
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::

>>> 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")
>>> balinese.given, [str(report.kind) for report in balinese.ambiguities]
('Anak', ['particle-or-given'])
Loading