diff --git a/README.rst b/README.rst index 72ff022de..4561143ff 100644 --- a/README.rst +++ b/README.rst @@ -184,7 +184,7 @@ the patronymic in Russian. See `Locale packs >>> ivan.given, ivan.patronymic, ivan.family ('Иван', 'Петрович', 'Сидоров') >>> locales.available() # every pack that ships - ('ar', 'bn', 'cs', 'es', 'es_ar', 'ga', 'gd', 'he', 'hi', 'hr', 'ja', 'mn', 'ne', 'nl', 'pt', 'pt_br', 'ru', 'sk', 'sl', 'tr_az', 'vi', 'zh') + ('ar', 'bn', 'cs', 'es', 'es_ar', 'ga', 'gd', 'he', 'hi', 'hr', 'ja', 'mn', 'my', 'ne', 'nl', 'pt', 'pt_br', 'ru', 'sk', 'sl', 'tr_az', 'vi', 'zh') When a reading is wrong for your data ------------------------------------- diff --git a/docs/design/decisions/vocabulary-collisions.md b/docs/design/decisions/vocabulary-collisions.md index 0a6f9a38b..11e33255a 100644 --- a/docs/design/decisions/vocabulary-collisions.md +++ b/docs/design/decisions/vocabulary-collisions.md @@ -30,6 +30,7 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - `el` (ar.toml) is an article that may be given, as `al` is, on by default: a decided exception to the Latin-spelling half of the rule above, which it fails, on its fixed/broken table, Algeria's compound given names the accepted cost — 2026-11-12 #1257. - `oude` (nl.toml) is a particle on by default, of the generic kind `particle`, no kind naming an adjective, that may be given (nam_dict's rare Dutch given name), with its case mask `Oude`: it passes rule 2 of the 2026-11-12 #1257 entry — 2026-11-18 #1455. - `ten` (nl.toml) is a preposition written `default = false`, which `locales.NL`, a pack choosing `nl` alone, turns on; it fails rule 2's mid-name test (`Kheng Ten Choo`), and zh.toml declares the Chinese given-name syllable it opens, so a plain Dutch choice keeps a leading `Ten` the given name, reported, and a strict one reads it as the family name — 2026-11-18 #1455. +- `u` and `daw` (my.toml) are Burmese salutations written `default = false`, which `locales.MY`, a pack choosing `my` with a lexicon fragment, turns on; the fragment takes out the particle readings of `san`, `la`, `le`, `do`, `da`, `du`, `te`, `di` and `van`, Burmese name syllables, and `do`'s credential reading, as `locales.VI`'s takes out Vietnamese ones; `ko`, `ma`, `maung` and the ethnic prefixes stay name words, and the military and religious styles stay out; `U.` written with its full stop is read as the title vocabulary reads `U` under the pack, so an initial can be the title (`U. S. Grant` → title 'U.', `Smith, U.` → title 'U.', no given name), which no rule vetoes — 2026-11-19 #1231. ## Log @@ -98,3 +99,12 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - **Scored** against the filed boxes, `uv run python tools/differential/config_diff.py score "expr:Parser(lexicon=Lexicon.default().remove('oude'))" default plain:NL strict:NL --cap 20000`, ORCID and PatentsView by country and PSC by nationality, the 434 groups of 100 records or more, each capped at 20,000 (2026-11-18): the default fixes 16 to 1 broken (ORCID Netherlands 10, PatentsView Netherlands 5 and Germany 1; the break a PatentsView filer who typed `Oude` at the end of the given box), the vetting's figure. `plain:NL` fixes 102 to 10, so `ten` under the pack 86 to 9: the Netherlands and its filers 66 to 4 (ORCID 31 to 0, PatentsView 28 to 4, PSC's Dutch 7 to 0), Belgium 2 to 0, elsewhere 18 to 5. Read one by one with `local_agreement.read` (a scratch probe, the same day), two of the nine breaks are the mid-name syllable (PatentsView Malaysia `Kheng Ten Choo` and Singapore `Terence Ten Teck Hong`), the other seven filers who typed `ten` at the end of the given box (`Nils Ten` / `Hoeve`). The 20 fixes outside the Netherlands are the Dutch-surnamed people the decision gives up for the default caller. `uv run python tools/differential/config_diff.py gaps nl` (the same day) reads the strict choice against the plain one over the Dutch-language groups: 456 broken to 54 fixed, other languages' Latin particles dropped (`el`, `di`, `al`, `le`, `da`), `ten` not among its twenty words. - **Accepted:** under the pack, a Chinese given name holding `Ten` between two words gives it and the rest to the family (rules/P2's Accepted); a surname-only `Oude Luttikhuis` reads given 'Oude', reported; under a strict Dutch choice a leading `Ten` is the family (`Ten Kao Liu` → family 'Ten Kao Liu'), and so is one opening the given part after a family comma (`Brink, Ten Jan` → family 'Brink Ten Jan', `, Ten Brink` → family 'Ten Brink'), the given name lost; a family name of two Dutch names whose second opens with `ten` keeps only the second under the pack (`Jutte van der Werff ten Bosch` → middle 'van der Werff'), as a second name opening with `ter` does by default; the pack drops the credential VD (`John Smith VD` → family 'VD', and after a comma the whole name, `John Smith, VD` → family 'John Smith VD'). - **Left out:** a kind for Dutch and Low German farm-name qualifiers, and the other qualifiers themselves; `Ten` as a Korean (Koryo-saram), Chinese and Turkish family name written alone, which no reading moves; Dutch `in` (`in 't Veld`), which docs/customize.rst now uses as its example of an unlisted particle; a possibly-given particle opening a name before a suffix comma folds into the family unreported (`Ten Smith, Jr.` under the pack, `Van Smith, Jr.` by default), a shape not settled here. + +- 2026-11-19 #1231 — `LOCALES.MY` SHIPS: A BURMESE CHOICE READS `U` AND `DAW` AS TITLES AND TAKES OUT NINE PARTICLE READINGS BURMESE NAMES WRITE AS SYLLABLES. Built on the working answers the 3.2 coordinator gave the issue's five questions, each open to review on the PR under "Decisions to confirm": (1) a pack, as `locales.VI` (#1108), since a vocabulary file cannot remove a reading another file gives (decision 15 of decisions/vocabulary-model); (2) `Ko`, `Ma`, `Maung` and the ethnic prefixes (`Saw`, `Sai`, `Nang`, `Naw`, `Khun`, `Mahn`) stay name words, being name syllables too (`Maung Maung Kyaw`, `Ko Ko Lwin`); (3) `U.` with its full stop stays an initial under the pack, reversed the same day (below); (4) no new machinery for a title and one name word, which reads the word as the family as rules/H1 reads it everywhere (`U Thant` → family 'Thant'); (5) the military and religious styles (`Bogyoke`, `Thura`, `Thakin`, `Sayadaw`, `Ashin`) stay out, `Thakin` opening 7 names in the population below, `Thura` and `Ashin` 4 each, `Bogyoke` none and `Sayadaw` none, the 9 names holding `Sayadaw` writing it after the name. + - **The honorifics.** `u` and `daw` had no reading in any file. Each is a `salutation` in my.toml written `default = false`, its vetting on the word (tools/name_usage.py, 2026-11-19): `U` a Korean surname (Wikidata 154 family, South Korea 122) and an initial, `Daw` a surname (US Census 2010, 2,670) and borne in ORCID's family box 118 times. Neither carries a name reading, which would make it a title only inside a title phrase (rules/H9): the counts are in each reading's `note`. Neither is `after_given`: a Burmese honorific opens the name. The native spellings `ဦး` and `ဒေါ်` are recorded as `native` and given no reading, Burmese-script names being #1233's. The pack's name is its language's tag, `my`, as every language pack's is (country packs carry a region, `es_ar`, `pt_br`); `MY` is also Malaysia's region code, and the local corpus `my-candidates` holds Malaysian names, whose language is Malay, `ms`. + - **`U.` with its full stop: read as the title vocabulary reads it, decided 2026-11-19, reversing working answer (3).** The title match folds edge stops away, so the `u` reading claims `U.` too: `U. Thein Sein` → title 'U.', and an initial with it in many places, these among them: opening a Western name (`U. S. Grant` → title 'U.', given 'S.'), after a family comma or behind another title, where the given name can be lost (`Smith, U.` and `Kim, U` → title, no given name; `Dr. U. Smith` → title 'Dr. U.'; among FEC's names, 16 of the 351 holding `U` or `U.` as a word move under the pack and 3 of those lose their given name, `config_diff.py diff default plain:MY --local fec-individuals --match '(?:^|[\s,(])[Uu]\.?(?=[\s,)]|$)'` with each moved name's given field compared, 2026-11-19; the list is of examples, the vocabulary reading a title in more places than it names), in brackets (`John (U.) Smith` → title 'U.'), joined to another initial after a comma (`Grant, U.S.` → title 'U.S.', where `U.S. Grant` keeps its initials, rules/H10 giving the run back), and glued to a title at its stop (`Dr.U. Smith` → title 'Dr.U.'); ending the name it stays a name word (`John Smith U.` → family 'U.'), where `Daw.` reads as the title (`John Smith Daw.`, rules/H5). The PR first built working answer (3) as a rule of its own, drafted as H11 and never shipped, which required a one-letter word written with its period, in a script with capitals, to be the initial it spells and never a title, at every reader of the title vocabulary: two review rounds found it needed asking at more than a dozen readers (classify's tags, the period-joined derivation, the comma count, the title phrase, T8's glued-stop tests, the Thai glued-title walk, C2's third part, a title run's addressing, the group suggester) before `U. Smith, Ed` and `Vice U. Smith` stopped reading `U.` as a title. It was dropped: a caller who chose the pack is reading Burmese names, no Burmese list measured writes `U.` as an initial (the population below writes it once, as the honorific), and a veto at every reader of the title set was new machinery on the shared parse path for a reading only this pack's vocabulary reaches. The cost is the reason docs/languages.rst gives not to apply the pack to a mixed list. #1205 asks the same of Indonesian `H.` (Haji). + - **The syllables.** The fragment removes `kind="particle"` from the nine words the issue measured pulling the rest of a name into the family (`Daw Aung San Suu Kyi` → family 'San Suu Kyi'), and `kind="credential"` from `do`, a builder's choice: with `san` no particle, `AUNG SAN DO` read suffix 'DO' where the default reads family 'SAN DO', the one-case shape the 2026-11-05 #1108 entry of decisions/vocabulary-model found a removal unmasking (nameparser/vocab/AGENTS.md, "A reading taken out"), found here by the PR's test review; `locales.VI` removes `do`'s credential for the same reason. Other credential syllables a Burmese name written in capitals ends in read the suffix by default and under the pack alike (`PE`, `LAT`, `RA`, `EI`, `SI`: 12 of the population's names once every name is upper-cased, the regnal numerals aside, none of the 57 it writes in capitals, 2026-11-19) and are left to an issue of their own. `DEVIATES` declares every name holding one of the nine as a word of its own, cut at every character that is no letter or digit. + - **The population**, rebuilt by the issue's recipe in a scratch folder, nothing cached or committed (2026-11-19): OpenSanctions' `sanctions` and `peps` collections' `targets.simple.csv` (CC BY-NC 4.0), every `Person` with `mm` among its countries, its name and each alias, beside Wikidata's English labels of humans with Myanmar citizenship (P27 = Q836) and a Burmese label (CC0, by SPARQL); 3,205 distinct strings, 2,990 kept as clean Latin names (ASCII, no brackets, no `of`, no `a.k.a.`), where the issue's 2026-11-08 count was 2,989. Read by a scratch probe parsing each under `Parser()` and `parser_for(locales.MY)`, the intended reading being the issue's: an opening `U` or `Daw` the title, the last word (before a comma, the part before it; after a roman numeral, the word before it) the family. `config_diff.py` reads only the committed and the local corpora, so the probe stands in for it. At the pack's final state (`U.` read as the title vocabulary reads it), 154 names move, 152 from a misreading to the intended reading (holding `u` 71, `san` 39, `daw` 26, `la` 7, `van`, `te` and `da` 2 each, `do`, `le` and `du` 1 each) and none the other way; one moves between two right readings (`Sir U Thwin`, title 'Sir' and given 'U' to title 'Sir U') and one between two wrong ones (two names in one string, each opening with `Daw`). The intended reading, an honorific written with a full stop counting as the honorific, holds for 2,835 of the 2,990 by default (94.8%) and 2,987 under the pack (99.9%); the three it misses are that string and two names ending in `Ra` read as the credential RA (`Khar Ra`), the same by default. While that rule stood, the one name opening with `U.` read as given 'U.' under the pack (2,986), and the first count, taken before the PR's design review, read a leading `U.` as right whatever the parse made of it (2,836 and 2,987). The probe's intended reading cannot see a title that takes a name word: `Mg`, Maung written short, reads as en.toml's military `MG` in 10 names (`Mg Htoo` → title 'Mg'), the same by default, #1232's. Of 456 names on one university's staff lists the issue's 2026-11-19 comment counted 322 opening with `Daw` or `U`, every one misread by default; that list was read once and is not cached. + - **The cost to names that are not Burmese**, measured on this branch (2026-11-19), the local and scored figures the same at the pack's final state as while the drafted rule stood. The committed corpora at the pack's final state (the branch's tree on master `6560abde` once the drafted rule's examples left the rules corpus), `config_diff.py diff default plain:MY --committed`: 279 of 7,644 names move, 4 of them opening with `U`, `U.` or `Daw` (`Daw Thida`, `U Kyaw Win`, rules/H1's `U Thant` and the Western initial `U. S. Grant`), 3 holding a period-joined `U` chunk (`John Smith J.u.n.i.o.r.`, `John Smith U.S. Dean.`, `U.S. and U.K. Ambassador Jane Doe`) and the rest the syllables, `van` 130, `da` 20, `do` 19 (the credential among them), `la` 11, `di` 6, `du` 5; the first count, before `do`'s credential left, was 253 of 7,643. `config_diff.py diff default plain:MY --local tse-donors --local psc-individuals --local ukec-individuals`: TSE's Brazilian donors 116,114 of 848,351 (`da` 100,949, `do` 12,588), PSC's filers 3,859 of 1,034,888, UK donors 22 of 15,214. `config_diff.py score default plain:MY --group MM --group NL --group BE --group ES --group IT --group PT --group BR --group FR --group PH --group MX --group VN --group KR --group US --group GB`, every box agreeing, capped at 20,000 records a group, ORCID then PatentsView: the Netherlands 94.05% to 83.34% and 96.74% to 79.47%, Belgium 95.29% to 89.03% and 97.34% to 89.94%, Italy 97.05% to 95.13% and 98.38% to 96.99%, Brazil 49.61% to 48.11% and 75.74% to 73.72%, Portugal 71.79% to 71.24% and 57.55% to 54.89%, France 94.52% to 93.35% and 98.00% to 96.63%, the United States, Britain, Spain, the Philippines and Mexico each 0.4 of a point or less (Britain's ORCID 96.45% to 96.08%, the Philippines' 97.71% to 97.62% on master `6560abde`, 97.67% to 97.58% on `9afb2209`); Vietnam 68.50% to 67.23% in ORCID and 90.26% to 94.05% in PatentsView, South Korea alike within a fifth of a point; Myanmar's ORCID holders 85.05% to 85.39% (8 fixed, 3 broken: filers who wrote two words in the family box or `Daw` in the given box), ORCID being blind to the honorifics: its 1,737 Myanmar holders open no box with `U` and two with `Daw` (the issue's 2026-11-19 comment). The CLDR locale view's `my` file, in Burmese script, reads 19/24 with and without the pack. + - **Accepted:** under the pack a Dutch, Romance, Filipino or Māori particle among the nine is a name word (`Jan van Dijk` → middle 'van', family 'Dijk'; `Kiri Te Kanawa` → middle 'Te'), and the credential DO a name word (`Jane Doe, DO` → given 'DO'), which the pack's docstring and docs/languages.rst say, with the figures above; a `U` can be the title, bare or written with its full stop (the `U.` bullet above), a Korean surname `U` (`U Min Ho` → title 'U'; Wikidata holds 122 South Koreans with the family name U, tools/name_usage.py, 2026-11-19) and a Western initial (`U. S. Grant` → title 'U.') included, and a period-joined word holding a `U` chunk reads as a title (`John Smith J.u.n.i.o.r.` → title 'J.u.n.i.o.r.', where the default reads the suffix); a removed particle in the family before a comma no longer keeps the given part after it from reading as a credential, so the given name is lost (`Van Buren, Ed` → given 'Van', family 'Buren', suffix 'Ed'; `De La Cruz, Ed` → suffix 'Ed', no given name; `De La Cruz, M.J. K.L.` → suffix 'M.J. K.L.', where the default reads given 'M.'), the shape nameparser/vocab/AGENTS.md's "A reading taken out" names, found by the PR's last review, 4 names of the committed corpora; a title and one name word gives the family a word a Burmese name does not hold as a family name (rules/H1). + - **Left out:** `Mg` (#1232); the Burmese-script honorifics and the Burmese comma `၊` (#1233, #1202); the Burmese honorifics ending the given part after a family comma (`after_given`); the other credential syllables above. diff --git a/docs/design/decisions/vocabulary-model.md b/docs/design/decisions/vocabulary-model.md index 6f1b47c82..6a6c0ab88 100644 --- a/docs/design/decisions/vocabulary-model.md +++ b/docs/design/decisions/vocabulary-model.md @@ -7,7 +7,7 @@ The vocabulary was a set of base sets plus marker subsets (`particles` and `part - The vocabulary redesign comes before adding many packs: it is designed for 3.0, and what is safe is pulled forward in four phases, (1) the data format and a compiler, snapshot-neutral, (2) derived ambiguity with the gate on every reading kind, (3) pack semantics, (4) the rules menu, order and shapes, and the output model — 2026-10-15/16. - Each word is described by its readings (word → reading → properties), each kind belonging to one category that decides the compiled field it feeds; detailed kinds are recorded even where the kinds of a category behave alike, generation and credential being separate kinds of the suffix category (its kinds are the entries `CATEGORY` in `nameparser/_reading_index.py` maps to `suffix`) — 2026-10-15/16; 2026-10-18 #737. - A language file holds the words the parser might meet in names written in that language, immigrant particles included, not the words of its etymology, and a word sits in the file of every language whose names it occurs in, a Latin transliteration in its source language's file; `mul.toml` holds the words shared on purpose instead (the generations `i` to `v`, `2` and `jr` with `junior` and `jnr`, `&`, the European titles below, and the degrees and salutations every country's data writes alike), a word joining it where it harms no language and would otherwise be duplicated into every language's file — 2026-10-15/16; 2026-10-18 #737; 2026-10-19 #749; 2026-10-19 #750, title kinds; 2026-11-02 #1005 (Derek); 2026-11-03 #1005, the strict-gap batches (Derek). -- The default loads every language and keeps working for names of any language. Choosing a language narrows it since 3.0's phase 3 (#753): a pack settles only the clashes where its language has a vocabulary reading (`locales.VI` excepted: its fragment removes readings of Vietnamese syllables no vi.toml reading can settle, 2026-11-05 #1108), a strict choice reads only the chosen languages' files, `mul.toml` and native-script words' readings as a plain choice of the same languages keeps them (name readings included), and a pack's preferred reading can outrank one a shape rule derives — 2026-10-15/16; 2026-10-30 #753, file-strict; 2026-11-02 #1005 (Derek); 2026-11-07 #1148. +- The default loads every language and keeps working for names of any language. Choosing a language narrows it since 3.0's phase 3 (#753): a pack settles only the clashes where its language has a vocabulary reading (`locales.VI` and `locales.MY` excepted: each fragment removes readings of syllables no reading in its file can settle, Vietnamese 2026-11-05 #1108, Burmese decisions/vocabulary-collisions' 2026-11-19 #1231 entry), a strict choice reads only the chosen languages' files, `mul.toml` and native-script words' readings as a plain choice of the same languages keeps them (name readings included), and a pack's preferred reading can outrank one a shape rule derives — 2026-10-15/16; 2026-10-30 #753, file-strict; 2026-11-02 #1005 (Derek); 2026-11-07 #1148. - `e`, `y` and `i` stay in the default; choosing a language settles their one-case fork for that language's own reading, `may_be_initial` not holding on a chosen file's conjunction, as `locales.PT` and `locales.PT_BR` do for `e` — 2026-10-15/16; 2026-10-29 #753, phase 3b; 2026-10-30 #753, phase 3g. - A patronymic field came in 3.0, as a view that names its words without emptying `family`, and the particle kinds already draw the `clan`/`patronymic` line for it: a patronymic is followed by a parent's name, a clan prefix by a family name the lineage shares — 2026-10-15/16; 2026-10-19 #749; 2026-10-28 #754 (Derek); landed as rules/R9, 2026-10-29 #754, sub-phase 4c. - A shipped pack that is only a choice of languages declares no `DEVIATES`, its surface the words its choice changes; `ga` turns on `nic`, `mhic`, `mic` and `uí` as clan particles, `gd` `nic`, and `pt-BR` `sb` as Sobrinho's spelling, while the single letters `f` and `n` are excluded, the pack included, the letter abbreviating a surname more often than the agnomen in the filings that write it — 2026-10-30 #753, phase 3h. @@ -97,7 +97,7 @@ Open: [#1145](https://github.com/derek73/python-nameparser/issues/1145), the dis 3. Detailed kinds are recorded during the migration even where every kind of a category behaves alike at first; generation and credential are separate kinds (#326). 4. A language file means "the words the parser might encounter in names in that language" — what occurs in names and records written in it, including particles common there through immigration — not words of that language's etymology. 5. The default loads every language and keeps working for names of any language, as today; choosing a language narrows it. - 6. Packs prefer and strict packs restrict: a pack settles only the clashes where its language has a VOCABULARY reading, and a strict variant also drops other languages' name-level readings. (Excepted for one pack, 2026-11-05 #1108, below: `locales.VI`'s fragment removes readings of Vietnamese syllables where vi.toml holds none.) + 6. Packs prefer and strict packs restrict: a pack settles only the clashes where its language has a VOCABULARY reading, and a strict variant also drops other languages' name-level readings. (Excepted for two packs, 2026-11-05 #1108, below: `locales.VI`'s fragment removes readings of Vietnamese syllables where vi.toml holds none; and `locales.MY`'s of Burmese syllables, decisions/vocabulary-collisions' 2026-11-19 #1231 entry.) 7. `e`/`y`/`i` stay in the default, at least to start; choosing a language settles the one-case fork. 8. A patronymic field belongs in 3.0. 9. Gender is recorded only where a word gives a definitive clue. @@ -106,7 +106,7 @@ Open: [#1145](https://github.com/derek73/python-nameparser/issues/1145), the dis 12. Bearer counts are structured provenance (source + count), never used to compute a reading: two data sets deciding one reading would make the decision unclear. A new census flags changed names for review. 13. `Dean Smith` reads given `Dean`, as today. 14. Order and shape are separate: a language supplies only a default order; the shapes (where titles, suffixes, particles and commas sit) belong to each order and live in the core. - 15. Vocabulary readings settle a clash; name readings only keep the gate on. (Bent for one pack, 2026-11-05 #1108, below: `locales.VI`'s fragment removes the particle, connective and credential readings of Vietnamese syllables, the settling no reading in vi.toml can do.) + 15. Vocabulary readings settle a clash; name readings only keep the gate on. (Bent for two packs, 2026-11-05 #1108, below: `locales.VI`'s fragment removes the particle, connective and credential readings of Vietnamese syllables, the settling no reading in vi.toml can do; and `locales.MY`'s the particle readings of Burmese syllables and `do`'s credential, decisions/vocabulary-collisions' 2026-11-19 #1231 entry.) 16. The contested-head rule covers only words outside `titles` today (`dean`, `justice`, `major`); a title that is also a given name today is decided one word at a time, like the graf class (decisions/salutation-titles). 17. `cased` and `same_as` replace a "canonical" spelling, and `cased` replaces `capitalization_exceptions`; both default to the word, and a reading's `native` spelling is for surfacing. 18. `acronym` is a reading property, replacing the `suffix_acronyms`/`suffix_words` split; `expands` records the meaning an entry was added for, not every meaning. diff --git a/docs/design/mechanisms.md b/docs/design/mechanisms.md index c2d4262b5..9d1c11553 100644 --- a/docs/design/mechanisms.md +++ b/docs/design/mechanisms.md @@ -346,9 +346,9 @@ rules/O8's letters are the same shape at the family's other edge: the family wri **Problem shape.** Language-specific behavior needs a home that cannot drift from the core. -**Contract statement.** A locale pack is pure data — a choice of languages, a Lexicon fragment of ADDITIONS (one pack's of removals, `locales.VI`'s, below) and a Policy patch — applied by parser_for, a shipped pack's patch compiled from its language file's `[rules]` table where one is written, each key the `Policy` field of its name: the packs' languages union with the base's recorded choice into one choice, recorded on the `Lexicon`, which selects among the base's shipped readings by the file each sits in, the fragments join in pack order and the caller's lexicon after them, its own readings applying after the choice, and the patches fold in order (set-valued fields union, `script_orders` merges by script, scalars override); packs contain no code paths of their own. A vocabulary pack's deviations are derived from the reading index, the words whose compiled readings its choice changes; a policy or segmentation pack declares its own in its docstring and `DEVIATES`. +**Contract statement.** A locale pack is pure data — a choice of languages, a Lexicon fragment of ADDITIONS (two packs' of removals, `locales.VI`'s and `locales.MY`'s, below) and a Policy patch — applied by parser_for, a shipped pack's patch compiled from its language file's `[rules]` table where one is written, each key the `Policy` field of its name: the packs' languages union with the base's recorded choice into one choice, recorded on the `Lexicon`, which selects among the base's shipped readings by the file each sits in, the fragments join in pack order and the caller's lexicon after them, its own readings applying after the choice, and the patches fold in order (set-valued fields union, `script_orders` merges by script, scalars override); packs contain no code paths of their own. A vocabulary pack's deviations are derived from the reading index, the words whose compiled readings its choice changes; a policy or segmentation pack declares its own in its docstring and `DEVIATES`. -**How it works.** What is policy for every language (an order constant) is policy, not pack data; packs are lowercase modules exposing uppercase constants; a pack error is wrapped with the pack's code (rule D2). A choice changes the base's readings only by selection, never by a list of removals (a pack's fragment may remove, as a caller's lexicon may, and one shipped pack's does: `locales.VI` takes out the particle, connective and credential readings of the Vietnamese syllables its order would otherwise chain or cut off, `Van` in `Nguyen Van Anh`, a settling no reading in its file can do, decisions 6 and 15 of decisions/vocabulary-model, bent there on 2026-11-05 #1108): a chosen language's `default = false` readings join; on a word a chosen language holds a vocabulary reading of, other languages' vocabulary readings leave, save `mul.toml`'s; and a chosen language's conjunction loses `may_be_initial`, its clash with the initial being a shape reading a preference outranks, which is how a `pt` choice drops `e` from `conjunctions_ambiguous` (decisions/vocabulary-model, 2026-10-27 #753, items 1, 2 and 7; built 2026-10-29, phase 3b). A strict choice, `parser_for(..., strict=True)`, selects by file alone: only the chosen files, `mul.toml` and native-script words' readings as a plain choice of the same languages keeps them (name readings included) compile, `und.toml`'s readings leaving with every other file's (decisions/vocabulary-model, 2026-10-30 #753, file-strict; built 2026-10-31, phase 3j; `mul.toml` kept since 2026-11-02 #1005). So a bad default is routed around only by choosing the language whose reading is right, which is why #342-class fixes still change shipped vocabulary. The choice filters the base's shipped readings and the caller's own `add` and `remove` calls apply after it, so a choice never drops a caller's word, and one that clashes with a reading the choice turns on is refused at `parser_for`, naming the edit; a lexicon built from `Lexicon.empty()` holds no shipped reading, so a choice turns none on in it; a pack choosing no language leaves the base's exactly as it was. The choice is recorded on the `Lexicon`, so `parser_for(EN, base=parser_for(PT))` chooses both, as `parser_for(PT, EN)` does (decisions/vocabulary-model, 2026-11-02 #754, the `Lexicon` surface, items 3 and 4; built 2026-11-02, sub-phase 4i-c). Pure data means a pack can be audited: a vocabulary pack's whole content is its tag, but what it changes reaches other files too, prefer dropping their readings of its words (a `de` choice drops `ca.toml`'s conjunction `i`), so the audit is the derived surface, `changed_words`, not the pack's file alone. A country pack is the same data with a region tag: `locales.ES_AR` chooses `es-AR`, which selects `es.toml` by ancestry until a reading is Argentina's own, names its language's `[rules]` (`rules_patch("es")`) rather than inheriting them, and carries its own lexicon fragment, so stacked on its language's pack it reads as itself where its fragment holds the language pack's (decisions/O6, 2026-11-04). +**How it works.** What is policy for every language (an order constant) is policy, not pack data; packs are lowercase modules exposing uppercase constants; a pack error is wrapped with the pack's code (rule D2). A choice changes the base's readings only by selection, never by a list of removals (a pack's fragment may remove, as a caller's lexicon may, and two shipped packs' do: `locales.VI` takes out the particle, connective and credential readings of the Vietnamese syllables its order would otherwise chain or cut off, `Van` in `Nguyen Van Anh`, a settling no reading in its file can do, decisions 6 and 15 of decisions/vocabulary-model, bent there on 2026-11-05 #1108; `locales.MY` the particle readings of the Burmese syllables, `San` in `Aung San Win`, and `do`'s credential reading, which the particle chain had kept from ending `AUNG SAN DO`, decisions/vocabulary-collisions, 2026-11-19 #1231): a chosen language's `default = false` readings join; on a word a chosen language holds a vocabulary reading of, other languages' vocabulary readings leave, save `mul.toml`'s; and a chosen language's conjunction loses `may_be_initial`, its clash with the initial being a shape reading a preference outranks, which is how a `pt` choice drops `e` from `conjunctions_ambiguous` (decisions/vocabulary-model, 2026-10-27 #753, items 1, 2 and 7; built 2026-10-29, phase 3b). A strict choice, `parser_for(..., strict=True)`, selects by file alone: only the chosen files, `mul.toml` and native-script words' readings as a plain choice of the same languages keeps them (name readings included) compile, `und.toml`'s readings leaving with every other file's (decisions/vocabulary-model, 2026-10-30 #753, file-strict; built 2026-10-31, phase 3j; `mul.toml` kept since 2026-11-02 #1005). So a bad default is routed around only by choosing the language whose reading is right, which is why #342-class fixes still change shipped vocabulary. The choice filters the base's shipped readings and the caller's own `add` and `remove` calls apply after it, so a choice never drops a caller's word, and one that clashes with a reading the choice turns on is refused at `parser_for`, naming the edit; a lexicon built from `Lexicon.empty()` holds no shipped reading, so a choice turns none on in it; a pack choosing no language leaves the base's exactly as it was. The choice is recorded on the `Lexicon`, so `parser_for(EN, base=parser_for(PT))` chooses both, as `parser_for(PT, EN)` does (decisions/vocabulary-model, 2026-11-02 #754, the `Lexicon` surface, items 3 and 4; built 2026-11-02, sub-phase 4i-c). Pure data means a pack can be audited: a vocabulary pack's whole content is its tag, but what it changes reaches other files too, prefer dropping their readings of its words (a `de` choice drops `ca.toml`'s conjunction `i`), so the audit is the derived surface, `changed_words`, not the pack's file alone. A country pack is the same data with a region tag: `locales.ES_AR` chooses `es-AR`, which selects `es.toml` by ancestry until a reading is Argentina's own, names its language's `[rules]` (`rules_patch("es")`) rather than inheriting them, and carries its own lexicon fragment, so stacked on its language's pack it reads as itself where its fragment holds the language pack's (decisions/O6, 2026-11-04). **Lives in.** nameparser/locales/ (packs), nameparser/_parser.py (parser_for, the one applier), nameparser/_lexicon.py (the compile under a recorded choice, `_chosen_pool` and `_built`), nameparser/_reading_index.py (the selection, `choose`, and the derived surface, `changed_words`), nameparser/_locale.py (`rules_patch`, a file's compiled `[rules]` as a patch) and tools/vocab/build.py (`RULE_KEYS`, the rules a file may turn on, and `PACK_RULES`, the files the shipped packs read; decisions/vocabulary-model, 2026-10-29 4f). A rule a file turns on is a `Policy` field; a new rule kind is a core change, never code in a pack: a new `Policy` field (with `ADDED_IN`), a row in build.py's `RULE_KEYS` and in `_locale._RULE_VALUES`, and a mechanisms.md entry of its own for the rule kind. diff --git a/docs/design/rules/H1-title-and-one-name-word.md b/docs/design/rules/H1-title-and-one-name-word.md index 783e4af98..3a44cd0be 100644 --- a/docs/design/rules/H1-title-and-one-name-word.md +++ b/docs/design/rules/H1-title-and-one-name-word.md @@ -78,6 +78,10 @@ "Anna Greve" → family="Greve" "Greve, Anna" → family="Greve" ``` +- A Burmese name of an honorific and one name word gives the word to the family under a Burmese choice, though a Burmese name holds no family name: the honorific is no given-name title, so the word is the family name here as after any title that is none (#1231). + ``` + "U Thant" [my] → family="Thant" + ``` --- **Signal:** count: exactly one name word beside a title run, read by the run's addressing title diff --git a/docs/languages.rst b/docs/languages.rst index 4debde7b8..e832f872c 100644 --- a/docs/languages.rst +++ b/docs/languages.rst @@ -18,8 +18,8 @@ subset with its own parser, or pass several packs to ``parser_for``: The sections below cover Czech, Slovak, Slovenian and Croatian names, Spanish and Portuguese titles and family names, romanized Indic titles, -Vietnamese, Mongolian and Thai names, and Maghrebi, Amazigh, Hebrew and -Dutch particles. Other languages are described where their mechanism is: +Vietnamese, Mongolian and Thai names, Maghrebi, Amazigh, Hebrew and +Dutch particles, and Burmese names. Other languages are described where their mechanism is: - **East Slavic patronymics** (``ru``): :ref:`east-slavic-patronymics`. - **Turkic patronymic markers** (``tr_az``): @@ -1177,3 +1177,103 @@ What the pack costs ... languages=frozenset({"en"})) >>> parser_for(locales.NL, english).parse("John Smith VD").suffix 'VD' + +.. _burmese-names: + +Burmese names +------------- + +Turn on ``locales.MY`` when your data is Burmese names written in Latin +letters. ``my`` is the language tag of Burmese; Malaysia, whose region +code is also MY, writes Malay, ``ms``, which this pack is not for. + +A Burmese name has no family name: every word is a personal name, and +an honorific goes in front, ``U`` for a man and ``Daw`` for a woman. +The parser reads by position, so under the pack the last word is the +family name, as in any name, and the honorific is the title: + +.. doctest:: + + >>> parse("U Thein Sein").given + 'U' + >>> burmese = parser_for(locales.MY) + >>> thein_sein = burmese.parse("U Thein Sein") + >>> thein_sein.title, thein_sein.given, thein_sein.family + ('U', 'Thein', 'Sein') + +Burmese syllables such as ``San``, ``La`` and the Chin ``Van`` are +particles in Spanish, Italian, Portuguese, French or Dutch, and the +default takes them, and every word after them, into the family name. +The pack keeps them name words: + +.. doctest:: + + >>> parse("Daw Aung San Suu Kyi").family + 'San Suu Kyi' + >>> suu_kyi = burmese.parse("Daw Aung San Suu Kyi") + >>> suu_kyi.title, suu_kyi.middle, suu_kyi.family + ('Daw', 'San Suu', 'Kyi') + +The nine are ``San``, ``La``, ``Le``, ``Do``, ``Da``, ``Du``, ``Te``, +``Di`` and ``Van``, and ``Do`` is no credential either, so a name +written in capitals keeps a final ``DO``. + +On 2,990 names of people from Myanmar, from sanctions and politically +exposed persons lists and from Wikidata, the honorific read as the +title and the last word as the family hold for 94.8% by default and +99.9% under the pack (``docs/design/decisions/vocabulary-collisions.md``, +:issue:`1231`). + +What the pack leaves as it is +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **Other honorifics and prefixes.** ``Ko``, ``Ma`` and ``Maung`` are + honorifics too but also name syllables (``Maung Maung Kyaw``), and the + ethnic prefixes ``Saw``, ``Sai``, ``Nang``, ``Naw``, ``Khun`` and + ``Mahn`` are part of the name, so each stays a name word. +- **An honorific and one word.** ``U Thant`` gives title ``U``, family + ``Thant``, as a title and one name word reads in any name. +- **Military and religious styles** (``Bogyoke``, ``Sayadaw``) are read + as name words, as by default (``Ledi Sayadaw`` gives family + ``Sayadaw``). +- **Burmese script.** The pack reads Latin letters only; ``ဦး`` and + ``ဒေါ်`` have no reading yet. + +When not to use it +~~~~~~~~~~~~~~~~~~ + +The pack is for lists of Burmese names. On other names it costs: + +- **Nine particles.** Their particle readings, which Dutch, Portuguese, + Italian, French, Spanish, Filipino and Māori family names hold + (``de`` and ``del`` keep theirs, so ``Juan de la Cruz`` reads as by + default, but a ``de la`` in other shapes, after a comma, beside another + particle or under a family-first order, can read otherwise). Where one + stands in the family name before a comma, the given part after it + can read as a credential, the given name lost (``Van Buren, Ed`` + gives suffix ``Ed``). +- **The credential DO**, read as a name word. +- **An initial U.** ``U`` is the honorific however it is written, so + an initial ``U.`` can be read as the title: ``Smith, U.`` and ``Dr. + U. Smith`` give no given name, though ``John U. Smith`` and ``Smith, + John U.`` keep it an initial. + +Keep it to a parser of its own for the Burmese names in your data: + +.. doctest:: + + >>> burmese.parse("Jan van Dijk").family + 'Dijk' + >>> burmese.parse("Maria da Silva").family + 'Silva' + >>> grant = burmese.parse("U. S. Grant") + >>> grant.title, grant.given + ('U.', 'S.') + +Measured on names that are not Burmese, the pack changes the reading of +14% of the names of Brazilian election donors, and among researchers +who filed their own given and family names in ORCID it lowers the +share read right in both boxes from 94% to 83% in the Netherlands and +from 95% to 89% in Belgium. A Korean name written with no comma and opening with the +surname ``U`` reads ``U`` as the title under the pack (``U Minjun``), +where ``U, Minjun`` keeps it as the family name. diff --git a/docs/locales.rst b/docs/locales.rst index 2e22cf3ce..4e204dfe3 100644 --- a/docs/locales.rst +++ b/docs/locales.rst @@ -144,6 +144,12 @@ shape covers much: the order moves every name a family comma does not fix, and its titles and removed readings reach the comma names too. - ``mn`` may read any name written wholly in Cyrillic differently. +- ``my`` may read any name holding ``San``, ``La``, ``Le``, ``Do``, + ``Da``, ``Du``, ``Te``, ``Di`` or ``Van`` as a word differently, + Spanish, Portuguese, Italian, French, Filipino and Dutch family names + among them, a name holding the credential ``DO``, and any holding + ``U`` or ``Daw`` as a word, with or without its full stop, or ``U`` + as a letter of a word joined by full stops. .. warning:: @@ -182,7 +188,7 @@ look one up dynamically by its lowercase code with .. doctest:: >>> locales.available() - ('ar', 'bn', 'cs', 'es', 'es_ar', 'ga', 'gd', 'he', 'hi', 'hr', 'ja', 'mn', 'ne', 'nl', 'pt', 'pt_br', 'ru', 'sk', 'sl', 'tr_az', 'vi', 'zh') + ('ar', 'bn', 'cs', 'es', 'es_ar', 'ga', 'gd', 'he', 'hi', 'hr', 'ja', 'mn', 'my', 'ne', 'nl', 'pt', 'pt_br', 'ru', 'sk', 'sl', 'tr_az', 'vi', 'zh') >>> locales.get("ru") is locales.RU True @@ -292,6 +298,13 @@ says which parts each pack is made of. name last, so the father's name, written first, is the family. See :ref:`Mongolian names `. - ``Батын Сүхээ`` → family ``Батын``, given ``Сүхээ`` + * - ``my`` + - Burmese + - Chooses ``my``, which reads the honorifics ``U`` and ``Daw`` + as titles (``U Thein Sein``), and keeps the syllables ``San``, + ``La``, ``Van`` and six more as name words where other + languages read particles. See :ref:`burmese-names`. + - ``Daw Aung San Suu Kyi`` → title ``Daw``, family ``Kyi`` * - ``ne`` - Nepali - Chooses ``ne``, which reads ``श्री``, ``गुरु`` and ``Guru`` as @@ -391,6 +404,10 @@ says what it can change: - yes (turns on nothing) - a ``script_orders`` entry for Cyrillic - none + * - ``my`` + - yes + - none + - none; it takes readings out instead * - ``ne`` - yes - ``initials_as_family`` @@ -408,8 +425,8 @@ says what it can change: - ``segment_scripts``, for the script its list covers - a surname list -``vi`` is the one pack whose own fragment takes readings out rather -than adding them (`What a pack's lexicon may hold`_). +``vi`` and ``my`` are the packs whose own fragments take readings out +rather than adding them (`What a pack's lexicon may hold`_). See :ref:`config-containers` for how that split (language vocabulary vs. behavior) is drawn. Which half a new naming rule belongs in is @@ -1121,4 +1138,6 @@ right, validated on its own, and it may hold any of these: where another pack would choose because a choice prefers its language's reading of a word only where that reading is a title, a particle or another vocabulary kind, never a name, so no reading - ``vi.toml`` could write would keep ``Van`` a name word. + ``vi.toml`` could write would keep ``Van`` a name word. ``my``'s + fragment takes out the particle readings of the Burmese syllables, + and ``do``'s credential reading, the same way. diff --git a/docs/release_log.rst b/docs/release_log.rst index 855c9284f..fe4ee790c 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -7,6 +7,7 @@ Release Log - **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` + - **Add locales.MY, a Burmese pack, which reads U and Daw as titles.** ``parser_for(locales.MY).parse("Daw Aung San Suu Kyi")`` gives title ``Daw``, given ``Aung``, middle ``San Suu``, family ``Kyi``, where the default, as 1.4.0 through 3.1.0, gives given ``Daw``, family ``San Suu Kyi``. It reads ``San``, ``La``, ``Van`` and six more as name words, so names holding ``van``, ``da``, ``la`` and the rest lose them as particles (``Jan van Dijk`` gives family ``Dijk``), and an initial ``U.`` can become the title (``Smith, U.`` gives no given name): keep it to Burmese names. See :ref:`burmese-names`. :issue:`1231` - **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` - **Fix Emeritus, which read as a given name.** ``parse("Professor Emeritus John Smith")`` gives title ``Professor Emeritus``, given ``John``, where 1.4.0 through 3.1.0 gave title ``Professor``, given ``Emeritus``, middle ``John``; ``Emeritus Professor`` and ``Professor Emerita`` read the same way. ``Emerita`` alone stays the given name, reported, being a given name too. A title other than ``Professor`` or ``Prof`` before it still leaves it a name word (``Bishop Emeritus John Smith`` gives given ``Emeritus``). :issue:`1471` - **Change locales.ES_AR's given-name list, rewritten from its tool.** ``parser_for(locales.ES_AR).parse("Juan Gerhard Lopez")`` gives family ``Gerhard Lopez``, where 3.0.0 through 3.1.0 gave middle ``Gerhard``; six words leave the list (``Gerhard``, ``Emerita``, ``Zuleyma`` among them) and six join it (``Azhar``, ``Houari``), each joining reading as a middle name where it read as the first family name. :issue:`1471` diff --git a/nameparser/config/_index.py b/nameparser/config/_index.py index 92deae59c..7a0cad8df 100644 --- a/nameparser/config/_index.py +++ b/nameparser/config/_index.py @@ -771,6 +771,7 @@ ('darya', (('ru', 'spelling', (('spelling_of', ('daria',)),)),)), ('das', (('pt', 'preposition', ()),)), ('dave', (('en', 'familiar', (('short_for', ('david',)),)),)), + ('daw', (('my', 'salutation', (('default', False),)),)), ('dbe', (('en', 'credential', ()),)), ('dbqh', (('vi', 'office', (('same_as', 'đbqh'),)),)), ('dc', (('en', 'credential', ()),)), @@ -2683,6 +2684,7 @@ ('tte', (('es', 'military', ()),)), ('tunde', (('mul', 'familiar', (('short_for', ('babatunde',)),)),)), ('ty', (('en', 'familiar', (('short_for', ('tyler',)),)),)), + ('u', (('my', 'salutation', (('default', False),)),)), ('ua', (('ga', 'clan', (('cased', 'Ua'), ('same_as', 'ó'))), ('ga', 'given', ()))), ('ud', (('en', 'credential', ()),)), ('uk', (('en', 'modifier', (('dotted', True),)),)), diff --git a/nameparser/locales/AGENTS.md b/nameparser/locales/AGENTS.md index 6cf77c044..eca04153d 100644 --- a/nameparser/locales/AGENTS.md +++ b/nameparser/locales/AGENTS.md @@ -69,5 +69,5 @@ The shipped packs are the rows of `_REGISTRY` in `nameparser/locales/__init__.py | Nothing but a choice of languages | `nameparser/locales/hi.py` | | A choice of languages beside a `[rules]` table | `nameparser/locales/cs.py` | | A choice that changes no word, beside a patch | `nameparser/locales/mn.py` | -| A fragment that takes readings out | `nameparser/locales/vi.py` | +| A fragment that takes readings out | `nameparser/locales/vi.py` (`nameparser/locales/my.py` beside a choice alone) | | A country pack reading its language's `[rules]` table | `nameparser/locales/es_ar.py` | diff --git a/nameparser/locales/__init__.py b/nameparser/locales/__init__.py index 83d1012ac..7f4a87a70 100644 --- a/nameparser/locales/__init__.py +++ b/nameparser/locales/__init__.py @@ -35,6 +35,7 @@ "HR": ("nameparser.locales.hr", "HR"), "JA": ("nameparser.locales.ja", "JA"), "MN": ("nameparser.locales.mn", "MN"), + "MY": ("nameparser.locales.my", "MY"), "NE": ("nameparser.locales.ne", "NE"), "NL": ("nameparser.locales.nl", "NL"), "PT": ("nameparser.locales.pt", "PT"), diff --git a/nameparser/locales/my.py b/nameparser/locales/my.py new file mode 100644 index 000000000..6d6cf95bc --- /dev/null +++ b/nameparser/locales/my.py @@ -0,0 +1,96 @@ +"""The Burmese locale pack (#1231): it chooses the language ``my``, the +BCP 47 tag of Burmese (not the country code of Malaysia, whose language +is Malay, ``ms``), which turns on the readings nameparser/vocab/my.toml +writes ``default = false``: the honorifics ``U`` (Mr.) and ``Daw`` +(Mrs.) written before a name, read as titles, so ``U Thein Sein`` gives +title ``U``, given ``Thein``, family ``Sein`` where the default gives +given ``U``, middle ``Thein``. And its lexicon fragment takes out the +particle readings other languages give the syllables Burmese names are +written with, so ``Daw Aung San Suu Kyi`` gives middle ``San Suu``, +family ``Kyi`` where the Spanish ``san`` would take ``San Suu Kyi`` into +the family name. It also takes out ``do``'s credential reading, so a +name written in capitals keeps a final ``DO`` (``AUNG SAN DO`` gives +family ``DO``, where with ``san`` no particle the credential would end +the name). + +Burmese names have no family name: every word is a personal name, and +the last one lands in ``family`` by position as it does in any name +read positionally. The title vocabulary reads ``U.`` with its full +stop as it reads ``U``, so a Western initial can be the title under +the pack too (``U. S. +Grant`` gives title ``U.``, given ``S.``; ``Smith, U.`` and ``Dr. U. +Smith`` give no given name), the accepted cost and the reason to keep +the pack to Burmese names; a bare ``U.`` between two name words stays +an initial (``John U. Smith``). A title and one name word reads the word as the family +name, as everywhere (rules/H1), so ``U Thant`` gives family ``Thant``. + +Left as name words: the honorifics ``Ko``, ``Ma`` and ``Maung``, which +are also name syllables (``Maung Maung Kyaw``), and the ethnic prefixes +``Saw``, ``Sai``, ``Nang``, ``Naw``, ``Khun`` and ``Mahn``; and the +military and religious styles (``Bogyoke``, ``Sayadaw``), each rare +(decisions/vocabulary-collisions, the 2026-11-19 #1231 entry). + +The fragment removes readings, as ``locales.VI``'s does, the one kind +of pack content that may: a choice prefers only by a vocabulary reading, and a +name reading never settles a clash (decision 15 of +decisions/vocabulary-model), so no reading my.toml could write makes +``san`` a name word under a plain choice. The removals cost a caller who +applies the pack to names that are not Burmese those nine words' +particle readings in Spanish, Italian, Portuguese, French, Filipino, +Dutch and Māori surnames (``Juan de la Cruz`` keeps ``de la Cruz``, +``de`` not being among them, but ``Maria la Torre``, ``Jan van Dijk`` +and ``Kiri Te Kanawa`` lose theirs, and ``Van Buren, Ed`` reads ``Ed`` +as a credential, its given name lost, as a given part of initials can +be after one) and the credential DO +(``Jane Doe, DO`` gives given ``DO``), the measured cost in the +decisions entry. + +Data sources: the honorifics' vetting is on the words in my.toml +(tools/name_usage.py); the syllables were measured on OpenSanctions' +sanctions and PEP records of Myanmar and Wikidata's labels of people +with Myanmar citizenship, in the decisions entry. + +Declared deviations (mechanisms.md#LOCALE-PACKS-PURE-DATA): the +choice's own words, ``u`` and ``daw``, are derived +(``_reading_index.changed_words``), which the non-interference gate in +tests/v2/test_locales.py ors in; DEVIATES below declares what the +fragment changes, every name holding one of its syllables as a word +(``do`` among them). +""" +from __future__ import annotations + +from nameparser._lexicon import Lexicon +from nameparser._locale import Locale + +#: Syllables of Burmese names that another language's file reads as a +#: particle: San (Aung San), La, Le, Do, Da, Du, Te, Di, and Van, a +#: syllable of Chin names (#1231) +_PARTICLES = ("da", "di", "do", "du", "la", "le", "san", "te", "van") + +#: and as a credential, which the particle chain had kept from ending a +#: name written in capitals (``AUNG SAN DO``): Do +_CREDENTIALS = ("do",) + +_SYLLABLES = frozenset(_PARTICLES + _CREDENTIALS) + +MY = Locale( + code="my", + lexicon=(Lexicon.empty() + .remove(*_PARTICLES, kind="particle") + .remove(*_CREDENTIALS, kind="credential")), + languages=frozenset({"my"}), +) + + +def DEVIATES(name: str) -> bool: + """True when this pack's fragment may parse `name` differently from + the default parser (the declared-deviation predicate the + non-interference gate consumes): a name holding one of the + syllables whose particle reading the fragment takes out as a word + of its own, cut at every character that is no letter or digit, so + the halves of a hyphenated or apostrophized word and a word written + with its full stop count too (over-declaring, the safe direction). + Cut without a pattern: the pack contract reads a module that + imports ``re`` as one declaring by marker regex.""" + words = "".join(c if c.isalnum() else " " for c in name.lower()).split() + return not _SYLLABLES.isdisjoint(words) diff --git a/nameparser/vocab/AGENTS.md b/nameparser/vocab/AGENTS.md index 62885d02a..065da4126 100644 --- a/nameparser/vocab/AGENTS.md +++ b/nameparser/vocab/AGENTS.md @@ -58,4 +58,4 @@ Every strict choice reads `mul.toml` (#1005), so a word there is read in names o ## A reading taken out: what it used to override -Taking a reading out of a word, by a `remove` in a pack's fragment or by moving it between files, leaves the readings it used to override to act, the word's own others and its neighbours', and a grid in mixed case does not show it. #1108's fragment took `van`'s particle reading out under `locales.VI`, and `NGUYEN VAN DO` then read suffix 'DO': the `van` chain had kept `DO`'s credential reading from ending the name, and only the code review's one-case row found it, every grid row being mixed case or a syllable no file holds. List every reading the word and the words it chained keep (`uv run python tools/vocab/query.py --word `), and parse each removed word with the word it used to absorb ending the name, in one case, beside a mixed-case control; then parse it after a family comma, where an order a pack sets reads nothing differently and the removal still acts (`Beethoven, Ludwig van` under `locales.VI`, found by #1108's second design-docs review). And before proposing a name reading to settle a clash under a language choice, check that the reading is a vocabulary one: `choose` prefers only by those, and a `given` or `family` reading never settles (decision 15 of decisions/vocabulary-model), the premise #1108 was filed on. +Taking a reading out of a word, by a `remove` in a pack's fragment or by moving it between files, leaves the readings it used to override to act, the word's own others and its neighbours', and a grid in mixed case does not show it. #1108's fragment took `van`'s particle reading out under `locales.VI`, and `NGUYEN VAN DO` then read suffix 'DO': the `van` chain had kept `DO`'s credential reading from ending the name, and only the code review's one-case row found it, every grid row being mixed case or a syllable no file holds. List every reading the word and the words it chained keep (`uv run python tools/vocab/query.py --word `), and parse each removed word with the word it used to absorb ending the name, in one case, beside a mixed-case control; then parse it after a family comma, where an order a pack sets reads nothing differently and the removal still acts (`Beethoven, Ludwig van` under `locales.VI`, found by #1108's second design-docs review). Put a removed particle in the family before a comma in the grid too, with a short given name and with initials after the comma: it had kept the given part from reading as a credential, and #1231's `locales.MY` read `Van Buren, Ed` given 'Van', suffix 'Ed' and `De La Cruz, M.J. K.L.` suffix 'M.J. K.L.', found only by its last reviews. And before proposing a name reading to settle a clash under a language choice, check that the reading is a vocabulary one: `choose` prefers only by those, and a `given` or `family` reading never settles (decision 15 of decisions/vocabulary-model), the premise #1108 was filed on. diff --git a/nameparser/vocab/my.toml b/nameparser/vocab/my.toml index 766e1f1bc..946929bef 100644 --- a/nameparser/vocab/my.toml +++ b/nameparser/vocab/my.toml @@ -1,5 +1,13 @@ schema = 1 +[[word]] +text = "daw" +salutation = { default = false, gender = "f", native = "ဒေါ်", issue = 1231, expands = "Daw, the honorific written before a woman's name (Mrs.)", note = "Burmese names have no family name and an honorific opens them, so the default reads Daw as the given name; on by default it would take the given name of the people who bear it: US Census 2010 2,670 as a surname, Wikidata 3 given (Sudan 1) and 20 family; ORCID's given box 29, MM 2, family box 118; PatentsView 9 given, 54 family (tools/name_usage.py, 2026-11-19). Written bare as a word of its own; written Daw. it is a title by its shape by default already (rules/H2)" } + +[[word]] +text = "u" +salutation = { default = false, gender = "m", native = "ဦး", issue = 1231, expands = "U, the honorific written before a man's name (Mr.)", note = "a Korean surname (Wikidata 154 family, South Korea 122; 12 given, 2026-11-19) and, written with its full stop, an initial, which the reading can take as the title under the pack (U. S. Grant, Smith, U.), the accepted cost (decisions/vocabulary-collisions, the 2026-11-19 #1231 entry). Written bare by Burmese names as a rule (U Thein Sein; 1 of the 71 names opening with the honorific in the #1231 population writes U.); FEC writes U 187 times and U. 163, 320 of the 351 after a comma; ctgov-officials U 260, U. 61 (tools/name_usage.py, 2026-11-19)" } + [[word]] text = "ဂျူနီယာ" generation = { issue = 679 } diff --git a/tests/v2/cases.py b/tests/v2/cases.py index e710e6d6a..47572fb59 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -1039,6 +1039,65 @@ def _check_cjk_shape_purity(self) -> None: notes="the mid-name cost that keeps ten off by default " "(rules/P2's Accepted); 1.4.0 through 3.1.0 read middle " "'Ten'"), + # #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 + # 2026-11-19; on master, where no `my` pack exists, every row fails + Case("the_burmese_pack_reads_u_as_the_title", + "U Thein Sein", + {"title": "U", "given": "Thein", "family": "Sein"}, + locale="my", classification="feat(#1231)", + notes="1.4.0 through 3.1.0 read given 'U', middle 'Thein'"), + Case("the_burmese_pack_reads_daw_as_the_title_and_san_as_a_name_word", + "Daw Aung San Suu Kyi", + {"title": "Daw", "given": "Aung", "middle": "San Suu", "family": "Kyi"}, + locale="my", classification="feat(#1231)", + notes="1.4.0 through 3.1.0 read given 'Daw', family 'San Suu Kyi'"), + Case("the_burmese_pack_reads_the_honorific_after_a_family_comma", + "Sein, U Thein", + {"title": "U", "given": "Thein", "family": "Sein"}, + locale="my", classification="feat(#1231)", + notes="1.4.0 through 3.1.0 read given 'U', middle 'Thein'"), + Case("the_burmese_pack_reads_a_title_and_one_name_word_as_h1_does", + "U Thant", + {"title": "U", "family": "Thant"}, + locale="my", classification="feat(#1231)", + notes="a title and one name word, the word the family (rules/H1); " + "1.4.0 through 3.1.0 read given 'U', family 'Thant'"), + Case("the_burmese_pack_keeps_a_chin_van_a_name_word", + "Henry Van Thio", + {"given": "Henry", "middle": "Van", "family": "Thio"}, + locale="my", classification="feat(#1231)", + notes="the fragment takes out van's particle reading; 1.4.0 through " + "3.1.0 read family 'Van Thio'"), + Case("the_burmese_pack_keeps_san_a_name_word_after_a_family_comma", + "AUNG, Saw San", + {"given": "Saw", "middle": "San", "family": "AUNG"}, + locale="my", classification="parity", + notes="rules/P6's trailing attachment has no particle to attach; " + "1.4.0 and 2.0.0 read the same fields, 2.4.0 through 3.1.0 " + "family 'San AUNG'"), + Case("the_burmese_pack_reads_u_with_its_full_stop_as_the_title", + "U. Thein Sein", + {"title": "U.", "given": "Thein", "family": "Sein"}, + locale="my", classification="feat(#1231)", + notes="the title vocabulary reads the honorific written with its " + "full stop as it reads it bare; 1.4.0 through 3.1.0 read " + "given 'U.', middle 'Thein'"), + Case("the_burmese_pack_reads_an_initial_u_opening_a_name_as_the_title", + "U. S. Grant", + {"title": "U.", "given": "S.", "family": "Grant"}, + locale="my", classification="feat(#1231)", + notes="the accepted reading, decided 2026-11-19 " + "(decisions/vocabulary-collisions, the #1231 entry): the " + "reason not to apply the pack to a mixed list; 1.4.0 through " + "3.1.0 read given 'U.', middle 'S.'"), + Case("the_burmese_pack_costs_a_dutch_particle", + "Jan van Dijk", + {"given": "Jan", "middle": "van", "family": "Dijk"}, + locale="my", classification="feat(#1231)", + notes="the cost of applying the pack to names that are not Burmese " + "(docs/languages.rst); the default reads family 'van Dijk'"), # #1257: the Maghrebi and Hebrew particles, each row checked against # the 1.4.0 wheel and master 161ebd28 on 2026-11-12 Case("an_amazigh_ait_starts_the_family_name", diff --git a/tests/v2/test_locales.py b/tests/v2/test_locales.py index 736509996..182f4ffd4 100644 --- a/tests/v2/test_locales.py +++ b/tests/v2/test_locales.py @@ -26,6 +26,7 @@ ) from nameparser._types import AmbiguityKind, Role from nameparser.locales import ja as _ja +from nameparser.locales import my as _my from nameparser.locales import ru as _ru from nameparser.locales import tr_az as _tr_az from nameparser.locales import zh as _zh @@ -118,10 +119,10 @@ def test_locales_get_and_available() -> None: assert locales.get("ru") is locales.RU assert set(locales.available()) == { "ar", "bn", "cs", "es", "es_ar", "ga", "gd", "he", "hi", "hr", "ja", "mn", - "ne", "nl", "pt", "pt_br", "ru", "sk", "sl", "tr_az", "vi", "zh"} + "my", "ne", "nl", "pt", "pt_br", "ru", "sk", "sl", "tr_az", "vi", "zh"} with pytest.raises( KeyError, - match="ar, bn, cs, es, es_ar, ga, gd, he, hi, hr, ja, mn, ne, nl, pt, pt_br, ru, sk, sl, tr_az, vi, zh"): + match="ar, bn, cs, es, es_ar, ga, gd, he, hi, hr, ja, mn, my, ne, nl, pt, pt_br, ru, sk, sl, tr_az, vi, zh"): locales.get("xx") # the segmenter FACTORY is not a locale: it is an ordinary function # on the package, so it must not appear among the codes @@ -688,6 +689,176 @@ def test_vi_differs_from_the_default_where_the_default_reads_given_first() -> No assert vi.parse(text).as_dict() == _default_parse(text) +def test_my_pack_contents() -> None: + # a choice of my, which turns on the honorifics, and a fragment that + # only removes particle readings (decisions/vocabulary-collisions, + # the 2026-11-19 #1231 entry); no policy patch + import pickle + assert locales.MY.languages == {"my"} + assert locales.MY.policy == PolicyPatch() + assert _ri.changed_words(_ri.selected(locales.MY.languages)) == {"u", "daw"} + sets = _require_packed("my").lexicon._sets + assert not set(_my._PARTICLES) & sets.particles + assert not set(_my._CREDENTIALS) & sets.suffix_acronyms + # the particles and credentials it leaves + assert {"de", "von", "del", "bin", "mac"} <= sets.particles + assert {"md", "ma", "ba", "phd"} <= sets.suffix_acronyms + assert {"u", "daw"} <= sets.titles + assert not {"u", "daw"} & Lexicon.default()._sets.titles + assert pickle.loads(pickle.dumps(locales.MY)) == locales.MY + parser = pickle.loads(pickle.dumps(parser_for(locales.MY))) + assert parser.parse("U Thein Sein").title == "U" + assert _my.DEVIATES("Aung San Win") and _my.DEVIATES("SAN-MARTIN") + assert not _my.DEVIATES("Sandra Lee") and not _my.DEVIATES("Thein Sein") + + +#: Each reading the MY fragment removes, with a name its removal alone +#: moves: the syllable between two name words, which its particle +#: reading would chain into the family name, and DO ending a name +#: written in capitals, which its credential reading would take as the +#: suffix once SAN no longer chains it (nameparser/vocab/AGENTS.md, "A +#: reading taken out") +_MY_REMOVALS = [ + ("san", "particle", "Aung San Win"), ("la", "particle", "Akyaung La Aung"), + ("le", "particle", "Saw Eh Le Htoo"), ("do", "particle", "Htan Do Kyint"), + ("da", "particle", "Thi Da Oo"), ("du", "particle", "Swam Du Naw Aung"), + ("te", "particle", "Kyauk Te Chan"), ("di", "particle", "Aung Di Win"), + ("van", "particle", "Henry Van Thio"), + ("do", "credential", "AUNG SAN DO"), +] + + +def test_each_my_removal_moves_its_own_row() -> None: + # the negative control for the fragment, as VI's: with one removal + # put back, the row that witnesses it reads otherwise + lists = {"particle": _my._PARTICLES, "credential": _my._CREDENTIALS} + assert sorted((w, k) for w, k, _ in _MY_REMOVALS) == sorted( + (w, k) for k, words in lists.items() for w in words) + my = _require_packed("my") + + def put_back(removal: tuple[str, str] | None) -> Parser: + lexicon = Lexicon.empty() + for k, words in lists.items(): + if kept := [w for w in words if (w, k) != removal]: + lexicon = lexicon.remove(*kept, kind=k) + return parser_for(dataclasses.replace(locales.MY, lexicon=lexicon)) + + rebuilt = put_back(None) + for word, kind, text in _MY_REMOVALS: + assert rebuilt.parse(text).as_dict() == my.parse(text).as_dict(), text + assert put_back((word, kind)).parse(text).as_dict() != my.parse( + text).as_dict(), (word, kind, text) + assert len(my.parse(text).family.split()) == 1, text + + +@pytest.mark.parametrize("text, given, family, suffix", [ + # the accepted cost of a removed particle in the family before a + # comma: it no longer keeps the given part after the comma from + # reading as a credential (decisions/vocabulary-collisions, the + # 2026-11-19 #1231 entry) + ("Van Buren, Ed", "Van", "Buren", "Ed"), + ("De La Cruz, Ed", "", "De La Cruz", "Ed"), + ("De La Cruz, M.J. K.L.", "", "De La Cruz", "M.J. K.L."), +]) +def test_my_costs_a_given_name_after_a_particle_and_a_comma( + text: str, given: str, family: str, suffix: str) -> None: + name = _require_packed("my").parse(text) + assert (name.given, name.family, name.suffix) == (given, family, suffix) + assert _default_parse(text)["given"] + + +@pytest.mark.parametrize("text, middle, family", [ + # the credential DO, which SAN's particle chain kept from ending a + # name written in capitals, in each comma shape, beside the mixed-case + # control (nameparser/vocab/AGENTS.md, "A reading taken out") + ("AUNG SAN DO", "SAN", "DO"), + ("Aung San Do", "San", "Do"), + ("KYAW, AUNG DO", "DO", "KYAW"), + ("Kyaw, Aung Do", "Do", "Kyaw"), + ("DAW KHIN MYA DO", "MYA", "DO"), +]) +def test_my_keeps_a_final_do_a_name_word( + text: str, middle: str, family: str) -> None: + name = _require_packed("my").parse(text) + assert (name.middle, name.family, name.suffix) == (middle, family, "") + + +@pytest.mark.parametrize("order", [GIVEN_FIRST, FAMILY_FIRST, FAMILY_FIRST_GIVEN_LAST]) +@pytest.mark.parametrize("text, title, rest", [ + # #1231: the honorific opening the name, in each comma shape and case, + # behind a listed title and before one; `rest` is the name's other + # words, which the order lays out + ("U Thein Sein", "U", ("Thein", "Sein")), + ("Daw Khin Mya", "Daw", ("Khin", "Mya")), + ("DAW KHIN MYA", "DAW", ("KHIN", "MYA")), + ("u thein sein", "u", ("thein", "sein")), + ("Dr. U Thein Sein", "Dr. U", ("Thein", "Sein")), + ("U Dr. Thein Sein", "U Dr.", ("Thein", "Sein")), + ("U Thein Sein, Jr.", "U", ("Thein", "Sein")), +]) +def test_my_reads_the_honorific_opening_a_name_as_the_title( + text: str, title: str, rest: tuple[str, ...], + order: tuple[Role, Role, Role]) -> None: + my = parser_for(locales.MY, base=Parser(policy=Policy(name_order=order))) + name = my.parse(text) + assert name.title == title + assert sorted(w for w in (name.given, name.middle, name.family) if w) == sorted(rest) + assert not name.ambiguities + + +@pytest.mark.parametrize("text, title, given, family", [ + # after a family comma, with nothing before the comma, and past the + # second comma (rules/C2); a title and one name word (rules/H1) + ("Sein, U Thein", "U", "Thein", "Sein"), + ("Sein, Daw Thein", "Daw", "Thein", "Sein"), + (", U Thein", "U", "", "Thein"), + ("Sein, Thein, U", "U", "Thein", "Sein"), + ("U Thant", "U", "", "Thant"), + ("Thant, U", "U", "", "Thant"), +]) +def test_my_reads_the_honorific_in_every_comma_shape( + text: str, title: str, given: str, family: str) -> None: + name = _require_packed("my").parse(text) + assert (name.title, name.given, name.family) == (title, given, family) + + +@pytest.mark.parametrize("text, title, given, middle, family", [ + # the accepted reading, decided 2026-11-19 (decisions/vocabulary- + # collisions, the #1231 entry): the title vocabulary reads U written + # with its full stop as it reads U under the pack, so a Western + # initial U. can be the title, as these rows show -- the reason the + # docs give not to apply the pack to a mixed list. A bare U. between + # two name words is an initial, as by default + ("U. Thein Sein", "U.", "Thein", "", "Sein"), + ("Sein, U. Thein", "U.", "Thein", "", "Sein"), + ("U. S. Grant", "U.", "S.", "", "Grant"), + ("U. Smith, Ed", "U.", "Ed", "", "Smith"), + ("Grant, U.S.", "U.S.", "", "", "Grant"), + ("U.S. Grant", "", "U.", "S.", "Grant"), + ("Smith, U.", "U.", "", "", "Smith"), + ("John (U.) Smith", "U.", "John", "", "Smith"), + ("Dr. U. Smith", "Dr. U.", "", "", "Smith"), + ("John U. Smith", "", "John", "U.", "Smith"), + ("Smith, John U.", "", "John", "U.", "Smith"), +]) +def test_my_reads_u_written_with_its_full_stop_as_the_title_vocabulary_does( + text: str, title: str, given: str, middle: str, family: str) -> None: + name = _require_packed("my").parse(text) + assert (name.title, name.given, name.middle, name.family) == ( + title, given, middle, family) + + +def test_my_differs_from_the_default_only_through_its_words() -> None: + # the honorifics and syllables move a name; a Burmese name holding + # none of them reads as the default reads it, its last word the family + my = _require_packed("my") + for text in ("Thein Sein", "Min Aung Hlaing", "Maung Maung Kyaw", + "Ko Ko Lwin", "Saw Ba Hline", "Sai Lone Hsai"): + assert my.parse(text).as_dict() == _default_parse(text), text + for text in ("U Thein Sein", "Daw Aung San Suu Kyi", "Aung San Win"): + assert my.parse(text).as_dict() != _default_parse(text), text + + def test_mn_pack_contents() -> None: # a choice of mn and a Cyrillic script order, nothing else: the # order is keyed to the script, so a romanized name keeps the @@ -2012,6 +2183,29 @@ def _default_corpus() -> list[str]: "John Smith VD", # vd, the credential leaving "John Smith, VD", # vd after a comma ] +# my (#1231): each honorific at the head, in each case and after a +# family comma; each syllable the fragment takes out, between two name +# words, as a word of its own after a comma and in one case +_ROTATORS["my"] = [ + "U Thein Sein", # u + "Daw Khin Mya", # daw + "DAW KHIN MYA", # daw, in one case + "Sein, U Thein", # u after a family comma + "Aung San Win", # san + "Akyaung La Aung", # la + "Saw Eh Le Htoo", # le + "Htan Do Kyint", # do + "Thi Da Oo", # da + "Swam Du Naw Aung", # du + "Kyauk Te Chan", # te + "Aung Di Win", # di + "Henry Van Thio", # van + "AUNG, Saw San", # san ending the given part + "AUNG SAN WIN", # san, in one case + "AUNG SAN DO", # do's credential, in one case + "KYAW, AUNG DO", # do's credential after a comma + "Thein Sein Daw.", # daw, dotted, ending the name (rules/H5) +] # hi and bn: each romanized title at the head, in each case, behind a # listed title, after a family comma and before one (rules/H6); a dotted # one where it ends the given part after a family comma (rules/H8) or diff --git a/tools/differential/cldr_agreement.py b/tools/differential/cldr_agreement.py index fdfa8464e..1acd8f252 100644 --- a/tools/differential/cldr_agreement.py +++ b/tools/differential/cldr_agreement.py @@ -164,7 +164,10 @@ "ga": "GA", "gd": "GD", "pt": "PT_BR", "es": "ES", # hi_Latn is the romanized Hindi the pack's Latin readings are for "hi": "HI", "hi_Latn": "HI", "bn": "BN", "vi": "VI", - "mn": "MN", "ar": "AR", "he": "HE", "nl": "NL"} + "mn": "MN", "ar": "AR", "he": "HE", "nl": "NL", + # CLDR's my file is in Burmese script, which the pack's + # Latin readings do not reach + "my": "MY"} #: Packs with no CLDR file to measure them on. CLDR's pt is Brazilian, #: read with PT_BR, which chooses PT's language and more; CLDR 48 has no #: pt_PT names file, and no es_AR one (its es is read with ES). diff --git a/tools/differential/cldr_agreement_locales.json b/tools/differential/cldr_agreement_locales.json index 37fa04f06..7aa057b00 100644 --- a/tools/differential/cldr_agreement_locales.json +++ b/tools/differential/cldr_agreement_locales.json @@ -1327,6 +1327,121 @@ }, "text": "Цэцэг Дорж" }, + "my/foreignFull/givenFirst": { + "family": { + "expected": "ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ", + "got": "ပရော်ဖက်ဆာ ဒေါက်တာ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင် ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ" + }, + "family_base": { + "expected": "ဝူစ်တာ ဘရူ", + "got": "ပရော်ဖက်ဆာ ဒေါက်တာ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင် ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ" + }, + "family_particles": { + "expected": "ဝူစ်တာ ဗွန်", + "got": "" + }, + "given_names": { + "expected": "အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင်", + "got": "ဒေါက်တာ" + }, + "suffix": { + "expected": "ဒေါက်တာ ဂျူနီယာ", + "got": "ဂျူနီယာ" + }, + "text": "ပရော်ဖက်ဆာ ဒေါက်တာ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင် ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ ဂျူနီယာ၊ ဒေါက်တာ", + "title": { + "expected": "ပရော်ဖက်ဆာ ဒေါက်တာ", + "got": "" + } + }, + "my/foreignFull/sorting": { + "family": { + "expected": "ဝူစ်တာ ဘရူ ဝူစ်တာ ဗွန်", + "got": "ဝူစ်တာ ဘရူ" + }, + "family_particles": { + "expected": "ဝူစ်တာ ဗွန်", + "got": "" + }, + "given_names": { + "expected": "အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင်", + "got": "အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင် ဝူစ်တာ ဗွန်" + }, + "text": "ဝူစ်တာ ဘရူ၊ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင် ဝူစ်တာ ဗွန်" + }, + "my/foreignFull/surnameFirst": { + "family": { + "expected": "ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ", + "got": "ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ ပရော်ဖက်ဆာ ဒေါက်တာ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင်" + }, + "family_base": { + "expected": "ဝူစ်တာ ဘရူ", + "got": "ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ ပရော်ဖက်ဆာ ဒေါက်တာ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင်" + }, + "family_particles": { + "expected": "ဝူစ်တာ ဗွန်", + "got": "" + }, + "given_names": { + "expected": "အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင်", + "got": "ဒေါက်တာ" + }, + "suffix": { + "expected": "ဒေါက်တာ ဂျူနီယာ", + "got": "ဂျူနီယာ" + }, + "text": "ဝူစ်တာ ဗွန် ဝူစ်တာ ဘရူ ပရော်ဖက်ဆာ ဒေါက်တာ အာဒါ ကွန်နီလီယာ ဆီဇာ မာတင် ဂျူနီယာ၊ ဒေါက်တာ", + "title": { + "expected": "ပရော်ဖက်ဆာ ဒေါက်တာ", + "got": "" + } + }, + "my/nativeFull/givenFirst": { + "family": { + "expected": "ဝူစ်တာ", + "got": "မစ္စတာ ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ် ဝူစ်တာ" + }, + "family_base": { + "expected": "ဝူစ်တာ", + "got": "မစ္စတာ ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ် ဝူစ်တာ" + }, + "given_names": { + "expected": "ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ်", + "got": "ဒေါက်တာ" + }, + "suffix": { + "expected": "ဂျူနီယာ ဒေါက်တာ", + "got": "ဂျူနီယာ" + }, + "text": "မစ္စတာ ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ် ဝူစ်တာ ဂျူနီယာ၊ ဒေါက်တာ", + "title": { + "expected": "မစ္စတာ", + "got": "" + } + }, + "my/nativeFull/surnameFirst": { + "family": { + "expected": "ဝူစ်တာ", + "got": "ဝူစ်တာ မစ္စတာ ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ်" + }, + "family_base": { + "expected": "ဝူစ်တာ", + "got": "ဝူစ်တာ မစ္စတာ ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ်" + }, + "given_names": { + "expected": "ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ်", + "got": "ဒေါက်တာ" + }, + "suffix": { + "expected": "ဂျူနီယာ ဒေါက်တာ", + "got": "ဂျူနီယာ" + }, + "text": "ဝူစ်တာ မစ္စတာ ဘာထရမ် ဝဲလ်ဘာဖို့စ် ဟင်နရီ ရောဘတ် ဂျူနီယာ၊ ဒေါက်တာ", + "title": { + "expected": "မစ္စတာ", + "got": "" + } + }, "ne/foreignFull/givenFirst": { "family": { "expected": "भोन ब्रुहल", diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index bb5cd2400..44575a273 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -1740,6 +1740,7 @@ "Torres Sánchez-Cid Andrés" "Treadwell, U.S. District Judge Marc" "Ts. Dr. Norziha Che Him" +"U Thant" "U.S. District Judge Marc Thomas Treadwell" "U.S. Grant" "U.S. Grant Smith, John" diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index 2b4e55aba..f5150b4a0 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -4368,6 +4368,7 @@ {"name": "Tschurtschenthaler, Anton von", "given": "Anton", "family": "von Tschurtschenthaler", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "A. T."} {"name": "Tunde Seun Okeke", "given": "Tunde", "middle": "Seun", "family": "Okeke", "initials": "T. S. O."} {"name": "U Kyaw Win", "given": "U", "middle": "Kyaw", "family": "Win", "initials": "U. K. W."} +{"name": "U Thant", "given": "U", "family": "Thant", "initials": "U. T."} {"name": "U. S. Grant", "given": "U.", "middle": "S.", "family": "Grant", "initials": "U. S. G."} {"name": "U.S. District Judge Marc Thomas Treadwell", "title": "U.S. District Judge", "given": "Marc", "middle": "Thomas", "family": "Treadwell", "initials": "M. T. T."} {"name": "U.S. Grant", "given": "U.", "middle": "S.", "family": "Grant", "initials": "U. S. G."}