From 80032ea3e6c554945f61ad4d2c3c3093bfd34188 Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Thu, 19 Nov 2026 20:07:15 -0800 Subject: [PATCH 1/3] Read Qari, Moulana, Alhaj and Alhajj opening a name as titles (#1469) Qari, Moulana, Alhaj and Alhajj, the religious titles written before a name in Pakistan and Bangladesh, are titles by default in ar.toml: every name counted that opens with one is the title. Hafiz, Hafez, Haji and the spelling Maulana are left out, borne as given names in Pakistan, Indonesia, Tanzania, Iran and Egypt; their title reading wants a choice of Urdu or Bengali that no pack makes. Syed, Mian, Chaudhry and Makhdoom stay name words. decisions/indic-honorifics' 2026-11-19 #1469 entry holds the counts and the measured moves. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/indic-honorifics.md | 12 ++++- docs/migrate.rst | 28 +++++++++++- docs/release_log.rst | 1 + nameparser/config/_compiled.py | 7 +++ nameparser/config/_index.py | 4 ++ nameparser/vocab/ar.toml | 16 +++++++ tests/v2/cases.py | 56 +++++++++++++++++++++++ 7 files changed, 121 insertions(+), 3 deletions(-) diff --git a/docs/design/decisions/indic-honorifics.md b/docs/design/decisions/indic-honorifics.md index f0a513a68..b575adb76 100644 --- a/docs/design/decisions/indic-honorifics.md +++ b/docs/design/decisions/indic-honorifics.md @@ -14,7 +14,8 @@ Closes #346, #344 and #343 as one bundle: each CLASS is decided once, and each s - Latin `mst` is a credential and no title, as `md` is: a leading `Mst` is the given name its filers type it as (`Mrs Mst Nasima Akther` → title 'Mrs', given 'Mst'), at the cost `md` carried until 2026-11-14, the given part of a family comma it opens reading as a credential (`Begum, Mst Amina` → suffix 'Mst Amina'), `mst` holding no given reading for rules/C13's given-name Except to read; after a name it is the degree (`Mary Smith, Mst` → suffix 'Mst'); `Mst.` with its period opening a name is a title by rules/H2's shape (`Mst. Nasima Akther` → title 'Mst.'), but opening the given part of a family comma it is a credential like the bare form (`Akther, Mst. Nasima` → suffix 'Mst. Nasima') — 2026-11-06 (Derek), #1130. - An abbreviation carrying a mark is spelled with it, and the Bengali ones ship as the visarga form and the bare stem while the Devanagari ones ship as the bare stem alone, the dotted form listed in neither script — 2026-09-06 #346. - Title vocabulary beats the one-letter-plus-period initial shape, measured and pinned by rows and not a rule: `ড. মুহাম্মদ ইউনূস` reads title 'ড.' while `র. কে. নারায়ণ`, with no entry behind it, keeps its initials — 2026-09-06 #346. -- An unlisted abugida honorific stays a name word, and rules/H2's executable example of it is `প্রকৌশলী. Sen`, so whoever ships প্রকৌশলী moves the example first; the Tier 4 candidates in the Indic scripts (transliterated military ranks, Advocate, Engineer, Marhum, the kinship forms, मां/माता/মা, the hafiz/syed/shahid forms) are skipped pending a corpus check and not declined — 2026-09-06 #346. +- An unlisted abugida honorific stays a name word, and rules/H2's executable example of it is `প্রকৌশলী. Sen`, so whoever ships প্রকৌশলী moves the example first; the Tier 4 candidates in the Indic scripts (transliterated military ranks, Advocate, Engineer, Marhum, the kinship forms, मां/माता/মা, the hafiz/syed/shahid forms) are skipped pending a corpus check and not declined — 2026-09-06 #346 (the hafiz and syed forms counted since, 2026-11-19 #1469, below). +- `qari`, `moulana`, `alhaj` and `alhajj` are titles by default, each opening a name as the title wherever one was counted (`Qari Ahmed Khan` → title 'Qari', given 'Ahmed'); `hafiz`, `hafez`, `haji` and the spelling `maulana`, borne as given names, stay name words by default, their title reading wanting a choice of Urdu or Bengali that no pack makes; `syed`, `mian`, `chaudhry` and `makhdoom` are name words — 2026-11-19 #1469. - Latin `md` is a credential and no title: a leading `Md` is the given name it abbreviates (`Md Abdul Karim` → given 'Md', middle 'Abdul'; `Mr Md Karim Uddin` → title 'Mr', given 'Md', middle 'Karim'), at the accepted cost of a particle behind it starting the family (`Md Abu Sayed` → family 'Abu Sayed'), and the Bengali মোঃ/মো entries stay titles — 2026-10-23 #853. - `md` is Muhammad written short as well as the medical degree, so the period-marked `Md.` opening a name is the given name (`Md. Karim Uddin` → given 'Md.', middle 'Karim'; `Mr Md. Karim Uddin` → title 'Mr', given 'Md.'), and `Md` opening the given part after a family comma is the given name where rules/C13's given-name Except reads it so (`Uddin, Md Karim` and `Uddin, Mr Md Karim` → given 'Md', middle 'Karim'; `Rahman, Md.` → given 'Md.'), the degree elsewhere (`RAHMAN, MD`, `Smith, Md PhD`, `Uddin, Mr Md` → suffix), the conditions stated in that rule and decisions/C13's Standing line — 2026-11-14 #1383. - The romanized `pandit`, `sardar`, `kumari`, `babu`, `acharya` and `begum` are titles under no pack and no strict choice, each opening far more names as a given name or a surname than as the title (`Kumari Selja`, `Sardar Ahmad`, `Babu Joseph`), and each is an `excluded` entry carrying its counts — 2026-11-03 (Derek), #345. @@ -23,7 +24,7 @@ Closes #346, #344 and #343 as one bundle: each CLASS is decided once, and each s Elsewhere: the bundle's class-level refusals are recorded under decisions/vocabulary-exclusions, not here: the Latin forms of the Indic titles belonging to the opt-in packs of #345 (2026-09-06, #344), the native spelling shipping alone where a transliteration collides with real names (sri/shri, sant, pandit), the ban on the spaced trailing set becoming glued honorifics, and the per-word title refusals (ঠাকুর/ठाकुर, कुमारी/কুমারী, बेगम/বেগম, শেখ/शेख, आचार्य, राजा/रानी), each an `excluded` entry (`uv run python tools/vocab/query.py --excluded title`). -Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and Jetsun fold like `Lama Zopa`). +Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and Jetsun fold like `Lama Zopa`); #1469 (whether a choice of Urdu or Bengali reads `hafiz`, `hafez`, `haji` and `maulana` as titles; no pack is built). ## Log @@ -65,4 +66,11 @@ Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and J - Measured, 2026-11-14, on this branch against master 3dadc263, whose parse #1390 did not change, over every local corpus's `corpus.jsonl` (the entries holding the word `md` after a comma, `,[^,]*\bmd\b`, case-insensitive, each corpus's distinct texts): 149,226 names, 19 move (re-taken after the second review's changes, 2026-11-14: the same 149,226 and 19; with the committed corpora, which this change's rule examples and case rows join, 149,359 and 27 after the third review), 5 of them #1383's leading `Md.` (ctgov) and 14 the comma's: fec-individuals 9 (`UDDIN, MD KARIM` shapes, given 'MD'), psc-individuals 3 (the forename box holding `Md` behind a title typed in the surname box), orcid-researchers 2 (`Uddin, Md. Karim`, `Hossain, Md`), and 13 of the 14 read right. The writing behind the design: after one word and a comma, `X, MD` in capitals alone is the degree in ClinicalTrials.gov (107, `Novak, MD`, `BERGER, MD`), while FEC's 10 (a Bangladeshi surname alone, then `MD`) are likely Muhammad, which no writing tells apart; `X, Md` written with a lower-case letter was the given name in all 3 found (ORCID 1, PSC 2). Recompute: each entry of a `corpus.jsonl` under `~/.cache/nameparser-tools/local/` matching `^\s*([^\s,]+),\s*(md\.?)(?:\s+(\S.*))?\s*$`, case-insensitive, grouped by the word's case, a word after it or none, and the head in capitals or not; the moves by parsing every entry matching the first pattern in both checkouts and comparing the seven name fields. - Accepted: `MD` in capitals alone after a family comma stays the degree (`RAHMAN, MD` → suffix 'MD'), so `Md. Rahman` / `RAHMAN, MD` does not match; the degree written before a given name reads as Muhammad written short, the writing being the same (`SMITH, MD JANE` → given 'MD', 1 of FEC's 9 movers); a name in one case writes no case that tells (`rahman, md` → suffix 'md'); and `mst`, which holds no given reading, keeps the cost the 2026-11-06 #1130 entry recorded (`Begum, Mst Amina` → suffix 'Mst Amina'). A full spelling of Muhammad written with a full stop is still a title by rules/H2's shape (`Mohammed. Rahman` → title 'Mohammed.'): 10 of the 22,986 ORCID names opening with one of the five long spellings write it so, and no other local corpus does (2026-11-14: in orcid-researchers' `corpus.jsonl`, `grep -ciE '^"(muhammad|mohammad|mohammed|mohamed|mohamad)\. '` gives 10 and the same pattern with a space for the stop, `'^"(…) '`, 22,986; the second review's own count, by another recipe, gave 23,028). - Left to their own issues: #1394 (a stop gluing `MD.` to the next word ends a Malay name in a suffix, `SITI AMINAH MD.NOOR` → suffix 'MD. NOOR') and #1178 (`Ab` and `Md.` at the head of a name, the wider question this entry answers for `Md.` alone). +- 2026-11-19 #1469 — QARI, MOULANA, ALHAJ AND ALHAJJ ARE TITLES; HAFIZ, HAFEZ, HAJI AND MAULANA ARE LEFT OUT, WANTING A CHOICE; SYED, MIAN, CHAUDHRY AND MAKHDOOM STAY NAME WORDS. Decided on 2026-11-19, each word by its counts, as rules/H9's batches are: the religious honorifics written before a name in Pakistan and Bangladesh, which 1.4.0 through 3.1.0 read as the given name (`mufti` and `hajji` were titles already, in ar.toml). It takes up the 2026-09-06 bundle's hafiz and syed forms, "skipped pending a corpus check"; `shahid` is not counted here. + - THE COUNTS, as borne names. ORCID's 2025 extract (24,990,909 people; `tools/name_usage.py --boxes --country PK --country BD --country IN --country MY --country ID`), given box / family box: `hafiz` 2,300 / 371 (given: Pakistan 600, Malaysia 192, Indonesia 71, Bangladesh 29); `hafez` 245 / 564 (given: Iran 30, Egypt 28; family: Egypt 169); `haji` 232 / 1,178 (given: Iraq 20, Pakistan 15, Tanzania 13, Malaysia 10; family: Iran 156, Iraq 72, Brunei 50); `maulana` 971 / 1,231 (Indonesia 531 / 504, an Indonesian given name and surname); `qari` 9 / 43 (given: Pakistan 4); `moulana` 6 / 16; `alhaj` 17 / 269 (given: Sudan 5; the family box a surname written last); `alhajj` 5 / 47; `syed` 9,229 / 2,725 (given: Pakistan 1,810, India 907); `mian` 753 / 319 (given: China 130, Pakistan 103); `chaudhry` 81 / 814; `makhdoom` 16 / 57. US SSA given-name births: `syed` 6,043, `hafiz` 136, `mian` 110, `haji` 105, `hafez` 11, `qari` 10, the rest under 5 a year. + - THE NAMES OPENING WITH THE WORD, read by hand in the local corpora: `maulana`'s 18 in orcid-researchers are all given names (16 Indonesian), and JRC-Names' 69 the Pakistani cleric's title; `haji`'s 29 in orcid-researchers are mostly given names (Tanzania 12, Ethiopia 3, Azerbaijan 2), psc-individuals' 34 mostly the title, and my-candidates' 26 and opensanctions-parliaments' 7 (`pk_na_members` 3, `in_sansad` 4) the title; `qari` (orcid-researchers 1, psc-individuals 5, JRC-Names 53), `moulana` (`pk_na_members` 2, psc-individuals 3, JRC-Names 1) and `alhaj` (orcid-researchers 1, psc-individuals 2, JRC-Names 1) are the title in every one; no name opens with `alhajj`. Read as a title by default, `hafiz` would move 630 names in the local corpora, 266 in orcid-researchers and 237 in psc-individuals, nearly all filed in the forename box. + - BOX AGREEMENT DOES NOT DECIDE A TITLE: filers type the honorific in the forename box, so a title reading scores as a miss (`tools/differential/config_diff.py score default 'expr:Parser(lexicon=Lexicon.default().add("qari", kind="religious"))' --group PK --group BD --group MY --group ID --group TZ --group EG --group Pakistani --group Bangladeshi --group Malaysian --group Indonesian`, one spec per word, cap 20,000). Each word read as a default title kept or lowered every group: `qari`, `moulana` and `alhaj` by at most 0.01 points; `maulana` ORCID ID 89.36 → 89.29; `haji` ORCID TZ 94.13 → 94.02; `hafiz` ORCID PK 93.59 → 92.94 and PSC Pakistani 94.27 → 93.35. So the four titles are decided on the lists that write a name as its bearer is addressed, and the four left out on the names their bearers file. + - LEFT OUT, NOT EXCLUDED: `hafiz`, `hafez`, `haji` and `maulana` are the title in Pakistani, Bangladeshi, Indian and Malaysian lists and a given name in Pakistan, Indonesia, Tanzania, Iran and Egypt, so their title reading is right in its language and wrong as a default. An `excluded` entry says a reading is wrong in every language (nameparser/vocab/README.md, Exclusions), so none is written; a `default = false` reading in ur.toml or bn.toml needs a pack to turn it on, and none is built (Open, above). `haji` under `locales.MS` belongs with #1180's Malay honorifics. `maulana` read only inside a title phrase (rules/H9) was weighed and not taken: no listed phrase holds it, so the reading would change no parse. + - THE NAME WORDS: `syed`, `mian`, `chaudhry` and `makhdoom` open far more names as a given name or a surname than as an honorific, and the boxes agree with today's reading, so no reading is written for them. + - MEASURED (`tools/differential/measure.py --base `, master `34771e2d`): the committed snapshot, CLDR and GND agreement and every local corpus but four read as master did. JRC-Names moved 55 names (`qari` 53, `alhaj` 1, `moulana` 1), opensanctions-parliaments 2 (`moulana`, both `pk_na_members`), orcid-researchers 7 and psc-individuals 10 (`qari` 5, `moulana` 3, `alhaj` 2): in every one the word left the given name for the title and the next word became the given name, save two of orcid-researchers' that open with `Lama`, an Arabic given name that is also a listed title (rules/H1's renunciate class): `Lama Alhaj Husein`, which master read title 'Lama', given 'Alhaj', family 'Husein', now reads title 'Lama Alhaj', family 'Husein', and `Lama Alhajj` keeps title 'Lama', given 'Alhajj' and now reports `title-or-name`, its one name word being title vocabulary. Neither reading is the filer's; the cost is `lama`'s, which master paid already. Scored against the filers' boxes, psc-individuals loses 10 records, each a forename box holding the honorific behind `Mr` in the title box, and orcid-researchers moves 3; JRC-Names reads 8 persons' spellings apart that master read alike, the spellings with the title against those without it. my-candidates, FEC and ClinicalTrials.gov move nothing. diff --git a/docs/migrate.rst b/docs/migrate.rst index 2384c9001..7436347cc 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -909,7 +909,8 @@ 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``, Malaysian ``a/l``, ``a/p`` and ``anak`` + - Dutch ``Oude``, Malaysian ``a/l``, ``a/p`` and ``anak``, + religious titles before a name - :ref:`migrate-3-2` Each entry says what it compares with. The lists of readings through @@ -2323,3 +2324,28 @@ apart. In a name of three words ``Abdul`` still stays apart: >>> haddad = parse("Haddad, Nadia Abd Karim") >>> haddad.middle, haddad.suffix ('Abd Karim', '') + +Religious titles before a name +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``Qari``, ``Moulana``, ``Alhaj`` and ``Alhajj``, written before a name +in Pakistan and Bangladesh, are titles, where 1.4 through 3.1 read them +as the given name. ``Hafiz``, ``Hafez``, ``Haji`` and the spelling +``Maulana`` are still read as given names, since many people bear them +as names: + +.. doctest:: + + >>> qari = parse("Qari Ahmed Khan") + >>> qari.title, qari.given, qari.family + ('Qari', 'Ahmed', 'Khan') + >>> parse("Hafiz Ahmed Khan").given + 'Hafiz' + +To read one of the four as a name, remove its reading: + +.. doctest:: + + >>> as_31 = Parser(lexicon=Lexicon.default().remove("qari", kind="religious")) + >>> as_31.parse("Qari Ahmed Khan").given + 'Qari' diff --git a/docs/release_log.rst b/docs/release_log.rst index 399fa6b15..fe0018afe 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -4,6 +4,7 @@ Release Log nameparser 3.2 is under development. + - **Add Qari, Moulana, Alhaj and Alhajj as titles, the religious titles written before a name in Pakistan and Bangladesh.** ``parse("Qari Ahmed Khan")`` gives title ``Qari``, given ``Ahmed``, where 1.4.0 through 3.1.0 gave given ``Qari``, middle ``Ahmed``. ``Hafiz``, ``Hafez``, ``Haji`` and the spelling ``Maulana``, often borne as given names, still read as the given name. :issue:`1469` - **Fix Abdel, Abd and Abou past the first word of a name, which read as a middle name of their own.** ``parse("Tariq Abdel Aziz")`` gives family ``Abdel Aziz``, where 1.4.0 through 3.1.0 gave middle ``Abdel``, family ``Aziz``. ``Abdul`` joins only in a name of four words or more, titles and suffixes not counted, so ``Tariq Abdul Aziz`` keeps middle ``Abdul``; and after a family comma ``Abd`` before a name word is no longer the credential ABD. :issue:`1464` - **Add locales.MS, a Malay pack, which reads Malaysian titles written before a name: Puan, Cik, Ustaz, Ustazah and Cikgu.** ``parser_for(locales.MS).parse("Puan Siti binti Ahmad")`` gives title ``Puan``, given ``Siti``, family ``binti Ahmad``, where the default, as 1.4.0 through 3.1.0, gives given ``Puan``; ``Tuan`` stays a name word, being a hereditary prefix and a Vietnamese given name, and the pack reads the Indonesian given name ``Puan`` as the title too (``Puan Maharani``): keep it to Malaysian names. See :ref:`malay-names`. :issue:`1179` - **Change Parser.suggest() to read where a Russian-style patronymic stands as a vote on the order, and add Signal.PATRONYMIC_POSITION, the signal that casts it.** ``Parser().suggest(["Sidorov Ivan Petrovich", "Volkov Pavel Sergeevich", "Orlova Anna Ivanovna", "Zaitsev Oleg Nikolaevich", "Belova Vera Andreevna"]).patch`` gives ``PolicyPatch(name_order=FAMILY_FIRST, patronymic_rules=...)``, where 3.1.0 gave the rule with the given-first order, which misread any name of two words in such a list (``Sidorov Ivan`` gave family ``Ivan``); a patronymic in the middle votes given-first. :issue:`1447` diff --git a/nameparser/config/_compiled.py b/nameparser/config/_compiled.py index 0f01d63fc..0b84739a2 100644 --- a/nameparser/config/_compiled.py +++ b/nameparser/config/_compiled.py @@ -327,6 +327,8 @@ 'air', 'akhoond', 'alderman', + 'alhaj', + 'alhajj', 'almoner', 'ambassador', 'amn', @@ -797,6 +799,7 @@ 'monsignor', 'most', 'mother', + 'moulana', 'mountaineer', 'mpco-cg', 'mr', @@ -928,6 +931,7 @@ 'pursuivant', 'pv2', 'pvt', + 'qari', "queen's", 'ra', 'rabbi', @@ -1731,6 +1735,8 @@ }) TITLE_STYLES: frozenset[str] = frozenset({ + 'alhaj', + 'alhajj', 'ch.ma', 'ch.mo', 'cheikh', @@ -4743,6 +4749,7 @@ '2ndlt': ('2lt',), 'adm': ('admiral',), 'adv': ('advocate',), + 'alhajj': ('alhaj',), 'assist': ('assistant',), 'assoc': ('associate',), 'asst': ('assistant',), diff --git a/nameparser/config/_index.py b/nameparser/config/_index.py index c9c7155b8..c466e82cc 100644 --- a/nameparser/config/_index.py +++ b/nameparser/config/_index.py @@ -128,6 +128,8 @@ ('alexandrina', (('bg', 'spelling', (('spelling_of', ('aleksandrina',)),)),)), ('alexei', (('ru', 'spelling', (('spelling_of', ('aleksei', 'aleksey')),)),)), ('alexey', (('ru', 'spelling', (('spelling_of', ('aleksei', 'aleksey', 'alexei')),)),)), + ('alhaj', (('ar', 'style', ()),)), + ('alhajj', (('ar', 'style', (('same_as', 'alhaj'),)),)), ('ali', (('en', 'familiar', (('short_for', ('alexandra', 'aliakbar', 'alireza', 'alison', 'allison', 'seyedali')),)), ('fa', 'familiar', (('short_for', ('alireza',)),)), ('mul', 'familiar', (('short_for', ('abdolali', 'mohammadali')),)))), ('alkis', (('el', 'familiar', (('short_for', ('alkiviadis',)),)),)), ('alli', (('en', 'familiar', (('short_for', ('allison',)),)),)), @@ -1951,6 +1953,7 @@ ('most', (('en', 'modifier', ()),)), ('mot', (('en', 'credential', ()), ('en', 'family', ()))), ('mother', (('en', 'religious', (('addresses', 'given'),)),)), + ('moulana', (('ar', 'religious', ()),)), ('mountaineer', (('en', 'occupation', ()),)), ('mozhdeh', (('fa', 'spelling', (('spelling_of', ('mojdeh',)),)),)), ('mozhgan', (('fa', 'spelling', (('spelling_of', ('mojgan',)),)),)), @@ -2315,6 +2318,7 @@ ('pvt', (('en', 'military', (('same_as', 'private'),)),)), ('père', (('fr', 'generation', (('title_case_is_name', True),)), ('fr', 'family', ()))), ('qam', (('en', 'credential', ()),)), + ('qari', (('ar', 'religious', ()),)), ('qc', (('en', 'credential', ()),)), ('qcsw', (('en', 'credential', ()),)), ('qfsm', (('en', 'credential', ()),)), diff --git a/nameparser/vocab/ar.toml b/nameparser/vocab/ar.toml index 8fee72628..821a0722a 100644 --- a/nameparser/vocab/ar.toml +++ b/nameparser/vocab/ar.toml @@ -1,5 +1,13 @@ schema = 1 +[[word]] +text = "alhaj" +style = { issue = 1469, decided = 2026-11-19, expands = "al-hajj, one who has made the Hajj, written before the name in Pakistan and Bangladesh", note = "opening a name it was the title wherever counted (ORCID 1, UK PSC 2, JRC-Names 1); ORCID's 2025 extract holds it in 17 given boxes (Sudan 5) and 269 family boxes, a surname written last, which a leading title does not reach (2026-11-19)" } + +[[word]] +text = "alhajj" +style = { same_as = "alhaj", issue = 1469, decided = 2026-11-19, expands = "al-hajj, the spelling Bangladesh's parliament writes", note = "ORCID's 2025 extract holds it in 5 given boxes and 47 family boxes; no corpus name opens with it (2026-11-19)" } + [[word]] text = "hajji" style = { expands = "one who has made the Hajj" } @@ -135,6 +143,10 @@ religious = { issue = 867, decided = 2026-10-26, note = "a messianic title, writ given = { us_ssa = 2398, wikidata = 141, as_of = 2026-10-26, note = "US SSA: male births; Wikidata is a lower bound (Iran 43, Iraq 9); nam_dict band 5 in Arabia/Persia" } family = { us_census_2010 = 1241, wikidata = 13, as_of = 2026-10-26 } +[[word]] +text = "moulana" +religious = { issue = 1469, decided = 2026-11-19, expands = "mawlana, a cleric, the spelling of Pakistani and Bangladeshi lists", note = "opening a name it was the title wherever counted (Pakistan's National Assembly 2, UK PSC 3, JRC-Names 1); ORCID's 2025 extract holds it in 6 given boxes and 16 family boxes (2026-11-19). The spelling maulana is left out, an Indonesian given name and surname (decisions/indic-honorifics, 2026-11-19 #1469)" } + [[word]] text = "mufti" religious = {} @@ -143,6 +155,10 @@ religious = {} text = "murshid" religious = { expands = "a Sufi guide" } +[[word]] +text = "qari" +religious = { issue = 1469, decided = 2026-11-19, expands = "a reciter of the Quran", note = "opening a name it was the title wherever counted (ORCID 1, UK PSC 5, JRC-Names 53); ORCID's 2025 extract holds it in 9 given boxes (Pakistan 4) and 43 family boxes, a surname written last (Saudi Arabia 10); US SSA 10 births (2026-11-19)" } + [[word]] text = "الحاج" religious = { addresses = "given", gender = "m", issue = 269, expands = "the hajji, one who has made the hajj" } diff --git a/tests/v2/cases.py b/tests/v2/cases.py index d93720a50..e03562e33 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -1155,6 +1155,62 @@ def _check_cjk_shape_purity(self) -> None: notes="tuan is no title under the pack (decisions/salutation-" "titles, the 2026-11-19 #1179 entry); 3.1.0 reads it " "so; 1.4.0 read middle 'Aminah binti Tuan', family 'Yusof'"), + # #1469: the religious honorifics written before a name in Pakistan + # and Bangladesh. Qari, Moulana, Alhaj and Alhajj are titles by + # default; Hafiz, Maulana and Haji, borne as given names, and Syed + # stay name words (decisions/indic-honorifics, 2026-11-19 #1469). + Case("qari_opening_a_name_is_the_title", + "Qari Ahmed Khan", + {"title": "Qari", "given": "Ahmed", "family": "Khan"}, + classification="feat(#1469)", + notes="1.4.0 through 3.1.0 read given 'Qari', middle 'Ahmed'"), + Case("moulana_opening_a_name_is_the_title", + "Moulana Fazal Karim", + {"title": "Moulana", "given": "Fazal", "family": "Karim"}, + classification="feat(#1469)", + notes="1.4.0 through 3.1.0 read given 'Moulana', middle 'Fazal'"), + Case("alhaj_in_capitals_opening_a_name_is_the_title", + "ALHAJ AHMED KARIM", + {"title": "ALHAJ", "given": "AHMED", "family": "KARIM"}, + classification="feat(#1469)", + notes="1.4.0 through 3.1.0 read given 'ALHAJ', middle 'AHMED'"), + Case("alhajj_opening_a_name_is_the_title", + "Alhajj Rafiq Uddin", + {"title": "Alhajj", "given": "Rafiq", "family": "Uddin"}, + classification="feat(#1469)", + notes="1.4.0 through 3.1.0 read given 'Alhajj', middle 'Rafiq'"), + Case("qari_opening_the_given_part_after_a_family_comma_is_the_title", + "Khan, Qari Ahmed", + {"title": "Qari", "given": "Ahmed", "family": "Khan"}, + classification="feat(#1469)", + notes="1.4.0 through 3.1.0 read given 'Qari', middle 'Ahmed'"), + Case("qari_behind_a_salutation_joins_the_title", + "Mr Qari Ahmed Khan", + {"title": "Mr Qari", "given": "Ahmed", "family": "Khan"}, + classification="feat(#1469)", + notes="1.4.0 through 3.1.0 read title 'Mr', given 'Qari'"), + Case("qari_ending_a_name_is_a_name_word", + "Ahmed Khan Qari", + {"given": "Ahmed", "middle": "Khan", "family": "Qari"}, + notes="a bare title ending a name is a name word (rules/H5); " + "Qari is a surname written last"), + Case("hafiz_opening_a_name_stays_the_given_name", + "Hafiz Ahmed Khan", + {"given": "Hafiz", "middle": "Ahmed", "family": "Khan"}, + notes="borne as a given name, so no title by default (#1469)"), + Case("maulana_opening_a_name_stays_the_given_name", + "Maulana Imran Latif", + {"given": "Maulana", "middle": "Imran", "family": "Latif"}, + notes="an Indonesian given name too, so no title by default " + "(#1469); the spelling Moulana is one"), + Case("haji_opening_a_name_stays_the_given_name", + "Haji Rafiq Uddin", + {"given": "Haji", "middle": "Rafiq", "family": "Uddin"}, + notes="borne as a given name, so no title by default (#1469)"), + Case("syed_opening_a_name_stays_the_given_name", + "Syed Imran Latif", + {"given": "Syed", "middle": "Imran", "family": "Latif"}, + notes="the given name its bearers file it as (#1469)"), # #1231: the Burmese pack. Burmese names have no family name, so the # last word lands in family by position. Each row's notes checked # against the 1.4.0, 2.0.0, 2.4.0, 2.8.2 and 3.1.0 wheels on From e677c72a5cad6d2619b1ca89b233e2a389c43df2 Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Thu, 19 Nov 2026 20:45:54 -0800 Subject: [PATCH 2/3] Address review of #1469: locales.BN, the moves' readings, the alhaj byline, rows locales.BN already turns on bn.toml's default = false readings, so the entry no longer says no pack could carry Hafiz, Hafez, Haji and Maulana; it says which choice would and that neither is written here. The measured moves now say the 15 two-word names read the remaining word as the family, one ORCID Alhaj opener is a byline writing the family name first, maulana as a phrase-only title would move a style-led name, and a strict choice drops ar.toml as it does for mufti. Corpus names in the entry are replaced by invented shapes. New rows: a one-word name and a full name before a comma, the given part's last word, a title behind a kept Hafiz, and Hafez. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/indic-honorifics.md | 13 ++++++----- nameparser/vocab/ar.toml | 2 +- tests/v2/cases.py | 27 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/design/decisions/indic-honorifics.md b/docs/design/decisions/indic-honorifics.md index b575adb76..a02f58bfd 100644 --- a/docs/design/decisions/indic-honorifics.md +++ b/docs/design/decisions/indic-honorifics.md @@ -15,7 +15,7 @@ Closes #346, #344 and #343 as one bundle: each CLASS is decided once, and each s - An abbreviation carrying a mark is spelled with it, and the Bengali ones ship as the visarga form and the bare stem while the Devanagari ones ship as the bare stem alone, the dotted form listed in neither script — 2026-09-06 #346. - Title vocabulary beats the one-letter-plus-period initial shape, measured and pinned by rows and not a rule: `ড. মুহাম্মদ ইউনূস` reads title 'ড.' while `র. কে. নারায়ণ`, with no entry behind it, keeps its initials — 2026-09-06 #346. - An unlisted abugida honorific stays a name word, and rules/H2's executable example of it is `প্রকৌশলী. Sen`, so whoever ships প্রকৌশলী moves the example first; the Tier 4 candidates in the Indic scripts (transliterated military ranks, Advocate, Engineer, Marhum, the kinship forms, मां/माता/মা, the hafiz/syed/shahid forms) are skipped pending a corpus check and not declined — 2026-09-06 #346 (the hafiz and syed forms counted since, 2026-11-19 #1469, below). -- `qari`, `moulana`, `alhaj` and `alhajj` are titles by default, each opening a name as the title wherever one was counted (`Qari Ahmed Khan` → title 'Qari', given 'Ahmed'); `hafiz`, `hafez`, `haji` and the spelling `maulana`, borne as given names, stay name words by default, their title reading wanting a choice of Urdu or Bengali that no pack makes; `syed`, `mian`, `chaudhry` and `makhdoom` are name words — 2026-11-19 #1469. +- `qari`, `moulana`, `alhaj` and `alhajj` are titles by default, each opening a name as the title wherever one was counted (`Qari Ahmed Khan` → title 'Qari', given 'Ahmed'); `hafiz`, `hafez`, `haji` and the spelling `maulana`, borne as given names, stay name words by default, their title reading wanting a choice of Bengali (`locales.BN` could turn on a `default = false` reading in bn.toml) or of Urdu, which this entry writes for neither; `syed`, `mian`, `chaudhry` and `makhdoom` are name words — 2026-11-19 #1469. - Latin `md` is a credential and no title: a leading `Md` is the given name it abbreviates (`Md Abdul Karim` → given 'Md', middle 'Abdul'; `Mr Md Karim Uddin` → title 'Mr', given 'Md', middle 'Karim'), at the accepted cost of a particle behind it starting the family (`Md Abu Sayed` → family 'Abu Sayed'), and the Bengali মোঃ/মো entries stay titles — 2026-10-23 #853. - `md` is Muhammad written short as well as the medical degree, so the period-marked `Md.` opening a name is the given name (`Md. Karim Uddin` → given 'Md.', middle 'Karim'; `Mr Md. Karim Uddin` → title 'Mr', given 'Md.'), and `Md` opening the given part after a family comma is the given name where rules/C13's given-name Except reads it so (`Uddin, Md Karim` and `Uddin, Mr Md Karim` → given 'Md', middle 'Karim'; `Rahman, Md.` → given 'Md.'), the degree elsewhere (`RAHMAN, MD`, `Smith, Md PhD`, `Uddin, Mr Md` → suffix), the conditions stated in that rule and decisions/C13's Standing line — 2026-11-14 #1383. - The romanized `pandit`, `sardar`, `kumari`, `babu`, `acharya` and `begum` are titles under no pack and no strict choice, each opening far more names as a given name or a surname than as the title (`Kumari Selja`, `Sardar Ahmad`, `Babu Joseph`), and each is an `excluded` entry carrying its counts — 2026-11-03 (Derek), #345. @@ -24,7 +24,7 @@ Closes #346, #344 and #343 as one bundle: each CLASS is decided once, and each s Elsewhere: the bundle's class-level refusals are recorded under decisions/vocabulary-exclusions, not here: the Latin forms of the Indic titles belonging to the opt-in packs of #345 (2026-09-06, #344), the native spelling shipping alone where a transliteration collides with real names (sri/shri, sant, pandit), the ban on the spaced trailing set becoming glued honorifics, and the per-word title refusals (ঠাকুর/ठाकुर, कुमारी/কুমারী, बेगम/বেগম, শেখ/शेख, आचार्य, राजा/रानी), each an `excluded` entry (`uv run python tools/vocab/query.py --excluded title`). -Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and Jetsun fold like `Lama Zopa`); #1469 (whether a choice of Urdu or Bengali reads `hafiz`, `hafez`, `haji` and `maulana` as titles; no pack is built). +Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and Jetsun fold like `Lama Zopa`); #1469 (whether a choice of Bengali or Urdu reads `hafiz`, `hafez`, `haji` and `maulana` as titles; no reading is written for either). ## Log @@ -68,9 +68,10 @@ Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and J - Left to their own issues: #1394 (a stop gluing `MD.` to the next word ends a Malay name in a suffix, `SITI AMINAH MD.NOOR` → suffix 'MD. NOOR') and #1178 (`Ab` and `Md.` at the head of a name, the wider question this entry answers for `Md.` alone). - 2026-11-19 #1469 — QARI, MOULANA, ALHAJ AND ALHAJJ ARE TITLES; HAFIZ, HAFEZ, HAJI AND MAULANA ARE LEFT OUT, WANTING A CHOICE; SYED, MIAN, CHAUDHRY AND MAKHDOOM STAY NAME WORDS. Decided on 2026-11-19, each word by its counts, as rules/H9's batches are: the religious honorifics written before a name in Pakistan and Bangladesh, which 1.4.0 through 3.1.0 read as the given name (`mufti` and `hajji` were titles already, in ar.toml). It takes up the 2026-09-06 bundle's hafiz and syed forms, "skipped pending a corpus check"; `shahid` is not counted here. - THE COUNTS, as borne names. ORCID's 2025 extract (24,990,909 people; `tools/name_usage.py --boxes --country PK --country BD --country IN --country MY --country ID`), given box / family box: `hafiz` 2,300 / 371 (given: Pakistan 600, Malaysia 192, Indonesia 71, Bangladesh 29); `hafez` 245 / 564 (given: Iran 30, Egypt 28; family: Egypt 169); `haji` 232 / 1,178 (given: Iraq 20, Pakistan 15, Tanzania 13, Malaysia 10; family: Iran 156, Iraq 72, Brunei 50); `maulana` 971 / 1,231 (Indonesia 531 / 504, an Indonesian given name and surname); `qari` 9 / 43 (given: Pakistan 4); `moulana` 6 / 16; `alhaj` 17 / 269 (given: Sudan 5; the family box a surname written last); `alhajj` 5 / 47; `syed` 9,229 / 2,725 (given: Pakistan 1,810, India 907); `mian` 753 / 319 (given: China 130, Pakistan 103); `chaudhry` 81 / 814; `makhdoom` 16 / 57. US SSA given-name births: `syed` 6,043, `hafiz` 136, `mian` 110, `haji` 105, `hafez` 11, `qari` 10, the rest under 5 a year. - - THE NAMES OPENING WITH THE WORD, read by hand in the local corpora: `maulana`'s 18 in orcid-researchers are all given names (16 Indonesian), and JRC-Names' 69 the Pakistani cleric's title; `haji`'s 29 in orcid-researchers are mostly given names (Tanzania 12, Ethiopia 3, Azerbaijan 2), psc-individuals' 34 mostly the title, and my-candidates' 26 and opensanctions-parliaments' 7 (`pk_na_members` 3, `in_sansad` 4) the title; `qari` (orcid-researchers 1, psc-individuals 5, JRC-Names 53), `moulana` (`pk_na_members` 2, psc-individuals 3, JRC-Names 1) and `alhaj` (orcid-researchers 1, psc-individuals 2, JRC-Names 1) are the title in every one; no name opens with `alhajj`. Read as a title by default, `hafiz` would move 630 names in the local corpora, 266 in orcid-researchers and 237 in psc-individuals, nearly all filed in the forename box. - - BOX AGREEMENT DOES NOT DECIDE A TITLE: filers type the honorific in the forename box, so a title reading scores as a miss (`tools/differential/config_diff.py score default 'expr:Parser(lexicon=Lexicon.default().add("qari", kind="religious"))' --group PK --group BD --group MY --group ID --group TZ --group EG --group Pakistani --group Bangladeshi --group Malaysian --group Indonesian`, one spec per word, cap 20,000). Each word read as a default title kept or lowered every group: `qari`, `moulana` and `alhaj` by at most 0.01 points; `maulana` ORCID ID 89.36 → 89.29; `haji` ORCID TZ 94.13 → 94.02; `hafiz` ORCID PK 93.59 → 92.94 and PSC Pakistani 94.27 → 93.35. So the four titles are decided on the lists that write a name as its bearer is addressed, and the four left out on the names their bearers file. - - LEFT OUT, NOT EXCLUDED: `hafiz`, `hafez`, `haji` and `maulana` are the title in Pakistani, Bangladeshi, Indian and Malaysian lists and a given name in Pakistan, Indonesia, Tanzania, Iran and Egypt, so their title reading is right in its language and wrong as a default. An `excluded` entry says a reading is wrong in every language (nameparser/vocab/README.md, Exclusions), so none is written; a `default = false` reading in ur.toml or bn.toml needs a pack to turn it on, and none is built (Open, above). `haji` under `locales.MS` belongs with #1180's Malay honorifics. `maulana` read only inside a title phrase (rules/H9) was weighed and not taken: no listed phrase holds it, so the reading would change no parse. + - THE NAMES OPENING WITH THE WORD, read by hand in the local corpora: `maulana`'s 18 in orcid-researchers are all given names (16 Indonesian), and JRC-Names' 69 the Pakistani cleric's title; `haji`'s 29 in orcid-researchers are mostly given names (Tanzania 12, Ethiopia 3, Azerbaijan 2), psc-individuals' 34 mostly the title, and my-candidates' 26 and opensanctions-parliaments' 7 (`pk_na_members` 3, `in_sansad` 4) the title; `qari` (orcid-researchers 1, psc-individuals 5, JRC-Names 53), `moulana` (`pk_na_members` 2, psc-individuals 3, JRC-Names 1) and `alhaj` (psc-individuals 2, JRC-Names 1, orcid-researchers 1 of 2) are the title in every one but one: an orcid-researchers byline writing its family name `Alhaj` first and its given name as initials, which master read given 'Alhaj' and this change title 'Alhaj', both missing the filer's boxes; no name opens with `alhajj`. Read as a title by default, `hafiz` would move 630 names in the local corpora, 266 in orcid-researchers and 237 in psc-individuals, nearly all filed in the forename box. + - BOX AGREEMENT DOES NOT DECIDE A TITLE: filers type the honorific in the forename box, so a title reading scores as a miss (`tools/differential/config_diff.py score default 'expr:Parser(lexicon=Lexicon.default().add("qari", kind="religious"))' --group PK --group BD --group MY --group ID --group TZ --group EG --group Pakistani --group Bangladeshi --group Malaysian --group Indonesian --cap 20000`, one spec per word). Each word read as a default title kept or lowered every group: `qari`, `moulana` and `alhaj` by at most 0.01 points; `maulana` ORCID ID 89.36 → 89.29; `haji` ORCID TZ 94.13 → 94.02; `hafiz` ORCID PK 93.59 → 92.94 and PSC Pakistani 94.27 → 93.35. So the four titles are decided on the lists that write a name as its bearer is addressed, and the four left out on the names their bearers file. + - LEFT OUT, NOT EXCLUDED: `hafiz`, `hafez`, `haji` and `maulana` are the title in Pakistani, Bangladeshi, Indian and Malaysian lists and a given name in Pakistan, Indonesia, Tanzania, Iran and Egypt, so their title reading is right in its language and wrong as a default. An `excluded` entry says a reading is wrong in every language (nameparser/vocab/README.md, Exclusions), so none is written; the reading they want is `default = false`, turned on by a choice of the language: in bn.toml, which `locales.BN` would turn on, or in ur.toml, which a caller's own choice of `ur` turns on, Urdu having no pack. Neither is written here; the Bangladeshi and Pakistani lists that would weigh it are counted above, and the question stays open (Open, above). `haji` under `locales.MS` belongs with #1180's Malay honorifics. `maulana` read only inside a title phrase (rules/H9) was weighed and not taken: no listed phrase holds it, so it would move only a name a style opens (`Her Excellency Maulana Ahmad Ali` → title 'Her Excellency Maulana', given 'Ahmad'), and neither the Indonesian given names nor the cleric's title opening a name. + - UNDER A STRICT CHOICE (`parser_for(locales.BN, strict=True)`, and HI's and MS's) the four read as the given name again, ar.toml not being chosen, as `mufti` and `hajji` already do. - THE NAME WORDS: `syed`, `mian`, `chaudhry` and `makhdoom` open far more names as a given name or a surname than as an honorific, and the boxes agree with today's reading, so no reading is written for them. - - MEASURED (`tools/differential/measure.py --base `, master `34771e2d`): the committed snapshot, CLDR and GND agreement and every local corpus but four read as master did. JRC-Names moved 55 names (`qari` 53, `alhaj` 1, `moulana` 1), opensanctions-parliaments 2 (`moulana`, both `pk_na_members`), orcid-researchers 7 and psc-individuals 10 (`qari` 5, `moulana` 3, `alhaj` 2): in every one the word left the given name for the title and the next word became the given name, save two of orcid-researchers' that open with `Lama`, an Arabic given name that is also a listed title (rules/H1's renunciate class): `Lama Alhaj Husein`, which master read title 'Lama', given 'Alhaj', family 'Husein', now reads title 'Lama Alhaj', family 'Husein', and `Lama Alhajj` keeps title 'Lama', given 'Alhajj' and now reports `title-or-name`, its one name word being title vocabulary. Neither reading is the filer's; the cost is `lama`'s, which master paid already. Scored against the filers' boxes, psc-individuals loses 10 records, each a forename box holding the honorific behind `Mr` in the title box, and orcid-researchers moves 3; JRC-Names reads 8 persons' spellings apart that master read alike, the spellings with the title against those without it. my-candidates, FEC and ClinicalTrials.gov move nothing. + - MEASURED (`tools/differential/measure.py --base `, master `34771e2d`): the committed snapshot, CLDR and GND agreement and every local corpus but four read as master did. JRC-Names moved 55 names (`qari` 53, `alhaj` 1, `moulana` 1), opensanctions-parliaments 2 (`moulana`, both `pk_na_members`), orcid-researchers 7 and psc-individuals 10 (`qari` 5, `moulana` 3, `alhaj` 2): in every one the word left the given name for the title, the words after it reading as a name without it (in the 15 two-word names, the one word left the family, rules/H1: `Qari Khan` → title 'Qari', family 'Khan'), save the byline above and two of orcid-researchers' that open with `Lama`, an Arabic given name that is also a listed title (rules/H1's renunciate class): one written `Lama Alhaj` and a surname, which master read title 'Lama', given 'Alhaj', now reads title 'Lama Alhaj' and the surname as the family, and one written `Lama Alhajj` alone keeps title 'Lama', given 'Alhajj' and now reports `title-or-name`, its one name word being title vocabulary. Neither reading is the filer's; the cost is `lama`'s, which master paid already. Scored against the filers' boxes, psc-individuals loses 10 records, each a forename box holding the honorific (behind `Mr` in the title box in nine), and orcid-researchers moves 3; JRC-Names reads 8 persons' spellings apart that master read alike, the spellings with the title against those without it. my-candidates, FEC and ClinicalTrials.gov move nothing. diff --git a/nameparser/vocab/ar.toml b/nameparser/vocab/ar.toml index 821a0722a..e3ebd5e5d 100644 --- a/nameparser/vocab/ar.toml +++ b/nameparser/vocab/ar.toml @@ -2,7 +2,7 @@ schema = 1 [[word]] text = "alhaj" -style = { issue = 1469, decided = 2026-11-19, expands = "al-hajj, one who has made the Hajj, written before the name in Pakistan and Bangladesh", note = "opening a name it was the title wherever counted (ORCID 1, UK PSC 2, JRC-Names 1); ORCID's 2025 extract holds it in 17 given boxes (Sudan 5) and 269 family boxes, a surname written last, which a leading title does not reach (2026-11-19)" } +style = { issue = 1469, decided = 2026-11-19, expands = "al-hajj, one who has made the Hajj, written before the name in Pakistan and Bangladesh", note = "opening a name it was the title wherever counted (UK PSC 2, JRC-Names 1, ORCID 1), save an ORCID byline writing the family name Alhaj first; ORCID's 2025 extract holds it in 17 given boxes (Sudan 5) and 269 family boxes, a surname written last, which a leading title does not reach (2026-11-19)" } [[word]] text = "alhajj" diff --git a/tests/v2/cases.py b/tests/v2/cases.py index e03562e33..038e019a2 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -1189,6 +1189,29 @@ def _check_cjk_shape_purity(self) -> None: {"title": "Mr Qari", "given": "Ahmed", "family": "Khan"}, classification="feat(#1469)", notes="1.4.0 through 3.1.0 read title 'Mr', given 'Qari'"), + Case("qari_alone_after_a_one_word_name_and_a_comma_is_the_title", + "Khan, Qari", + {"title": "Qari", "family": "Khan"}, + classification="feat(#1469)", + notes="an accepted cost: a person given the name Qari keeps no " + "given name, as a title and one name word read (rules/H1); " + "1.4.0 through 3.1.0 read given 'Qari'"), + Case("qari_after_a_full_name_and_a_comma_is_the_title", + "Ahmed Khan, Qari", + {"title": "Qari", "given": "Ahmed", "family": "Khan"}, + classification="feat(#1469)", + notes="as `Ahmed Khan, Mufti` reads; 1.4.0 through 3.1.0 read " + "given 'Qari', family 'Ahmed Khan'"), + Case("qari_ending_the_given_part_after_a_family_comma_is_a_middle_name", + "Khan, Ahmed Qari", + {"given": "Ahmed", "middle": "Qari", "family": "Khan"}, + notes="rules/H8 reads only a salutation there, and Qari is a " + "religious title"), + Case("qari_behind_hafiz_kept_a_given_name_is_a_middle_name", + "Hafiz Qari Ahmed Khan", + {"given": "Hafiz", "middle": "Qari Ahmed", "family": "Khan"}, + notes="Hafiz stays the given name (#1469), and a title behind " + "a name word opens no title run"), Case("qari_ending_a_name_is_a_name_word", "Ahmed Khan Qari", {"given": "Ahmed", "middle": "Khan", "family": "Qari"}, @@ -1198,6 +1221,10 @@ def _check_cjk_shape_purity(self) -> None: "Hafiz Ahmed Khan", {"given": "Hafiz", "middle": "Ahmed", "family": "Khan"}, notes="borne as a given name, so no title by default (#1469)"), + Case("hafez_opening_a_name_stays_the_given_name", + "Hafez Ahmed Karim", + {"given": "Hafez", "middle": "Ahmed", "family": "Karim"}, + notes="borne as a given name, so no title by default (#1469)"), Case("maulana_opening_a_name_stays_the_given_name", "Maulana Imran Latif", {"given": "Maulana", "middle": "Imran", "family": "Latif"}, From 31a9dd706b3700b3b582657c1b6b1ee64c504609 Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Thu, 19 Nov 2026 20:50:06 -0800 Subject: [PATCH 3/3] Address the fix review of #1469: the Standing line, the count, invented row names The Standing line now carries the surname-first byline the Log records; the names left with one name word are counted as measured (14: 12 of two words, 2 behind Mr); and the entry and the case rows no longer quote a corpus record or a name part that is one. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/indic-honorifics.md | 4 ++-- tests/v2/cases.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/design/decisions/indic-honorifics.md b/docs/design/decisions/indic-honorifics.md index a02f58bfd..c6d4b2a93 100644 --- a/docs/design/decisions/indic-honorifics.md +++ b/docs/design/decisions/indic-honorifics.md @@ -15,7 +15,7 @@ Closes #346, #344 and #343 as one bundle: each CLASS is decided once, and each s - An abbreviation carrying a mark is spelled with it, and the Bengali ones ship as the visarga form and the bare stem while the Devanagari ones ship as the bare stem alone, the dotted form listed in neither script — 2026-09-06 #346. - Title vocabulary beats the one-letter-plus-period initial shape, measured and pinned by rows and not a rule: `ড. মুহাম্মদ ইউনূস` reads title 'ড.' while `র. কে. নারায়ণ`, with no entry behind it, keeps its initials — 2026-09-06 #346. - An unlisted abugida honorific stays a name word, and rules/H2's executable example of it is `প্রকৌশলী. Sen`, so whoever ships প্রকৌশলী moves the example first; the Tier 4 candidates in the Indic scripts (transliterated military ranks, Advocate, Engineer, Marhum, the kinship forms, मां/माता/মা, the hafiz/syed/shahid forms) are skipped pending a corpus check and not declined — 2026-09-06 #346 (the hafiz and syed forms counted since, 2026-11-19 #1469, below). -- `qari`, `moulana`, `alhaj` and `alhajj` are titles by default, each opening a name as the title wherever one was counted (`Qari Ahmed Khan` → title 'Qari', given 'Ahmed'); `hafiz`, `hafez`, `haji` and the spelling `maulana`, borne as given names, stay name words by default, their title reading wanting a choice of Bengali (`locales.BN` could turn on a `default = false` reading in bn.toml) or of Urdu, which this entry writes for neither; `syed`, `mian`, `chaudhry` and `makhdoom` are name words — 2026-11-19 #1469. +- `qari`, `moulana`, `alhaj` and `alhajj` are titles by default, each opening a name as the title in every name counted but one surname-first byline (`Qari Ahmed Khan` → title 'Qari', given 'Ahmed'); `hafiz`, `hafez`, `haji` and the spelling `maulana`, borne as given names, stay name words by default, their title reading wanting a choice of Bengali (`locales.BN` could turn on a `default = false` reading in bn.toml) or of Urdu, which this entry writes for neither; `syed`, `mian`, `chaudhry` and `makhdoom` are name words — 2026-11-19 #1469. - Latin `md` is a credential and no title: a leading `Md` is the given name it abbreviates (`Md Abdul Karim` → given 'Md', middle 'Abdul'; `Mr Md Karim Uddin` → title 'Mr', given 'Md', middle 'Karim'), at the accepted cost of a particle behind it starting the family (`Md Abu Sayed` → family 'Abu Sayed'), and the Bengali মোঃ/মো entries stay titles — 2026-10-23 #853. - `md` is Muhammad written short as well as the medical degree, so the period-marked `Md.` opening a name is the given name (`Md. Karim Uddin` → given 'Md.', middle 'Karim'; `Mr Md. Karim Uddin` → title 'Mr', given 'Md.'), and `Md` opening the given part after a family comma is the given name where rules/C13's given-name Except reads it so (`Uddin, Md Karim` and `Uddin, Mr Md Karim` → given 'Md', middle 'Karim'; `Rahman, Md.` → given 'Md.'), the degree elsewhere (`RAHMAN, MD`, `Smith, Md PhD`, `Uddin, Mr Md` → suffix), the conditions stated in that rule and decisions/C13's Standing line — 2026-11-14 #1383. - The romanized `pandit`, `sardar`, `kumari`, `babu`, `acharya` and `begum` are titles under no pack and no strict choice, each opening far more names as a given name or a surname than as the title (`Kumari Selja`, `Sardar Ahmad`, `Babu Joseph`), and each is an `excluded` entry carrying its counts — 2026-11-03 (Derek), #345. @@ -73,5 +73,5 @@ Open: #514 (whether the Tibetan prefix titles Tulku, Khenpo, Geshe, Kyabje and J - LEFT OUT, NOT EXCLUDED: `hafiz`, `hafez`, `haji` and `maulana` are the title in Pakistani, Bangladeshi, Indian and Malaysian lists and a given name in Pakistan, Indonesia, Tanzania, Iran and Egypt, so their title reading is right in its language and wrong as a default. An `excluded` entry says a reading is wrong in every language (nameparser/vocab/README.md, Exclusions), so none is written; the reading they want is `default = false`, turned on by a choice of the language: in bn.toml, which `locales.BN` would turn on, or in ur.toml, which a caller's own choice of `ur` turns on, Urdu having no pack. Neither is written here; the Bangladeshi and Pakistani lists that would weigh it are counted above, and the question stays open (Open, above). `haji` under `locales.MS` belongs with #1180's Malay honorifics. `maulana` read only inside a title phrase (rules/H9) was weighed and not taken: no listed phrase holds it, so it would move only a name a style opens (`Her Excellency Maulana Ahmad Ali` → title 'Her Excellency Maulana', given 'Ahmad'), and neither the Indonesian given names nor the cleric's title opening a name. - UNDER A STRICT CHOICE (`parser_for(locales.BN, strict=True)`, and HI's and MS's) the four read as the given name again, ar.toml not being chosen, as `mufti` and `hajji` already do. - THE NAME WORDS: `syed`, `mian`, `chaudhry` and `makhdoom` open far more names as a given name or a surname than as an honorific, and the boxes agree with today's reading, so no reading is written for them. - - MEASURED (`tools/differential/measure.py --base `, master `34771e2d`): the committed snapshot, CLDR and GND agreement and every local corpus but four read as master did. JRC-Names moved 55 names (`qari` 53, `alhaj` 1, `moulana` 1), opensanctions-parliaments 2 (`moulana`, both `pk_na_members`), orcid-researchers 7 and psc-individuals 10 (`qari` 5, `moulana` 3, `alhaj` 2): in every one the word left the given name for the title, the words after it reading as a name without it (in the 15 two-word names, the one word left the family, rules/H1: `Qari Khan` → title 'Qari', family 'Khan'), save the byline above and two of orcid-researchers' that open with `Lama`, an Arabic given name that is also a listed title (rules/H1's renunciate class): one written `Lama Alhaj` and a surname, which master read title 'Lama', given 'Alhaj', now reads title 'Lama Alhaj' and the surname as the family, and one written `Lama Alhajj` alone keeps title 'Lama', given 'Alhajj' and now reports `title-or-name`, its one name word being title vocabulary. Neither reading is the filer's; the cost is `lama`'s, which master paid already. Scored against the filers' boxes, psc-individuals loses 10 records, each a forename box holding the honorific (behind `Mr` in the title box in nine), and orcid-researchers moves 3; JRC-Names reads 8 persons' spellings apart that master read alike, the spellings with the title against those without it. my-candidates, FEC and ClinicalTrials.gov move nothing. + - MEASURED (`tools/differential/measure.py --base `, master `34771e2d`): the committed snapshot, CLDR and GND agreement and every local corpus but four read as master did. JRC-Names moved 55 names (`qari` 53, `alhaj` 1, `moulana` 1), opensanctions-parliaments 2 (`moulana`, both `pk_na_members`), orcid-researchers 7 and psc-individuals 10 (`qari` 5, `moulana` 3, `alhaj` 2): in every one the word left the given name for the title, the words after it reading as a name without it (where one name word was left, in 14 names, 12 of two words and 2 written behind `Mr`, it is the family, rules/H1: `Qari Khan` → title 'Qari', family 'Khan'), save the byline above and two of orcid-researchers' that open with `Lama`, an Arabic given name that is also a listed title (rules/H1's renunciate class): one written `Lama Alhaj` and a surname, which master read title 'Lama', given 'Alhaj', now reads title 'Lama Alhaj' and the surname as the family, and one holding `Lama` and `Alhajj` and nothing else keeps title 'Lama', given 'Alhajj' and now reports `title-or-name`, its one name word being title vocabulary. Neither reading is the filer's; the cost is `lama`'s, which master paid already. Scored against the filers' boxes, psc-individuals loses 10 records, each a forename box holding the honorific (behind `Mr` in the title box in nine), and orcid-researchers moves 3; JRC-Names reads 8 persons' spellings apart that master read alike, the spellings with the title against those without it. my-candidates, FEC and ClinicalTrials.gov move nothing. diff --git a/tests/v2/cases.py b/tests/v2/cases.py index 038e019a2..442dd0ee7 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -1175,10 +1175,10 @@ def _check_cjk_shape_purity(self) -> None: classification="feat(#1469)", notes="1.4.0 through 3.1.0 read given 'ALHAJ', middle 'AHMED'"), Case("alhajj_opening_a_name_is_the_title", - "Alhajj Rafiq Uddin", - {"title": "Alhajj", "given": "Rafiq", "family": "Uddin"}, + "Alhajj Nadeem Quraishi", + {"title": "Alhajj", "given": "Nadeem", "family": "Quraishi"}, classification="feat(#1469)", - notes="1.4.0 through 3.1.0 read given 'Alhajj', middle 'Rafiq'"), + notes="1.4.0 through 3.1.0 read given 'Alhajj', middle 'Nadeem'"), Case("qari_opening_the_given_part_after_a_family_comma_is_the_title", "Khan, Qari Ahmed", {"title": "Qari", "given": "Ahmed", "family": "Khan"}, @@ -1226,17 +1226,17 @@ def _check_cjk_shape_purity(self) -> None: {"given": "Hafez", "middle": "Ahmed", "family": "Karim"}, notes="borne as a given name, so no title by default (#1469)"), Case("maulana_opening_a_name_stays_the_given_name", - "Maulana Imran Latif", - {"given": "Maulana", "middle": "Imran", "family": "Latif"}, + "Maulana Tahir Zaidan", + {"given": "Maulana", "middle": "Tahir", "family": "Zaidan"}, notes="an Indonesian given name too, so no title by default " "(#1469); the spelling Moulana is one"), Case("haji_opening_a_name_stays_the_given_name", - "Haji Rafiq Uddin", - {"given": "Haji", "middle": "Rafiq", "family": "Uddin"}, + "Haji Nadeem Quraishi", + {"given": "Haji", "middle": "Nadeem", "family": "Quraishi"}, notes="borne as a given name, so no title by default (#1469)"), Case("syed_opening_a_name_stays_the_given_name", - "Syed Imran Latif", - {"given": "Syed", "middle": "Imran", "family": "Latif"}, + "Syed Tahir Zaidan", + {"given": "Syed", "middle": "Tahir", "family": "Zaidan"}, notes="the given name its bearers file it as (#1469)"), # #1231: the Burmese pack. Burmese names have no family name, so the # last word lands in family by position. Each row's notes checked