From 5ba79720bdf304a3198db29aa498714ac7738a86 Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Sat, 21 Nov 2026 19:59:18 -0800 Subject: [PATCH 1/5] Read Ra as a Korean family name and given name, not only a credential and a title (#1483) ra was en.toml's ungated credential and de.toml's academic title with no name reading, so it was the suffix ending a name in any case (Kim Ra, Sang Hak Ra) and the title opening one (Ra Mi Kim), though Korean names bear it as a surname and a given name. ko.toml gives it a family and a given reading (decisions/vocabulary-collisions' C-i), which derive the gated markers: the credential needs a word to spare and the case signal (rules/S4, the ambiguous acronym needing words to spare; rules/S6, the case signal at the suffix slot) and the title reads only inside a title phrase (rules/H9). After a comma, past a second one and written R.A., the word keeps the credential. de.toml gains a credential reading for ra beside its academic title, so a plain German choice, which turns en.toml's credential off, reads 'Hans Muller, RA' as the suffix instead of reversing the name. The default compile is byte-identical for it. Rule examples, case rows, code comments and the paired-initials benchmark that used RA as a title/suffix dual now write VC (LT for the row naming a rank), each read as RA was under 1.4.0, 2.2.0, 2.3.0 and master. Tests that used ra as a word a strict choice reads differently now use Ae and an invented credential. The snapshot, the CLDR record and the shapes and rules corpora are re-recorded. Decided 2026-11-21. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- .../design/decisions/vocabulary-collisions.md | 9 +- ...ential-opening-the-part-after-the-comma.md | 2 +- .../C5-paired-initials-after-the-comma.md | 2 +- docs/design/rules/H3-title-runs-floor.md | 2 +- ...t-vocabulary-still-has-to-name-somebody.md | 4 +- .../rules/H6-title-before-a-family-comma.md | 2 +- ...-bracketed-credential-is-not-a-nickname.md | 4 +- ...S7-company-of-an-unambiguous-credential.md | 2 +- docs/languages.rst | 5 +- docs/locales.rst | 20 +- docs/migrate.rst | 30 ++- docs/release_log.rst | 1 + nameparser/_parser.py | 2 +- nameparser/_pipeline/_assign.py | 4 +- nameparser/_pipeline/_comma.py | 2 +- nameparser/_pipeline/_pieces.py | 2 +- nameparser/_pipeline/_vocab.py | 2 +- nameparser/config/_compiled.py | 3 +- nameparser/config/_index.py | 2 +- nameparser/vocab/de.toml | 1 + nameparser/vocab/ko.toml | 5 + tests/v2/cases.py | 173 ++++++++++++++---- tests/v2/pipeline/test_pieces.py | 22 +-- tests/v2/test_benchmark.py | 9 +- tests/v2/test_cases.py | 12 +- tests/v2/test_locales.py | 5 +- tests/v2/test_name_usage_tool.py | 12 +- tests/v2/test_parser.py | 51 +++++- tests/v2/test_reading_index.py | 7 +- tools/differential/cldr_agreement.json | 10 +- tools/differential/corpus_rules.jsonl | 14 +- tools/differential/corpus_shapes.jsonl | 4 +- tools/differential/snapshot.jsonl | 20 +- 34 files changed, 328 insertions(+), 119 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 46af78205..980997425 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -385,7 +385,7 @@ Don't use the bare `python3 -m doctest .rst` CLI (no `optionflags`) to che **`pr/NNN` local branches** track upstream PRs — don't commit to them by accident. Check `git branch --show-current` before starting work. -**Title vs suffix is positional for BARE words, and the leading period-abbreviation rule overrides even that** — a word matching `TITLES` at the front of a name becomes `title`; the same word matching `SUFFIX_ACRONYMS`/`SUFFIX_WORDS` at the end becomes `suffix` (never both, regardless of the word's real-world meaning). The `TITLES`/suffix overlap was audited in #296 (2026-08-23): the pure postnominals (`jr`, `junior`, `phd`, `do`, `se`) left `TITLES`, the v1-residue `dr`/`sra` left the suffix sets, and the eleven words in both on 2026-11-21 (`ms`, `sr`, `lt`, `ra`, `vc`, the ranks `cpl`, `cpo`, `cpt`, `csm`, `sgm`, and since #1128 the Cyrillic `д-р`; `md` and `sa` were duals too until #853 took `md`'s title reading out, a leading `Md` being the given name Muhammad, and #857 took `sa` out of the vocabulary) are deliberate duals that position decides (recount with `L = Parser().lexicon._sets; sorted(L.titles & (L.suffix_acronyms | L.suffix_words))`). External test sources (old issue gists, etc.) sometimes assert `suffix` for a leading professional abbreviation like `RA`/`PD`/`Dipl.-Ing.` — that's the source data being wrong, not a parser bug. Verify position before "fixing" it. Two qualifications the older "purely positional" wording papered over, the first measured 2026-08-01 and the second answered 2026-09-08 (#316): a PERIOD-marked leading word is claimed by the shape rule before any vocabulary is read (`"Esq. Smith"` → `title`, though `esq` is suffix-only), save a listed title and, since #789, a given name written short (`"Chas. Smith"` → `given`), while a run of single letters, which the shape rule never takes, is a title at the head only by rules/H10's vocabulary (`"U.S. Senator John Smith"` → `title='U.S. Senator'`), and a PERIOD-marked trailing word is claimed by VOCABULARY — first the suffix sets, which the peel reads before anything else (`"John Smith Esq."` → `suffix`), then the titles (`"John Smith Prof."` → `title='Prof.'`, `rules/H5`) — while an unlisted abbreviation there stays a name part (`"John Smith Xyz."` → `family='Xyz.'`) unless it is written as two or more period-separated chunks, which since 2.4 IS a trailing shape rule (`Policy.unlisted_dotted_suffixes`, default on: `"John Smith X.Y.Z."` → `suffix='X.Y.Z.'`, read by the same words-to-spare count a bare ambiguous acronym takes, `rules/S3`), except paired initials in a script with capitals, which stay a name word (`"Ram Bahadur B.K."` → `family='B.K.'`, #864). The SINGLE trailing period is still not one, deliberately — it is the abbreviation shape any word can wear. The bare word is where "positional" still holds whole -- outside a part past the second comma, which holds no name word, so C2 reads a bare title word there as a title since #603 (`Eric H. Holder, Jr., Attorney General`), and outside a listed salutation ending the given part after a family comma, which rules/H8 reads as the title since #835 (`Doe, Jane Mrs`), the comma having marked the surname's place -- and the reason it must: `TITLES` holds words that are in no suffix set — 787 of them on 2026-10-11 (746 before #606's salutations), measured with `L = Parser().lexicon._sets; len(L.titles - L.suffix_acronyms - L.suffix_words)`, a figure that grows with the vocabulary and never shrinks the argument — and many are ordinary surnames (`pope`, `bishop`, `judge`, `sheriff`, `baron`, `master`, ...), so a vocabulary-first rule over BARE trailing words would read `"Mary Jane Pope"` as `title='Pope'`, `family='Jane'`. The period is what separates the safe case from that one, and it separates it by being a WRITING convention rather than by making the collision go away: `"Mary Jane Pope"` keeps `family='Pope'` while `"Mary Jane Pope."` reads `title='Pope.'`, `family='Jane'`, a cost accepted under the input-is-a-name premise rather than one the rule prevents (the trailing-position bullet in decisions/vocabulary-exclusions, measured 2026-09-09). Since #316 that sentence describes the shipped rule rather than an aspiration. +**Title vs suffix is positional for BARE words, and the leading period-abbreviation rule overrides even that** — a word matching `TITLES` at the front of a name becomes `title`; the same word matching `SUFFIX_ACRONYMS`/`SUFFIX_WORDS` at the end becomes `suffix` (never both, regardless of the word's real-world meaning). The `TITLES`/suffix overlap was audited in #296 (2026-08-23): the pure postnominals (`jr`, `junior`, `phd`, `do`, `se`) left `TITLES`, the v1-residue `dr`/`sra` left the suffix sets, and the ten words in both on 2026-11-21 (`ms`, `sr`, `lt`, `vc`, the ranks `cpl`, `cpo`, `cpt`, `csm`, `sgm`, and since #1128 the Cyrillic `д-р`; `md`, `sa` and `ra` were duals too until #853 took `md`'s title reading out, a leading `Md` being the given name Muhammad, #857 took `sa` out of the vocabulary, and #1483 gave `ra` a Korean name reading, which makes its title one only inside a title phrase, rules/H9) are deliberate duals that position decides (recount with `L = Parser().lexicon._sets; sorted(L.titles & (L.suffix_acronyms | L.suffix_words))`). External test sources (old issue gists, etc.) sometimes assert `suffix` for a leading professional abbreviation like `RA`/`PD`/`Dipl.-Ing.` — that's the source data being wrong, not a parser bug. Verify position before "fixing" it. Two qualifications the older "purely positional" wording papered over, the first measured 2026-08-01 and the second answered 2026-09-08 (#316): a PERIOD-marked leading word is claimed by the shape rule before any vocabulary is read (`"Esq. Smith"` → `title`, though `esq` is suffix-only), save a listed title and, since #789, a given name written short (`"Chas. Smith"` → `given`), while a run of single letters, which the shape rule never takes, is a title at the head only by rules/H10's vocabulary (`"U.S. Senator John Smith"` → `title='U.S. Senator'`), and a PERIOD-marked trailing word is claimed by VOCABULARY — first the suffix sets, which the peel reads before anything else (`"John Smith Esq."` → `suffix`), then the titles (`"John Smith Prof."` → `title='Prof.'`, `rules/H5`) — while an unlisted abbreviation there stays a name part (`"John Smith Xyz."` → `family='Xyz.'`) unless it is written as two or more period-separated chunks, which since 2.4 IS a trailing shape rule (`Policy.unlisted_dotted_suffixes`, default on: `"John Smith X.Y.Z."` → `suffix='X.Y.Z.'`, read by the same words-to-spare count a bare ambiguous acronym takes, `rules/S3`), except paired initials in a script with capitals, which stay a name word (`"Ram Bahadur B.K."` → `family='B.K.'`, #864). The SINGLE trailing period is still not one, deliberately — it is the abbreviation shape any word can wear. The bare word is where "positional" still holds whole -- outside a part past the second comma, which holds no name word, so C2 reads a bare title word there as a title since #603 (`Eric H. Holder, Jr., Attorney General`), and outside a listed salutation ending the given part after a family comma, which rules/H8 reads as the title since #835 (`Doe, Jane Mrs`), the comma having marked the surname's place -- and the reason it must: `TITLES` holds words that are in no suffix set — 787 of them on 2026-10-11 (746 before #606's salutations), measured with `L = Parser().lexicon._sets; len(L.titles - L.suffix_acronyms - L.suffix_words)`, a figure that grows with the vocabulary and never shrinks the argument — and many are ordinary surnames (`pope`, `bishop`, `judge`, `sheriff`, `baron`, `master`, ...), so a vocabulary-first rule over BARE trailing words would read `"Mary Jane Pope"` as `title='Pope'`, `family='Jane'`. The period is what separates the safe case from that one, and it separates it by being a WRITING convention rather than by making the collision go away: `"Mary Jane Pope"` keeps `family='Pope'` while `"Mary Jane Pope."` reads `title='Pope.'`, `family='Jane'`, a cost accepted under the input-is-a-name premise rather than one the rule prevents (the trailing-position bullet in decisions/vocabulary-exclusions, measured 2026-09-09). Since #316 that sentence describes the shipped rule rather than an aspiration. ### Tests (`tests/`) diff --git a/docs/design/decisions/vocabulary-collisions.md b/docs/design/decisions/vocabulary-collisions.md index 596e4350b..53231fb8e 100644 --- a/docs/design/decisions/vocabulary-collisions.md +++ b/docs/design/decisions/vocabulary-collisions.md @@ -32,6 +32,7 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - `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` and nothing else, turns on; a list of nothing but Burmese names is read with the strict choice, `parser_for(locales.MY, strict=True)`, which reads Burmese name syllables (`san`, `van`, `pe`, `ei`) as name words by reading no other language's file, and my.toml copies `en.toml`'s readings of the English ranks and `sir` such lists write, `default = false`, so the strict choice keeps them — 2026-11-19 #1483; `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. - German `aus` is a particle by default with a `given` reading beside it, keeping `Aus` positional where it opens a name; the accepted cost is that anywhere after the head it starts the family (`Kevin Aus Smith`, `Rahman, Mohammed Aus`, and under FAMILY_FIRST `Rahman Mohammed Aus`), that case repair writes it lower case, and that a capital `Aus` opening a family-first name is placed like `Van` — 2026-11-20 #1284. +- `ra` carries a `family` and a `given` reading in ko.toml, the Korean surname and given name, so en.toml's credential and de.toml's credential are gated (rules/S4) and de.toml's academic title is a title only inside a title phrase (rules/H9): `Kim Ra` and `Sang Hak Ra` keep `Ra` a name word, `Ra Mi Kim` and `RA Müller` read it as the given name, and `John Smith, RA`, `Jane Doe, PT, RA` and `Jane Doe, R.A.` keep the credential; de.toml's own credential keeps it after the name under a plain German choice, which turns en.toml's off — 2026-11-21 #1483. ## Log @@ -110,7 +111,7 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - **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. -- 2026-11-19 #1483 — A WHOLLY BURMESE LIST IS READ WITH A STRICT CHOICE OF `my`; `LOCALES.MY`'S FRAGMENT IS DROPPED; MY.TOML COPIES THE ENGLISH RANKS; PROPOSAL A IS DROPPED. SUPERSEDES: the 2026-11-19 #1231 entry's fragment (its syllables bullet, its `DEVIATES` and the fragment's costs in its Accepted bullet); its honorifics, its `U.` reading and their costs stand. Decided on the issue (its two 2026-11-19 comments), after it found five Burmese syllables the #1231 fragment had not listed reading as credentials ending a name written in capitals (`THEIN AUNG PE` → suffix 'PE'; `pe`, `lat`, `ei`, `si`, `pa`, and `ra`, ungated). A removal list names other languages' words, so it fails silently twice: removing a reading no longer there raises nothing, in a lexicon or a pack, and a reading another language gains later is not on the list, which misreads names and which no test can name (checked on master `d12af9d6`). A strict choice names no other language's word, so neither can happen to it; nameparser/locales/AGENTS.md now asks for it to be measured before a pack removes readings. +- 2026-11-19 #1483 (its Proposal B sentence superseded by 2026-11-21 #1483, below) — A WHOLLY BURMESE LIST IS READ WITH A STRICT CHOICE OF `my`; `LOCALES.MY`'S FRAGMENT IS DROPPED; MY.TOML COPIES THE ENGLISH RANKS; PROPOSAL A IS DROPPED. SUPERSEDES: the 2026-11-19 #1231 entry's fragment (its syllables bullet, its `DEVIATES` and the fragment's costs in its Accepted bullet); its honorifics, its `U.` reading and their costs stand. Decided on the issue (its two 2026-11-19 comments), after it found five Burmese syllables the #1231 fragment had not listed reading as credentials ending a name written in capitals (`THEIN AUNG PE` → suffix 'PE'; `pe`, `lat`, `ei`, `si`, `pa`, and `ra`, ungated). A removal list names other languages' words, so it fails silently twice: removing a reading no longer there raises nothing, in a lexicon or a pack, and a reading another language gains later is not on the list, which misreads names and which no test can name (checked on master `d12af9d6`). A strict choice names no other language's word, so neither can happen to it; nameparser/locales/AGENTS.md now asks for it to be measured before a pack removes readings. - **The strict choice against the pack**, on the 2,990 names of the #1231 entry's population, read by the same scratch probe (an opening `U` or `Daw` the title, the last word the family; `Mg` counted neither way), measured on master `4b0b9441` before this change and again on this branch (on master `12b568f8`) with the fragment rebuilt in a scratch lexicon and the rank readings left out of the strict choice, the same counts on both: `Parser()` 2,834 as written (94.8%) and 2,825 with every name upper-cased (94.5%); the pack with its fragment 2,987 (99.9%) and 2,977 (99.6%); `parser_for(locales.MY, strict=True)` 2,980 (99.7%) in both writings; a strict choice of `my` with an empty fragment the same names as the strict pack in both writings, and on 361,391 names of the committed corpus and ClinicalTrials.gov's officials, the fragment being inert under strict, which never loads the files whose readings it removed. Upper-cased, strict read 12 names the pack missed, holding `PE` (4 names), `LAT` (3), `EI` (2), `RA` (2), `SI` (1) and a doubled `PA` (1), one name holding two of them, and as written the 2 ending in `Ra`; this entry's probe counts the default 2,834 where the #1231 entry's counted 2,835, a one-name difference between the two probe versions that was not traced, the pack's 2,987 agreeing; it read the 10 `Mg` names as #1232 asks (`Mg Htoo Aung` → given 'Mg'), where the default and the pack read en.toml's military `MG`. It lost 9 names in both writings, to their bare English ranks and, in one of them, `Sir` (`General` 7, `Lieutenant` 3, `Senior` 2, `Admiral` 1, `Vice` 1 as title words), ranks written with their full stops being kept by H2's shape. - **The ranks.** my.toml now holds the English ranks and `sir`, each a copy of en.toml's reading with its properties (`same_as`, `attaches`, `abbreviation`, `addresses`), written `default = false` so the default never reads them: `senior`, `vice`, `rear` (modifiers), `general`, `gen`, `lieutenant`, `lt`, `major`, `maj`, `brigadier`, `brig`, `colonel`, `col`, `captain`, `capt`, `admiral`, `adm`, `commodore`, `commander`, `cdr`, and `sir`; the population writes the first five that are words of their own and `Sir`, the rest are the Tatmadaw's ranks as staff lists write them. ORCID's Myanmar given and family boxes hold none of the 21 (1,755 holders in `tools/name_usage.py --country MM`'s index, which counts every record whose country is Myanmar; the #1231 entry's 1,737 is the issue comment's count, 2026-11-19). A choice holding a vocabulary reading of a word drops every other file's (`choose`'s prefer step), so `lt`'s credential is copied with its rank: without it the plain pack read `John Smith, LT` title 'LT', found by the builder before commit. The plain pack reads every rank in its fields as the default does (`_compiled.py` and `changed_words` unchanged; `Reading.languages` names `my` for the 21 words there, the file the choice reads), and the strict choice reads `gen`, `maj`, `brig` and `major` without en.toml's given readings, so a bare one opening a name is the rank there (`Gen Goto` → title 'Gen'), the four words joining tests/v2/test_reading_index.py's `STRICT_UNGATED` for `my`. With them, on this branch: the strict choice 2,989 of 2,990 in both writings (100.0%), the one left a string holding two names, which every configuration misreads. - **The fragment, dropped.** Measured first on this branch, as the decision required, both sides on it: the pack without its fragment reads 2,932 names right as written (98.1%), 55 fewer than with it (2,987) (the estimate was about 55), and 2,923 upper-cased (97.8%), 54 fewer than its 2,977; every name the two read differently is one the fragment read right (`san` 39, `la` 7, `van`, `te`, `da` 2 each, `do`, `le`, `du` 1 each, as written). So `locales.MY` is the choice of `my` alone, declaring no `DEVIATES`, and the #1231 entry's accepted costs of the fragment (`Jan van Dijk`, `Van Buren, Ed`, the credential DO) no longer apply to the plain pack; a caller reading a mixed list plainly reads those syllables as the default does, and one reading a wholly Burmese list chooses strictly. The fragment was unreleased. @@ -120,3 +121,9 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - 2026-11-20 #1284 — GERMAN `AUS` IS A PARTICLE BY DEFAULT, WITH A `GIVEN` READING BESIDE IT. Decided 2026-11-20. SUPERSEDES: decisions/R12's 2026-11-09 #1224 entry's accepted `KAREN AUS DER FÜNTEN` → 'Karen Aus Der Fünten', `aus` being listed now. `Karen aus der Fünten` read middle 'aus', family 'der Fünten'; de.toml lists `aus` as a `preposition`, as it lists `auf`. Unlike `auf` it is not written `may_be_given = false`: `Aus` is an Arabic and Indonesian given name (ORCID given boxes 14, PatentsView 5), and as a never-given particle rules/P1's fold read 6 corpus names opening with it whole as the family (`Aus Rahman`-shaped). With the `given` reading the word stays positional at the head, reported `particle-or-given` (`Aus Rahman`), C-i's marking. - **Accepted:** the given reading protects the head of a name only (`Aus Rahman`, `Dr. Aus Rahman`). Anywhere after it `Aus` starts the family and takes the rest of the name (`Kevin Aus Smith` → family 'Aus Smith'; `Mohammed Aus Khalid Rahman` → family 'Aus Khalid Rahman'), and ending the given part after a family comma it joins the family (`Rahman, Mohammed Aus` → family 'Aus Rahman', reported `particle-or-given`), as it does in that name's family-first writing under FAMILY_FIRST (`Rahman Mohammed Aus` → family 'Aus Rahman', where FAMILY_FIRST_GIVEN_LAST still reads given 'Aus'); none of the 24 local-corpus names holding the word takes either shape. Case repair writes the particle lower case, in a name written in capitals (`MOHAMMED AUS RAHMAN` → `Mohammed aus Rahman`; FEC's `J AUS, JENNIFER` → `Jennifer J aus`, the one such name in the corpora, its fields unchanged) and under `force=True` (`Ahmad Aus Ibrahim` → `Ahmad aus Ibrahim`). Under both family-first orders a leading capital `Aus` is placed like `Van` (`Aus der Fünten Karen` → family 'Aus', reported), the lower-case `aus der Fünten Karen` reading right. - **Measured** 2026-11-20 against a checkout of master `0d8c6fa8`: `local_agreement.py orcid-researchers --base`, 1 record fixed (an `aus der` family box), 0 broken; psc-individuals, none moved by the word; `snapshot.py --local fec-individuals --base`, the case repair above; ctgov-officials, `Karen aus der Fünten, MD, MChiro`-shaped names gaining the family; the committed snapshot, `KAREN AUS DER FÜNTEN` (family 'AUS DER FÜNTEN', repaired `Karen aus der Fünten`), which takes rules/R12's `aus der` example out of its Accepted bullet (`unter der` stands there now). Recompute: those commands with `--base `; the 6 names and the 24 by `config_diff.py diff default 'expr:Parser(lexicon=Lexicon.default().remove("aus", kind="given"))' --local all --match` over the word, the given reading removed leaving the never-given particle, which lists the names matched and moved; the bearer counts are on the word (`tools/vocab/query.py --word aus`). +- 2026-11-21 #1483 — `RA` IS A KOREAN FAMILY NAME AND GIVEN NAME BY DEFAULT (PROPOSAL B), AND DE.TOML READS IT AFTER THE NAME AS A CREDENTIAL. Decided 2026-11-21. SUPERSEDES: the 2026-11-19 #1483 entry's sentence leaving Proposal B open. `ra` was en.toml's ungated credential and de.toml's academic title (Rechtsanwalt) with no name reading, so it was the suffix ending a name in any case (`Kim Ra`, `Sang Hak Ra`) and the title opening one (`Ra Mi Kim`), though it is borne as both. C-i asks for the marking where a word is borne in the position its claim acts on: Korean surnames end a name written given first and Korean given names open one. + - **The readings.** ko.toml gives `ra` a `family` and a `given` reading, the file of the language whose names carry it (nameparser/vocab/README.md); mul.toml was declined, since every strict choice reads it, `en` among them, which would gate the credential in English lists, and a my.toml copy moves nothing, a strict `my` choice already reading the word as a name. The bearer counts are on the entry (`tools/name_usage.py Ra --boxes`, 2026-11-21): ORCID's boxes in Korea hold it 25 times as a given name and 37 as a family name, PatentsView's Korean inventors 135 and 100, the US SSA 251 births, the US Census 1,458 surnames (72.5% asian/PI), ORCID's Myanmar given boxes 2 of 1,755 holders. The name readings derive the gated markers (`SUFFIX_ACRONYMS_AMBIGUOUS`, and `TITLES_AMBIGUOUS` in place of `TITLES`), so the credential needs a word to spare and the case signal (rules/S4, rules/S6) and the title reads only inside a title phrase (rules/H9). Family alone was declined on the measurement made for the decision, re-taken here: it leaves de.toml's title ungated past a second comma, where rules/C2 reads a bare title word (`Jane Doe, PT, RA` title 'RA', 5 names) and after a family comma written in capitals (`KING, RA`, 9 FEC names, suffix to title). + - **de.toml's credential.** A plain German choice turns the other files' vocabulary readings of a word off where de.toml holds one, so with the name readings on it lost en.toml's credential and read a lone `RA` after a family comma as the given name (`Hans Müller, RA` → given 'RA', family 'Hans Müller'; master read title 'RA'). de.toml now carries a `credential` reading beside its academic title, Rechtsanwalt written after the name, which the default compile already held through en.toml (`_compiled.py` byte-identical, build checks 4 and 5 passing). Under a plain German choice `Hans Müller, RA`, `Müller, RA` and `John Smith, RA` read suffix 'RA', `Hans Müller, LL.M., RA` suffix 'LL.M., RA' and `Hans Müller RA` suffix 'RA', where master read title 'RA' after a comma and family 'RA' with none. A strict German choice, which reads no ko.toml, keeps the title in front (`RA Müller`, `RA Dr. Hans Müller`) and now reads the credential behind it; it and a strict English choice ungate `ra`, which joins tests/v2/test_reading_index.py's reviewed table. + - **Accepted costs.** (1) `RA` opening a German name is the given name (`RA Müller` → given 'RA'), by default and under a plain German choice, a choice never dropping a name reading and no German pack existing; no corpus name writes Rechtsanwalt in front. (2) A gated credential written without its last full stop is no dotted acronym (rules/S3), so a one-word part after a family comma reads as the given name, the name reversed: `Jane Doe, R.A` → given 'R.', middle 'A', family 'Jane Doe' (4 ClinicalTrials.gov names, 2 people). It is the class's reading already (`Jane Doe, M.A` and `Jane Doe, B.A` read so on master), classify asking the gated set with the stop inside the word, so keeping the suffix means widening that test for every gated acronym, not a vocabulary change; left. A bracketed `R.A.` inside a name reads as a middle name for the same class reason (`John (R.A.) Smith`, as `John (M.A.) Smith` on master). (3) A name written wholly in capitals gives no case signal, so `KIM MI RA` keeps suffix 'RA', and `KING, RA` reads given 'RA' (initials, which FEC's filers mean); not fixed. (4) The fictional CLDR rendering `Dut.ra Maria Silva` reads given 'Dut.ra' where it read title (the CLDR record re-recorded), and `Sang Hak Dut.ra` reads suffix 'Dut.ra', the glued chunk now a gated acronym with words to spare. (5) `Kim RA, Jr.`: the capitals settle the credential, leaving `Kim` a lone given name (rules/O5) where the title reading had left it the family. + - **The examples that used RA as a dual.** Eight rule examples, one rule sentence and eight case rows used `RA` as a word of both the title and the suffix vocabulary, which it no longer is (rules/H3, H4, H6, S1, S7, C5 and C13). Each now writes `VC`, a row naming a rank `LT`; each spelling reads as `RA` did under 1.4.0, 2.2.0 and 2.3.0 and on master, measured 2026-11-21, so the notes' version claims stand. So do the code comments and the paired-initials benchmark (its counts re-taken: 35 and 131 `is_suffix_piece` calls on the tree, 120 and 1,620 at 47fb2b21, as with `RA`). + - **Measured** on 2026-11-21 against a checkout of master `81a24221`. `config_diff.py diff "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='family').remove('ra', kind='given'))" "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='given'))" default --committed --local all --match '(?i)(?>> korean.parse("Kim Do Hyun").middle, korean.parse("Kim Do Hyun").family ('Do', 'Hyun') - >>> parse("Kim Min Ra").suffix - 'Ra' - >>> korean.parse("Kim Min Ra").family - 'Ra' + >>> parse("Kim Min Ae").suffix + 'Ae' + >>> korean.parse("Kim Min Ae").family + 'Ae' Chinese ``De`` is the same case under strict ``zh``: ``De Xu`` reads given ``De``, family ``Xu``. @@ -1088,8 +1088,8 @@ What a strict choice drops it drops from every name: >>> korean.parse("Kim Min Jun, PhD, MSc").suffix 'PhD, MSc' - >>> parser_for(ko, en, strict=True).parse("Kim Min Ra").suffix - 'Ra' + >>> parser_for(ko, en, strict=True).parse("Kim Min Ae").suffix + 'Ae' >>> korean.parse("Kim Min Jun, RN").given 'RN' >>> parser_for(ko, en, strict=True).parse("Kim Min Jun, RN").suffix diff --git a/docs/migrate.rst b/docs/migrate.rst index b0bb9ab96..cd3a28749 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -910,7 +910,7 @@ list, with reasoning, is in each release's section of - :ref:`migrate-3-1` * - 3.2 - Dutch ``Oude``, Malaysian ``a/l``, ``a/p`` and ``anak``, - religious titles before a name + religious titles before a name, Korean ``Ra`` - :ref:`migrate-3-2` Each entry says what it compares with. The lists of readings through @@ -2475,3 +2475,31 @@ patronymic as the family name. The default parse is unchanged: ('Олена', 'Коваленко', 'Петрівна') >>> parse("Коваленко Олена Петрівна").family 'Петрівна' + +Ra as a Korean name +^^^^^^^^^^^^^^^^^^^ + +``Ra``, a Korean family name and given name, reads as a name where it +ends or opens one, where 1.4.0 through 3.1.0 read it as the credential +RA ending a name and the title RA (Rechtsanwalt) opening one. After a +comma, or written ``R.A.``, it is still the credential, and ``RA`` +opening a German name is now the given name: + +.. doctest:: + + >>> sang_hak = parse("Sang Hak Ra") + >>> sang_hak.middle, sang_hak.family, sang_hak.suffix + ('Hak', 'Ra', '') + >>> parse("Ra Mi Kim").given + 'Ra' + >>> parse("John Smith, RA").suffix + 'RA' + +To read it as 3.1 did, remove its two name readings: + +.. doctest:: + + >>> as_31 = Parser(lexicon=Lexicon.default().remove("ra", kind="family") + ... .remove("ra", kind="given")) + >>> as_31.parse("Sang Hak Ra").suffix + 'Ra' diff --git a/docs/release_log.rst b/docs/release_log.rst index d19c8d93e..9b99d3d26 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -4,6 +4,7 @@ Release Log nameparser 3.2 is under development. + - **Read Ra as a Korean family name and given name, not only as a credential and a title.** ``parse("Sang Hak Ra")`` gives middle ``Hak``, family ``Ra``, where 1.4.0 through 3.1.0 gave family ``Hak``, suffix ``Ra``; ``RA`` after a comma, or written ``R.A.``, is still the credential, and ``RA`` opening a German name (Rechtsanwalt) is now the given name. :issue:`1483` - **Read the Cyrillic doctorate д-р ending a name as a credential, and the Bulgarian д.м. under a Bulgarian choice.** ``parse("Іван Петренко д-р")`` gives family ``Петренко``, suffix ``д-р``, where 1.4.0 through 3.1.0 gave middle ``Петренко``, family ``д-р``; in front of the name ``д-р`` stays the title, and after a comma it is the suffix too (``Іван Петренко, д-р``). With Bulgarian chosen (``languages=frozenset({"bg"})``), ``доц. д-р Мария Петрова, д.м.`` gives title ``доц. д-р``, family ``Петрова``, suffix ``д.м.``; by default it gives given ``д.м.``, family ``доц. Мария Петрова``, suffix ``д-р``, where 1.4.0 through 3.1.0 kept ``д-р`` in the family. :issue:`1128` - **Read Bc and Ing as titles under locales.CS, written bare or two joined by et.** ``parser_for(locales.CS).parse("Ing. et Ing. Jan Novák")`` gives title ``Ing. et Ing.``, given ``Jan``, family ``Novák``, where 3.0.0 through 3.1.0 gave given ``Ing. et Ing.``, family ``Jan Novák``; the default is unchanged. Under the pack a name that opens with the given name Ing reads it as the title (``Ing Wei Lim``), and initials ``BC`` after a comma read as the title too (``MOSS, BC``); a strict choice of ``cs`` or ``sk`` now keeps ``et`` between two degrees the pack reads (``Mgr. et Mgr.``). :issue:`970` - **Read an unlisted credential written in mixed case after a full name and a comma, such as MRes or AuD.** ``parse("Jane Smith, MRes")`` gives suffix ``MRes``, where 1.4.0 through 3.1.0 gave given ``MRes``, family ``Jane Smith``; the word must open with two capitals or end in one, so ``LeBron`` and ``PhDc`` stay given names, while a given name written so after a two-word surname reads as the credential (``García López, DAndre``). Behind one word it stays the given name (``Smith, MRes``), save behind initials spelling a credential, which read as the credential with it (``Smith, M.B. ChB``, and ``Jansen, J.P. IJsbrand``, which loses its given name). The positions only ``CapsSuffixes.EVERYWHERE`` reads still take words in capitals alone (``Alex Lee ONeill`` keeps family ``ONeill``). :issue:`1517` diff --git a/nameparser/_parser.py b/nameparser/_parser.py index c395c0743..1c3ca5f19 100644 --- a/nameparser/_parser.py +++ b/nameparser/_parser.py @@ -244,7 +244,7 @@ def revise(self, name: ParsedName, **fields: str) -> ParsedName: dropped = set(state.dropped) # Force the role BEFORE the entry pass: it keys on # Role.SUFFIX, and a bare value's sub-parse reads its words - # as a name ('RA PhD' is a title and a family there), so + # as a name ('VC PhD' is a title and a family there), so # inside the sub-parse it joined nothing. The sub-parse's # tags are KEPT, "joined" included: a within-piece mark # (the Ph. D. merge) is role-blind and right for every diff --git a/nameparser/_pipeline/_assign.py b/nameparser/_pipeline/_assign.py index 7c56fbf67..4bdde3860 100644 --- a/nameparser/_pipeline/_assign.py +++ b/nameparser/_pipeline/_assign.py @@ -2064,8 +2064,8 @@ def as_a_middle(m: int, token: WorkToken) -> PendingReading: # Berg'), or where everything behind it is post-nominal, which # leaves no family word to address -- H3's concern, by a # stricter test than H3's one-word give-back, so this is not - # `leading_titles` ('RA PhD Jr., John' keeps family 'RA', where - # 'RA PhD Jr. John' reads title 'RA'). A dual is a title wherever + # `leading_titles` ('VC PhD Jr., John' keeps family 'VC', where + # 'VC PhD Jr. John' reads title 'VC'). A dual is a title wherever # a name word follows it ('Rev. Sr. Smith, Mary'). # `is_title_piece` is H5's vocabulary read, so the two slots that # refuse the shape agree on what a title word is, save H5's diff --git a/nameparser/_pipeline/_comma.py b/nameparser/_pipeline/_comma.py index 98a61a1e9..9cd81e604 100644 --- a/nameparser/_pipeline/_comma.py +++ b/nameparser/_pipeline/_comma.py @@ -952,7 +952,7 @@ def decide(state: ParseState, splits: bool | None = True) -> ParseState: # it stands behind that word, so one scan answers every # pair. Asked per pair, the scan re-walked every word in # front of each one, quadratic in the part ('John Smith, ' + - # 'RA '*k + 'G.J. '*k, the duals never ending it; #563's + # 'VC '*k + 'G.J. '*k, the duals never ending it; #563's # shape, back in #613 and caught in review) speaker = -1 for k, p in enumerate(p1): diff --git a/nameparser/_pipeline/_pieces.py b/nameparser/_pipeline/_pieces.py index ae8c53021..8e35744de 100644 --- a/nameparser/_pipeline/_pieces.py +++ b/nameparser/_pipeline/_pieces.py @@ -711,7 +711,7 @@ def _anchors(piece: Sequence[int], tokens: Sequence[WorkToken]) -> bool: retired single-character vocabulary matches for the same reason. Not because a numeral is no credential -- a multi-letter suffix word ('III', 'Jr') anchors like any other suffix piece - (`is_single_letter_numeral`). A title/suffix DUAL ('ms', 'ra', + (`is_single_letter_numeral`). A title/suffix DUAL ('ms', 'vc', 'sr') does anchor, except in the given part's leading title run, where it stands in title position ('Smith, Ms Ma' is Ms. Ma Smith); that exclusion is the callers', which start diff --git a/nameparser/_pipeline/_vocab.py b/nameparser/_pipeline/_vocab.py index 9aeab0ba4..97eb344de 100644 --- a/nameparser/_pipeline/_vocab.py +++ b/nameparser/_pipeline/_vocab.py @@ -636,7 +636,7 @@ def reads_as_initials(word: str, kind: SetApartKind, name word of its comma part, as the initials the person goes by: a credential written in their shape that is no generation word, and a word that is a title too only written with a period after each - letter ('R.A.') or in capitals in a name of mixed case ('RA'), + letter ('V.C.') or in capitals in a name of mixed case ('VC'), Title case reading as the title it also is and capitals in a name written in one case saying nothing (S6); a title alone never. A member of the ambiguous class counts as the credential it is diff --git a/nameparser/config/_compiled.py b/nameparser/config/_compiled.py index a047f2f9f..774c1a5d5 100644 --- a/nameparser/config/_compiled.py +++ b/nameparser/config/_compiled.py @@ -967,7 +967,6 @@ 'pvt', 'qari', "queen's", - 'ra', 'rabbi', 'radio', 'radiologist', @@ -1620,6 +1619,7 @@ 'prince', 'princess', 'queen', + 'ra', 'ranger', 'royal', 'sailor', @@ -2992,6 +2992,7 @@ 'pa', 'pac', 'pe', + 'ra', 'se', 'si', }) diff --git a/nameparser/config/_index.py b/nameparser/config/_index.py index 959954e07..213d59951 100644 --- a/nameparser/config/_index.py +++ b/nameparser/config/_index.py @@ -2923,7 +2923,7 @@ ('quinca', (('pt-BR', 'familiar', (('short_for', ('joaquim',)),)),)), ('quinha', (('pt-BR', 'familiar', (('short_for', ('francisca',)),)),)), ('quinho', (('pt-BR', 'familiar', (('short_for', ('francisco',)),)),)), - ('ra', (('de', 'academic', ()), ('en', 'credential', ()))), + ('ra', (('de', 'academic', ()), ('de', 'credential', ()), ('en', 'credential', ()), ('ko', 'given', ()), ('ko', 'family', ()))), ('rabbi', (('he', 'religious', ()),)), ('radek', (('cs', 'familiar', (('short_for', ('radoslav',)),)), ('pl', 'familiar', (('short_for', ('radoslaw', 'radosław')),)), ('sk', 'familiar', (('short_for', ('radoslav',)),)))), ('radio', (('en', 'modifier', ()),)), diff --git a/nameparser/vocab/de.toml b/nameparser/vocab/de.toml index e2ef2a378..82697502d 100644 --- a/nameparser/vocab/de.toml +++ b/nameparser/vocab/de.toml @@ -50,6 +50,7 @@ academic = { same_as = "priv.-doz", dotted = true } [[word]] text = "ra" academic = { expands = "Rechtsanwalt, the address of a lawyer, 'RA Müller'" } +credential = { issue = 1483, expands = "Rechtsanwalt written after the name, 'Hans Müller, RA'", note = "en.toml's credential, here so a plain German choice, which turns the other files' vocabulary readings of the word off, keeps one (#1483), gated as en.toml's is by ko.toml's name readings" } [[word]] text = "univ.prof" diff --git a/nameparser/vocab/ko.toml b/nameparser/vocab/ko.toml index d6b0fdfdd..0f7cbe500 100644 --- a/nameparser/vocab/ko.toml +++ b/nameparser/vocab/ko.toml @@ -86,3 +86,8 @@ note = "teacher/respected elder" side = "after" issue = 308 note = "longest-first peels 선생님 off 김선생님 whole, rather than leaving 김선생 to segment into family 김 and given 선생" + +[[word]] +text = "ra" +given = { us_ssa = 251, wikidata = 4, as_of = 2026-11-21, note = "decided 2026-11-21 (#1483): a Korean given name or its syllable, read so the credential en.toml lists and the title de.toml lists yield to it where it ends or opens a name (rules/S4, rules/H9); ORCID's given boxes hold it in Korea 25 times and Indonesia 23, PatentsView's Korean inventors 135; Burmese given names end in it too (ORCID Myanmar 2 of 1,755); nam_dict band 4 in Korea (tools/name_usage.py Ra --boxes, 2026-11-21)" } +family = { us_census_2010 = 1458, wikidata = 4, as_of = 2026-11-21, note = "decided 2026-11-21 (#1483): the Korean surname 라/나 romanized; Census rank 18,793, asian/PI 72.5%; ORCID's family boxes hold it in Korea 37 times, PatentsView's Korean inventors 100 (tools/name_usage.py Ra --boxes, 2026-11-21)" } diff --git a/tests/v2/cases.py b/tests/v2/cases.py index 81bcb19b8..c2bff55e1 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -1464,6 +1464,102 @@ def _check_cjk_shape_purity(self) -> None: "Syed Tahir Zaidan", {"given": "Syed", "middle": "Tahir", "family": "Zaidan"}, notes="the given name its bearers file it as (#1469)"), + # #1483: `ra` is a Korean surname and given name as well as en.toml's + # credential and de.toml's title, so ko.toml's name readings gate both + # (rules/S4, rules/H9). Each row checked against the 1.4.0 and 3.1.0 + # wheels on 2026-11-21; the feat rows fail on master + Case("a_korean_surname_ra_ending_two_words_is_the_family", + "Kim Ra", + {"given": "Kim", "family": "Ra"}, + ambiguities=("suffix-or-name",), + notes="the gated credential needs a word to spare (rules/S4); " + "1.4.0 read the same fields, 2.x through 3.1.0 suffix " + "'Ra' with no family"), + Case("a_korean_name_ending_in_ra_keeps_it_as_the_family", + "Sang Hak Ra", + {"given": "Sang", "middle": "Hak", "family": "Ra"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="three words in mixed case: Title case leans to the name " + "(rules/S6); 1.4.0 through 3.1.0 read family 'Hak', " + "suffix 'Ra'"), + Case("ra_opening_a_name_is_the_given_name", + "Ra Mi Kim", + {"given": "Ra", "middle": "Mi", "family": "Kim"}, + classification="feat(#1483)", + notes="de.toml's title is a title only in a phrase now " + "(rules/H9); 1.4.0 through 3.1.0 read title 'Ra'"), + Case("ra_behind_a_salutation_is_the_given_name", + "Mr Ra Kumar", + {"title": "Mr", "given": "Ra", "family": "Kumar"}, + classification="feat(#1483)", + notes="1.4.0 through 3.1.0 read title 'Mr Ra', family 'Kumar'"), + Case("ra_opening_a_family_first_name_is_the_family", + "Ra Kim", + {"given": "Kim", "family": "Ra"}, + policy=Policy(name_order=FAMILY_FIRST), + classification="feat(#1483)", + notes="the Korean surname in its native order; 3.1.0 read " + "title 'Ra', family 'Kim'"), + Case("ra_keeps_the_credential_after_a_comma", + "John Smith, RA", + {"given": "John", "family": "Smith", "suffix": "RA"}, + notes="boundary: capitals in a name of mixed case settle the " + "member as the credential (rules/S6), so the gate moves " + "nothing here"), + Case("ra_keeps_the_credential_after_a_second_comma", + "Jane Doe, PT, RA", + {"given": "Jane", "family": "Doe", "suffix": "PT, RA"}, + notes="boundary: a family name alone read without the gate " + "would have read de.toml's title past the second comma " + "(rules/C2); the given reading gates the title too"), + Case("ra_written_with_its_stops_keeps_the_credential", + "Jane Doe, R.A.", + {"given": "Jane", "family": "Doe", "suffix": "R.A."}, + notes="boundary: an acronym written with a stop after each " + "letter is no name (rules/S3)"), + Case("ra_written_without_its_last_stop_after_a_comma_reverses", + "Jane Doe, R.A", + {"given": "R.", "middle": "A", "family": "Jane Doe"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="an accepted cost: the gated class written without its " + "last stop is no dotted acronym, and the one-word part " + "after a family comma is the given name, as 'Jane Doe, " + "M.A' reads on master (decisions/suffix-acronym-collisions, " + "2026-11-21 #1483); 1.4.0 through 3.1.0 read suffix 'R.A'"), + Case("ra_alone_after_a_family_comma_in_capitals_is_the_credential", + "Doe, RA", + {"family": "Doe", "suffix": "RA"}, + classification="fix(#296)", + notes="boundary: in a name of mixed case the capitals settle " + "it; a name written wholly in capitals gives no case " + "signal and reads the given name ('KING, RA'). 1.4.0 " + "through 2.1.0 read title 'RA', 2.2.0 through 3.1.0 as " + "here"), + Case("ra_opening_a_german_name_is_the_given_name", + "RA Müller", + {"given": "RA", "family": "Müller"}, + classification="feat(#1483)", + notes="an accepted cost: Rechtsanwalt in front is a title only " + "in a phrase now (rules/H9), and no choice of languages " + "drops ko.toml's name reading; 1.4.0 through 3.1.0 read " + "title 'RA'"), + Case("ra_ending_a_name_in_capitals_stays_the_credential", + "KIM MI RA", + {"given": "KIM", "family": "MI", "suffix": "RA"}, + ambiguities=("suffix-or-name",), + notes="boundary, not fixed: a name written wholly in capitals " + "gives no case signal (rules/S6) and has a word to spare " + "(rules/S4); 1.4.0 read the same fields"), + Case("ra_after_a_birth_marker_is_the_maiden_name", + "Jane Doe née Ra", + {"given": "Jane", "family": "Doe", "maiden": "Ra"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="the suffix reading had taken the marker's name, leaving " + "'née' the family; 1.4.0 through 3.1.0 read middle 'Doe', " + "family 'née', suffix 'Ra'"), # #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 @@ -4555,22 +4651,26 @@ def _check_cjk_shape_purity(self) -> None: "given name. 1.4.0 and 2.3.0 read the same", shape=2), Case("a_dual_opening_the_given_part_anchors_nothing", - "Smith, RA MEng", - {"title": "RA", "given": "MEng", "family": "Smith"}, + "Smith, VC MEng", + {"title": "VC", "given": "MEng", "family": "Smith"}, notes="the same exclusion for the other chunked member. " - "1.4.0 read the same; 2.3.0 read suffix 'RA MEng', " - "the reading #540's marking moved"), + "1.4.0 read the same; 2.3.0 read suffix 'VC MEng', " + "the reading #540's marking moved. " + "Spelled with 'RA' until #1483 gave ra a name reading; " + "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0"), Case("a_dual_opening_the_given_part_turns_the_anchor_off", - "Smith, Ms RA Ma", - {"title": "Ms RA", "given": "Ma", "family": "Smith"}, + "Smith, Ms VC Ma", + {"title": "Ms VC", "given": "Ma", "family": "Smith"}, notes="a dual opening the given part is a title there, and a " "part whose leading title run holds one is anchored by " "nothing, the second dual standing in that same run. " - "1.4.0 and 2.3.0 read the same", + "1.4.0 and 2.3.0 read the same. " + "Spelled with 'RA' until #1483 gave ra a name reading; " + "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0", shape=2), Case("a_dual_opening_the_given_part_silences_a_later_degree", - "Smith, RA PhD Ma", - {"title": "RA", "given": "PhD", "middle": "Ma", + "Smith, VC PhD Ma", + {"title": "VC", "given": "PhD", "middle": "Ma", "family": "Smith"}, classification="fix(#296)", ambiguities=("suffix-or-name",), @@ -4580,8 +4680,10 @@ def _check_cjk_shape_purity(self) -> None: "so 'PhD' speaks for nothing here and 'Ma' ends the " "given part as a middle name, reported by the given " "slot. 2.2.0 and 2.3.0 read the same fields; 1.4.0 " - "through 2.1.0 title 'RA PhD', first 'Ma', 'phd' being " - "title vocabulary until #296", + "through 2.1.0 title 'VC PhD', first 'Ma', 'phd' being " + "title vocabulary until #296. " + "Spelled with 'RA' until #1483 gave ra a name reading; " + "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0", shape=2), Case("a_numeral_in_front_anchors_nothing", "smith, v ed", @@ -7463,10 +7565,12 @@ def _check_cjk_shape_purity(self) -> None: notes="#1323 boundary: 'Ms' written as a title is the given " "part's title, no company, so the part is the given part"), Case("two_caps_behind_a_title_dual_with_nothing_behind_stay_initials", - "John Smith, RA MJ", - {"title": "RA", "given": "MJ", "family": "John Smith"}, + "John Smith, VC MJ", + {"title": "VC", "given": "MJ", "family": "John Smith"}, notes="#1323 boundary: a word in front of the pair speaks for " - "nothing (rules/C5); only credentials behind it do"), + "nothing (rules/C5); only credentials behind it do. " + "Spelled with 'RA' until #1483 gave ra a name reading; " + "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0"), Case("two_caps_behind_a_member_with_nothing_behind_stay_initials", "John Smith, MA MJ", {"given": "MA", "middle": "MJ", "family": "John Smith"}, @@ -7499,10 +7603,12 @@ def _check_cjk_shape_purity(self) -> None: "part's, written in capitals too; only words behind the " "pair speak for it (rules/C5)"), Case("two_caps_behind_a_rank_dual_with_a_credential_stay_initials", - "Jane Doe, RA MJ PhD", - {"title": "RA", "given": "MJ", "family": "Jane Doe", + "Jane Doe, LT MJ PhD", + {"title": "LT", "given": "MJ", "family": "Jane Doe", "suffix": "PhD"}, - notes="#1323 boundary: as 'MS BM PhD'"), + notes="#1323 boundary: as 'MS BM PhD'. " + "Spelled with 'RA' until #1483 gave ra a name reading; " + "'LT' reads the same under 1.4.0, 2.2.0 and 2.3.0"), Case("two_caps_before_a_capitals_dual_are_a_credential", "Jane Doe, MJ MS", {"given": "Jane", "family": "Doe", "suffix": "MJ MS"}, @@ -12911,8 +13017,8 @@ def _check_cjk_shape_purity(self) -> None: "#601; rules/C10's maiden-marker Accepted entry). 2.0.0 " "through 2.3.0 read maiden 'Jones', stepping past the core"), Case("suffix_delimiter_core_that_survives_is_a_boundary_too", - "Smith, RA | PhD | FACS", - {"title": "RA", "given": "|", "family": "Smith", + "Smith, VC | PhD | FACS", + {"title": "VC", "given": "|", "family": "Smith", "suffix": "PhD | FACS"}, policy=_SD, classification="fix(#602)", @@ -12931,7 +13037,9 @@ def _check_cjk_shape_purity(self) -> None: "#436's predicate asks what stands between the two " "rather than only what was dropped. With ' - ' and no " "policy the string reads the same, the built-in hyphen " - "being no delimiter after a family comma either (#889)"), + "being no delimiter after a family comma either (#889). " + "Spelled with 'RA' until #1483 gave ra a name reading; " + "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0"), Case("semicolon_glued_after_a_whole_name", "John Smith, MD; PhD", {"given": "John", "family": "Smith", "suffix": "MD; PhD"}, classification="fix(semicolon-suffix-delimiter)", @@ -15424,16 +15532,16 @@ def _check_cjk_shape_purity(self) -> None: "piece is ONE WORD: a joined unit led by a title is a " "title run, and handing it back would turn a title into " "a given name and leave the name with no title at all"), - Case("title_run_floor_declines_an_all_suffix_input", "RA DDS", - {"title": "RA", "family": "DDS"}, classification="parity", + Case("title_run_floor_declines_an_all_suffix_input", "VC DDS", + {"title": "VC", "family": "DDS"}, classification="parity", notes="negative control: the word the run would give back is " - "`RA`, which IS suffix vocabulary, so the floor " - "declines. `ra` is title vocabulary too, so the run is " - "`RA` and H1's fold claims `DDS` -- not the bare-suffix " + "`VC`, which IS suffix vocabulary, so the floor " + "declines. `vc` is title vocabulary too, so the run is " + "`VC` and H1's fold claims `DDS` -- not the bare-suffix " "carve-out, which reads the FIRST word as the name and " - "reports `suffix-or-name` (`DDS RA`). Nothing reports " + "reports `suffix-or-name` (`DDS VC`). Nothing reports " "here. Spelled with `MD` until #853 took md out of the " - "titles"), + "titles, and with `RA` until #1483 gave ra a name reading"), Case("title_run_floor_declines_a_split_credential", "Jr. Ph. D.", {"title": "Jr.", "suffix": "Ph. D."}, classification="parity", notes="negative control: `Jr.` is suffix vocabulary wearing " @@ -16858,17 +16966,18 @@ def _check_cjk_shape_purity(self) -> None: "name word to the walk: with a name word in the letter's " "place the connective joins it as the middle name " "('Smith, Maria y Q' reads middle 'y Q')"), - Case("family_comma_title_resets_the_credential_run", "Smith, RA Dr. I", - {"title": "RA Dr.", "given": "I", "family": "Smith"}, + Case("family_comma_title_resets_the_credential_run", "Smith, VC Dr. I", + {"title": "VC Dr.", "given": "I", "family": "Smith"}, notes="THE RESET. A title ends the run: what follows a bare " "title is not continuing a credential, so the numeral " "behind it does not join and the segment is no run at " "all, leaving the walk to read the dual and the title as " "the given part's titles and 'I' as its given name. " - "Without the reset the numeral continues the 'RA' in " + "Without the reset the numeral continues the 'VC' in " "front of the title and the part reads title 'Dr.', " - "suffix 'RA I'. Spelled with a dual since #603, 'MD' " - "until #853 took md out of the titles and 'RA' since: " + "suffix 'VC I'. Spelled with a dual since #603, 'MD' " + "until #853 took md out of the titles, 'RA' until #1483 " + "gave ra a name reading, and 'VC' since: " "'Smith, PSM Dr. I', this row until then, is a part the " "credential 'PSM' OPENS, which reads as #602's run reads " "whatever stands behind it (rules/C13) -- title 'Dr.', " diff --git a/tests/v2/pipeline/test_pieces.py b/tests/v2/pipeline/test_pieces.py index 606971409..408fc3d8b 100644 --- a/tests/v2/pipeline/test_pieces.py +++ b/tests/v2/pipeline/test_pieces.py @@ -133,7 +133,7 @@ def test_strict_ends_the_run_at_the_initial_shaped_numeral() -> None: the opened part takes it in all the same, and hands it to the caller to report. """ - pieces, ptags, tokens, one_case = _comma_part("Smith, RA I") + pieces, ptags, tokens, one_case = _comma_part("Smith, VC I") args = (pieces, ptags, tokens) assert segment_suffix_reading(*args, True, one_case) == (True, True) assert segment_suffix_reading(*args, False, one_case) is None @@ -176,21 +176,21 @@ def test_a_dual_in_the_leading_title_run_turns_the_anchor_off() -> None: as the parent did, its given slot's company starting past the given name. A plain title does not do this, and a dual behind a credential anchors like any suffix word.""" - for text in ("Smith, Ms Ma", "Smith, Ms RA Ma", "Smith, RA PhD Ma", - "Smith, RA MS Ma", "SMITH, RA MS BA", - "Smith, Prof. RA Ma", "smith, prof. ra ma", - "Smith, Dr. RA PhD Ma"): + for text in ("Smith, Ms Ma", "Smith, Ms VC Ma", "Smith, VC PhD Ma", + "Smith, VC MS Ma", "SMITH, VC MS BA", + "Smith, Prof. VC Ma", "smith, prof. vc ma", + "Smith, Dr. VC PhD Ma"): assert _comma_part_reading(text)[0] is None, text assert _comma_part_reading("Smith, Dr. PhD LAc") == ( (False, True, True), [2]) assert _comma_part_reading("Smith, PhD Ms Ma") == ( (True, True, True), [2]) # with no member to anchor, the dual reads as the suffix it is - assert _comma_part_reading("Smith, RA PhD") == ((True, True), []) + assert _comma_part_reading("Smith, VC PhD") == ((True, True), []) # and the walk's given slot, past the given name, reads its own # company as behind any given name - assert parse("Smith, RA PhD Jr Ma").suffix == "Jr Ma" - assert parse("Smith, RA PhD Jr Ma").given == "PhD" + assert parse("Smith, VC PhD Jr Ma").suffix == "Jr Ma" + assert parse("Smith, VC PhD Jr Ma").given == "PhD" def _leading(text: str) -> int: @@ -223,7 +223,7 @@ def test_the_leading_run_declines_to_give_back_a_suffix_word() -> None: what leaves the whole-segment carve-out and the all-title inputs exactly as they were. """ - assert _leading("RA DDS") == 1 # 'RA' is suffix vocabulary + assert _leading("VC DDS") == 1 # 'VC' is suffix vocabulary ('RA' until #1483 gave ra a name reading) assert _leading("Jr. Ph. D.") == 1 # so is 'Jr.' assert _leading("Marquess of Bath") == 1 # nothing behind the run assert _leading("Dr.") == 1 # the whole-segment carve-out @@ -581,10 +581,10 @@ def test_a_multi_letter_numeral_anchors_like_any_suffix_word() -> None: def test_the_anchor_pass_starts_past_the_leading_title_run() -> None: # a title/suffix dual opening the given part is a title there and # anchors nothing, at the given slot and in the part read whole - assert parse("Smith, RA MA Ma").middle == "Ma" + assert parse("Smith, VC MA Ma").middle == "Ma" assert parse("Smith, Ms Ma").given == "Ma" # past that position the same dual anchors - assert parse("John Smith RA MEng").suffix == "RA MEng" + assert parse("John Smith VC MEng").suffix == "VC MEng" def test_the_given_slot_asks_the_anchor_only_when_the_writing_declines( diff --git a/tests/v2/test_benchmark.py b/tests/v2/test_benchmark.py index 60be8ad36..7a1a9015a 100644 --- a/tests/v2/test_benchmark.py +++ b/tests/v2/test_benchmark.py @@ -1137,7 +1137,8 @@ def test_a_clause_link_run_does_not_cost_quadratically() -> None: # k=32 on this tree (3.7x), against 120 and 1,620 at 47fb2b21 (13.5x), # where every pair rescanned. The dual was 'MD' until #853 took md out # of the titles; re-taken with 'RA' on 2026-10-23, 35 and 131 on the -# tree (3.7x) and 120 and 1,620 at 47fb2b21 again. A change to what the scan calls must +# tree (3.7x) and 120 and 1,620 at 47fb2b21 again, and with 'VC' on +# 2026-11-21, when #1483 gave ra a name reading, the same four counts. A change to what the scan calls must # move `only=` with it, and re-take that negative control. _PAIR_SCAN_SMALL = 8 _PAIR_SCAN_LARGE = 32 @@ -1147,12 +1148,12 @@ def test_a_clause_link_run_does_not_cost_quadratically() -> None: def test_the_paired_initials_title_scan_does_not_cost_quadratically() -> None: if sys.getprofile() is not None: pytest.skip("a profile hook is already installed; this test owns it") - small_text = "John Smith, " + "RA " * _PAIR_SCAN_SMALL + "G.J. " * _PAIR_SCAN_SMALL - large_text = "John Smith, " + "RA " * _PAIR_SCAN_LARGE + "G.J. " * _PAIR_SCAN_LARGE + small_text = "John Smith, " + "VC " * _PAIR_SCAN_SMALL + "G.J. " * _PAIR_SCAN_SMALL + large_text = "John Smith, " + "VC " * _PAIR_SCAN_LARGE + "G.J. " * _PAIR_SCAN_LARGE # REACHABILITY: the flip REPORTS only where the scan ran and found # nothing but titles in front of the first pair, every shape word # being a pair (rules/C11's "nothing but other paired initials"). - # A change that stopped the scan being asked -- 'RA' leaving the + # A change that stopped the scan being asked -- 'VC' leaving the # titles, the pair test moving -- loses the report and fails here # rather than leaving this guard measuring nothing. for text, k in ((small_text, _PAIR_SCAN_SMALL), diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index c98985913..f6f3a788c 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -530,9 +530,10 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # suffix-or-name under three orders; 2296 -> 2321 the same day, its # test review's eight rows under three orders and its family-first # row under its declared policy; 2321 -> 2330 the same day, #1128's - # reporting rows. - assert claims == 2330, ( - f"the field sweep checks {claims} claims, recorded as 2330 on " + # reporting rows; 2330 -> 2342 the same day, #1483's `ra` rows + # reporting suffix-or-name. + assert claims == 2342, ( + f"the field sweep checks {claims} claims, recorded as 2342 on " f"2026-11-21") @@ -1034,8 +1035,9 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None: # day, its review's 'PETR JAN DIS' under three orders; 632 -> 647 on # 2026-11-21, #1517's five caps-shape rows under three orders, # 'Smith, M.B. ChB' being a stand-in reread; 647 -> 669 the same - # day, its test review's rows - assert (checked, skipped) == (669, 512), (checked, skipped) + # day, its test review's rows; 669 -> 672 the same day, #1483's + # `ra` rows reporting suffix-or-name + assert (checked, skipped) == (672, 512), (checked, skipped) def test_every_case_name_is_unique() -> None: diff --git a/tests/v2/test_locales.py b/tests/v2/test_locales.py index 57a020674..4d488128a 100644 --- a/tests/v2/test_locales.py +++ b/tests/v2/test_locales.py @@ -988,7 +988,10 @@ def test_my_pack_contents() -> None: ("THEIN AUNG EI", "THEIN", "AUNG", "EI", ""), ("THEIN AUNG SI", "THEIN", "AUNG", "SI", ""), ("THEIN AUNG PA", "THEIN", "AUNG", "PA", ""), - ("Thein Aung Ra", "Thein", "Aung", "Ra", ""), + # 'Thein Aung Ra' stood here until #1483 gave ra a name reading, + # which reads it so with no choice; in capitals the default still + # reads the credential, no case speaking for the name + ("THEIN AUNG RA", "THEIN", "AUNG", "RA", ""), ("AUNG SAN WIN", "AUNG", "SAN", "WIN", ""), ("Win, Aung San", "Aung", "San", "Win", ""), (", AUNG PE", "AUNG", "PE", "", ""), diff --git a/tests/v2/test_name_usage_tool.py b/tests/v2/test_name_usage_tool.py index 2ce8b21d5..4570620a2 100644 --- a/tests/v2/test_name_usage_tool.py +++ b/tests/v2/test_name_usage_tool.py @@ -1985,18 +1985,20 @@ def test_main_exits_2_on_an_unusable_tally_without_losing_the_other_sources( def test_main_rank_lists_credentials_with_vocabulary_and_readings( monkeypatch: pytest.MonkeyPatch, tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: - # Q-R-S still reverses after a comma: joined single letters are no + # VC is a title/suffix dual ('RA' stood here until #1483 gave ra a + # name reading, its vocabulary then 'ambiguous acronym'). Q-R-S + # still reverses after a comma: joined single letters are no # caps shape (rules/S9), so the given-name readout stays exercised - _cache_tally(monkeypatch, tmp_path, _tally(RA=50, **{"Q-R-S": 40}, ESQ=3)) + _cache_tally(monkeypatch, tmp_path, _tally(VC=50, **{"Q-R-S": 40}, ESQ=3)) assert tool.main(["--no-wikidata", "--json", "--rank", "5"]) == 0 rows = {r["credential"]: r for r in json.loads(capsys.readouterr().out)["rows"]} assert [r["rank"] for r in rows.values()] == [1, 2, 3] - assert rows["RA"]["vocabulary"] == "acronym, title" - assert (rows["RA"]["after_comma"], rows["RA"]["bare"]) == ("suffix", "suffix") + assert rows["VC"]["vocabulary"] == "acronym, title" + assert (rows["VC"]["after_comma"], rows["VC"]["bare"]) == ("suffix", "suffix") assert rows["Q-R-S"]["vocabulary"] == "-" assert (rows["Q-R-S"]["after_comma"], rows["Q-R-S"]["bare"]) == ("given", "family") assert rows["ESQ"]["vocabulary"] == "suffix word" - assert rows["RA"]["census"] == "not downloaded" + assert rows["VC"]["census"] == "not downloaded" def test_main_rank_unlisted_keeps_each_credentials_overall_rank( diff --git a/tests/v2/test_parser.py b/tests/v2/test_parser.py index ba01baef0..6e6a4666e 100644 --- a/tests/v2/test_parser.py +++ b/tests/v2/test_parser.py @@ -3389,12 +3389,13 @@ def test_a_choice_that_changes_nothing_leaves_the_sets_as_they_are() -> None: {"middle": "Do", "family": "Hyun"}), (("ko",), "Kim Bin Hyun", {"family": "Bin Hyun"}, # ar's and ms's {"middle": "Bin", "family": "Hyun"}), - (("ko",), "Ra Min Jun", {"title": "Ra"}, # de's academic title - {"given": "Ra", "title": ""}), - (("ko",), "Kim Min Ra", {"suffix": "Ra"}, # en's credential - {"family": "Ra", "suffix": ""}), + # en's credential; 'Kim Min Ra' stood here, and 'Ra Min Jun' for + # de's academic title, until #1483 gave ra ko.toml's name readings, + # which read it as a name with no choice + (("ko",), "Kim Min Ae", {"suffix": "Ae"}, + {"family": "Ae", "suffix": ""}), # what adding en costs: its credential is back - (("ko", "en"), "Kim Min Ra", {"suffix": "Ra"}, {"suffix": "Ra"}), + (("ko", "en"), "Kim Min Ae", {"suffix": "Ae"}, {"suffix": "Ae"}), # en's rank; 'Gen Hoshino' stood here until #999 made 'gen' a # title only in a phrase, which reads given 'Gen' with no choice (("ja",), "Capt Hoshino", {"title": "Capt"}, {"given": "Capt"}), @@ -3589,9 +3590,45 @@ def test_a_strict_choice_keeps_a_callers_readings_over_the_union( == parser_for(_choosing("ko", "en"), strict=True).lexicon) +@pytest.mark.parametrize("strict,text,fields", [ + # de.toml's own credential reading keeps RA the credential after the + # name, which a plain German choice would otherwise lose: choosing de + # turns en.toml's credential off, de.toml holding a vocabulary + # reading of the word, while ko.toml's name readings stay on, and a + # lone RA after a family comma read as the given name, the name + # reversed (#1483) + (False, "Hans Müller, RA", + {"given": "Hans", "family": "Müller", "suffix": "RA"}), + (False, "Müller, RA", {"family": "Müller", "suffix": "RA"}), + (False, "Hans Müller, LL.M., RA", + {"given": "Hans", "family": "Müller", "suffix": "LL.M., RA"}), + (False, "Hans Müller RA", + {"given": "Hans", "family": "Müller", "suffix": "RA"}), + # in front a plain choice reads the name reading, as the default does + (False, "RA Müller", {"given": "RA", "family": "Müller"}), + # a strict choice reads no ko.toml: the title in front, the + # credential behind + (True, "RA Müller", {"title": "RA", "family": "Müller"}), + (True, "RA Dr. Hans Müller", + {"title": "RA Dr.", "given": "Hans", "family": "Müller"}), + (True, "Hans Müller, RA", + {"given": "Hans", "family": "Müller", "suffix": "RA"}), +]) +def test_a_german_choice_reads_ra_after_the_name_as_the_credential( + strict: bool, text: str, fields: dict[str, str]) -> None: + name = parser_for(_choosing("de"), strict=strict).parse(text) + got = {f: getattr(name, f) for f in + ("title", "given", "middle", "family", "suffix") if getattr(name, f)} + assert got == fields + + def test_a_packs_fragment_is_unioned_on_after_the_strict_compile() -> None: - pack = _choosing("ko", lexicon=Lexicon.empty().add("ra", kind="credential")) - assert parser_for(pack, strict=True).parse("Kim Min Ra").suffix == "Ra" + # a word no file holds, so only the fragment can read it ('ra' stood + # here until #1483 gave it ko.toml's name readings, which gate it) + pack = _choosing("ko", lexicon=Lexicon.empty().add("zzq", kind="credential")) + assert parser_for(pack, strict=True).parse("Kim Min Zzq").suffix == "Zzq" + assert parser_for(_choosing("ko"), strict=True).parse( + "Kim Min Zzq").suffix == "" def _choice_tags() -> list[tuple[str, bool]]: diff --git a/tests/v2/test_reading_index.py b/tests/v2/test_reading_index.py index 406fa80ca..dee43d888 100644 --- a/tests/v2/test_reading_index.py +++ b/tests/v2/test_reading_index.py @@ -390,7 +390,10 @@ def test_a_file_holding_only_familiar_readings_is_chosen_only_strictly( #: file-strict entry measured 16 words, 27 word-and-tag pairs over 13 #: tags on 2026-10-31; the strict-gap batches of 2026-11-03 moved it, and #: #345 added hi's sushri, its Odia given name in or.toml; #1483 my's -#: ranks, whose given names only en.toml writes). A +#: ranks, whose given names only en.toml writes; de's and en's ra, +#: whose name readings only ko.toml writes, #1483 on 2026-11-21, a +#: strict German or English choice reading the credential as master's +#: default did). A #: word leaves this table when a name reading is written in the chosen #: file whose names carry it, and joins it when a chosen file's #: vocabulary reading loses its gate: review each move. @@ -398,6 +401,8 @@ def test_a_file_holding_only_familiar_readings_is_chosen_only_strictly( "ar": {"ben", "cheikh"}, "ca": {"del", "la"}, "cs": {"st"}, + "de": {"ra"}, + "en": {"ra"}, "fil": {"del", "la", "san"}, "fr": {"la", "marquis", "marquise", "saint", "st"}, "ga": {"mac"}, diff --git a/tools/differential/cldr_agreement.json b/tools/differential/cldr_agreement.json index 3d0628794..410160526 100644 --- a/tools/differential/cldr_agreement.json +++ b/tools/differential/cldr_agreement.json @@ -6862,6 +6862,10 @@ "text": "фон Брюль Ада Корнелия Сезар Мартин, к. м. н." }, "sc/foreignFull/givenFirst": { + "given_names": { + "expected": "Maria Giusepa Juana Teresa", + "got": "Dut.ra Prof.ra Maria Giusepa Juana Teresa" + }, "surname1_base": { "expected": "Brühl", "got": "Brühl González Domingo" @@ -6870,7 +6874,11 @@ "expected": "González Domingo", "got": "" }, - "text": "Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo" + "text": "Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo", + "title": { + "expected": "Dut.ra Prof.ra", + "got": "" + } }, "sc/foreignFull/surnameFirst": { "family": { diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index 858ba0886..80740ac9c 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -1104,10 +1104,10 @@ "John Smith, Phd-Md" "John Smith, Prof. - of Surgery" "John Smith, Pu-Ph" -"John Smith, RA Jones" -"John Smith, RA MJ" "John Smith, V." "John Smith, V; MD" +"John Smith, VC Jones" +"John Smith, VC MJ" "John Smith, Vice" "John Smith, X.Y. P.Q." "John Smith, X.Y.Z." @@ -1540,8 +1540,6 @@ "Queen Elizabeth II" "Queen Mother Elizabeth" "R S Lakshmi" -"RA DDS" -"RA PhD Jr., John" "RAHMAN, MD" "RAHMAN, MD ABDUL" "RAHMAN, MD." @@ -1549,7 +1547,7 @@ "RAM BAHADUR B.K." "RITA DE CASSIA SOUZA" "ROB ROY MACGREGOR" -"ROBERT (RA) ALLEN" +"ROBERT (VC) ALLEN" "RONALD MACDONALD" "Rahim @ Jaki Osman" "Rahim @ Jaki PhD bin Osman" @@ -1603,7 +1601,7 @@ "Rewati Od (Mahar)" "Rinehart, J.D. Jr." "Rinpoche" -"Robert (RA) Allen" +"Robert (VC) Allen" "Roman A. Abramovich" "Ronald Macdonald" "Royce, Ed" @@ -1812,13 +1810,13 @@ "Smith, PhD MEng" "Smith, PhD Ma" "Smith, Pharm D" -"Smith, RA PhD Ma" "Smith, RN - CRNA" "Smith, Sgt Major" "Smith, Sir" "Smith, Sr." "Smith, U.S. Senator John" "Smith, V; MD" +"Smith, VC PhD Ma" "Smith, Van V" "Smith, XYZ" "Smith, de Mesnil Jean" @@ -1881,6 +1879,8 @@ "VAN DER WALT" "VAN GOGH VINCENT" "VAN TER HORST" +"VC DDS" +"VC PhD Jr., John" "VI, AD" "Van Berg Jan de" "Van Buren, Ed" diff --git a/tools/differential/corpus_shapes.jsonl b/tools/differential/corpus_shapes.jsonl index be4c21b53..0871f01a2 100644 --- a/tools/differential/corpus_shapes.jsonl +++ b/tools/differential/corpus_shapes.jsonl @@ -260,10 +260,10 @@ {"name": "Smith, MEng", "shape": 2} {"name": "Smith, Ma", "shape": 2} {"name": "Smith, Ms Ma", "shape": 2} -{"name": "Smith, Ms RA Ma", "shape": 2} +{"name": "Smith, Ms VC Ma", "shape": 2} {"name": "Smith, PhD MEng", "shape": 2} {"name": "Smith, PhD Ma", "shape": 2} -{"name": "Smith, RA PhD Ma", "shape": 2} +{"name": "Smith, VC PhD Ma", "shape": 2} {"name": "Smith, meng", "shape": 2} {"name": "Uddin, Mr Md Karim", "shape": 2} {"name": "Van Buren, Ed", "shape": 2} diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index 12e3ee670..ca92f645f 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -759,7 +759,7 @@ {"name": "DUPONT Mary", "given": "DUPONT", "family": "Mary", "initials": "D. M.", "capitalized_force": "Dupont Mary"} {"name": "DUPONT Mary Ann", "given": "DUPONT", "middle": "Mary", "family": "Ann", "initials": "D. M. A.", "capitalized_force": "Dupont Mary Ann"} {"name": "DUPONT Mary y", "given": "DUPONT", "family": "Mary y", "initials": "D. M.", "capitalized_force": "Dupont Mary y"} -{"name": "DUT.RA MARIA SILVA", "title": "DUT.RA", "given": "MARIA", "family": "SILVA", "initials": "M. S.", "capitalized": "Dut.Ra Maria Silva"} +{"name": "DUT.RA MARIA SILVA", "given": "DUT.RA", "middle": "MARIA", "family": "SILVA", "initials": "D. M. S.", "capitalized": "Dut.Ra Maria Silva"} {"name": "Dale, Antonius van", "given": "Antonius", "family": "van Dale", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "A. D."} {"name": "Dalen, Cornelis van", "given": "Cornelis", "family": "van Dalen", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "C. D."} {"name": "Dame Mary", "title": "Dame", "given": "Mary", "initials": "M."} @@ -1098,7 +1098,7 @@ {"name": "Dumreicher, Johann von", "given": "Johann", "family": "von Dumreicher", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: name as middle (declared)"], "initials": "J. D."} {"name": "Dupont J.-P.", "given": "Dupont", "family": "J.-P.", "initials": "D. J."} {"name": "Dupont, MARY", "given": "MARY", "family": "Dupont", "initials": "M. D.", "capitalized_force": "Mary Dupont"} -{"name": "Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo", "title": "Dut.ra Prof.ra", "given": "Maria", "middle": "Giusepa Juana Teresa", "family": "von Brühl González Domingo", "initials": "M. G. J. T. B. G. D.", "capitalized_force": "Dut.Ra Prof.Ra Maria Giusepa Juana Teresa von Brühl González Domingo"} +{"name": "Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo", "given": "Dut.ra", "middle": "Prof.ra Maria Giusepa Juana Teresa", "family": "von Brühl González Domingo", "initials": "D. P. M. G. J. T. B. G. D.", "capitalized_force": "Dut.Ra Prof.Ra Maria Giusepa Juana Teresa von Brühl González Domingo"} {"name": "Dòmhnall Iain Tormod Caimbeul", "given": "Dòmhnall", "middle": "Iain Tormod", "family": "Caimbeul", "initials": "D. I. T. C."} {"name": "Dóra Mátrai", "given": "Dóra", "family": "Mátrai", "initials": "D. M."} {"name": "Dóra Sigurðsson", "given": "Dóra", "family": "Sigurðsson", "initials": "D. S."} @@ -2449,13 +2449,13 @@ {"name": "John Smith, Phd-Md", "given": "Phd-Md", "family": "John Smith", "initials": "P. J. S.", "capitalized_force": "PhD-Md John Smith"} {"name": "John Smith, Prof. - of Surgery", "title": "Prof. of Surgery", "given": "John", "family": "Smith", "initials": "J. S."} {"name": "John Smith, Pu-Ph", "given": "Pu-Ph", "family": "John Smith", "initials": "P. J. S."} -{"name": "John Smith, RA Jones", "title": "RA", "given": "Jones", "family": "John Smith", "initials": "J. J. S.", "capitalized_force": "Ra Jones John Smith"} -{"name": "John Smith, RA MJ", "title": "RA", "given": "MJ", "family": "John Smith", "initials": "M. J. S.", "capitalized_force": "Ra Mj John Smith"} {"name": "John Smith, RAI", "given": "John", "family": "Smith", "suffix": "RAI", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "J. S."} {"name": "John Smith, V Jr.", "given": "John", "family": "Smith", "suffix": "V Jr.", "initials": "J. S.", "generation": "V Jr."} {"name": "John Smith, V MD", "given": "John", "family": "Smith", "suffix": "V MD", "initials": "J. S.", "generation": "V", "credentials": "MD"} {"name": "John Smith, V.", "given": "John", "family": "Smith", "suffix": "V.", "initials": "J. S.", "generation": "V."} {"name": "John Smith, V; MD", "given": "John", "family": "Smith", "suffix": "V; MD", "initials": "J. S.", "generation": "V;", "credentials": "MD"} +{"name": "John Smith, VC Jones", "title": "VC", "given": "Jones", "family": "John Smith", "initials": "J. J. S.", "capitalized_force": "Vc Jones John Smith"} +{"name": "John Smith, VC MJ", "title": "VC", "given": "MJ", "family": "John Smith", "initials": "M. J. S.", "capitalized_force": "Vc Mj John Smith"} {"name": "John Smith, Vice", "title": "Vice", "given": "John", "family": "Smith", "initials": "J. S."} {"name": "John Smith, X.Y. P.Q.", "given": "John", "family": "Smith", "suffix": "X.Y. P.Q.", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "J. S."} {"name": "John Smith, X.Y.Z.", "given": "John", "family": "Smith", "suffix": "X.Y.Z.", "initials": "J. S."} @@ -3760,8 +3760,6 @@ {"name": "Quincy Adams", "given": "Quincy", "family": "Adams", "initials": "Q. A."} {"name": "Quinquela Martín, Benito", "given": "Benito", "family": "Quinquela Martín", "initials": "B. Q. M."} {"name": "R S Lakshmi", "given": "R", "middle": "S", "family": "Lakshmi", "initials": "R. S. L."} -{"name": "RA DDS", "title": "RA", "family": "DDS", "initials": "D.", "capitalized": "Ra Dds"} -{"name": "RA PhD Jr., John", "given": "John", "family": "RA", "suffix": "PhD Jr.", "initials": "J. R.", "capitalized_force": "John Ra PhD Jr.", "generation": "Jr.", "credentials": "PhD"} {"name": "RAHMAN, MD", "family": "RAHMAN", "suffix": "MD", "initials": "R.", "capitalized": "Rahman, MD"} {"name": "RAHMAN, MD ABDUL", "given": "MD", "middle": "ABDUL", "family": "RAHMAN", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (vocabulary)"], "initials": "M. A. R.", "capitalized": "Md Abdul Rahman"} {"name": "RAHMAN, MD.", "family": "RAHMAN", "suffix": "MD.", "initials": "R.", "capitalized": "Rahman, MD."} @@ -3769,7 +3767,7 @@ {"name": "RAM BAHADUR B.K.", "given": "RAM", "middle": "BAHADUR", "family": "B.K.", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (shape)"], "initials": "R. B. B. K.", "capitalized": "Ram Bahadur B.K."} {"name": "RITA DE CASSIA SOUZA", "given": "RITA", "middle": "DE CASSIA", "family": "SOUZA", "initials": "R. C. S.", "capitalized": "Rita de Cassia Souza"} {"name": "ROB ROY MACGREGOR", "given": "ROB", "middle": "ROY", "family": "MACGREGOR", "initials": "R. R. M.", "capitalized": "Rob Roy MacGregor"} -{"name": "ROBERT (RA) ALLEN", "given": "ROBERT", "family": "ALLEN", "suffix": "RA", "initials": "R. A.", "capitalized": "Robert Allen RA"} +{"name": "ROBERT (VC) ALLEN", "given": "ROBERT", "family": "ALLEN", "suffix": "VC", "initials": "R. A.", "capitalized": "Robert Allen VC"} {"name": "RONALD MACDONALD", "given": "RONALD", "family": "MACDONALD", "initials": "R. M.", "capitalized": "Ronald MacDonald"} {"name": "RONALD MCDONALD", "given": "RONALD", "family": "MCDONALD", "initials": "R. M.", "capitalized": "Ronald McDonald"} {"name": "Rabbi Cohen", "title": "Rabbi", "family": "Cohen", "initials": "C."} @@ -3864,7 +3862,7 @@ {"name": "Rinpoche", "given": "Rinpoche", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: post-nominal as suffix (vocabulary)"], "initials": "R."} {"name": "Rob And Beth Edmunds", "given": "Rob And Beth", "family": "Edmunds", "initials": "R. B. E.", "capitalized_force": "Rob and Beth Edmunds"} {"name": "Rob Edmunds", "given": "Rob", "family": "Edmunds", "initials": "R. E."} -{"name": "Robert (RA) Allen", "given": "Robert", "family": "Allen", "nickname": "RA", "initials": "R. A.", "capitalized_force": "Robert \"Ra\" Allen"} +{"name": "Robert (VC) Allen", "given": "Robert", "family": "Allen", "nickname": "VC", "initials": "R. A.", "capitalized_force": "Robert \"Vc\" Allen"} {"name": "Robert Aitken", "given": "Robert", "family": "Aitken", "initials": "R. A."} {"name": "Robert Morris", "given": "Robert", "family": "Morris", "initials": "R. M."} {"name": "Robert Prince", "given": "Robert", "family": "Prince", "initials": "R. P."} @@ -4272,7 +4270,7 @@ {"name": "Smith, Md XYZ", "family": "Smith", "suffix": "Md XYZ", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "S.", "capitalized_force": "Smith, MD Xyz"} {"name": "Smith, Ms Jane", "title": "Ms", "given": "Jane", "family": "Smith", "initials": "J. S."} {"name": "Smith, Ms Ma", "title": "Ms", "given": "Ma", "family": "Smith", "initials": "M. S."} -{"name": "Smith, Ms RA Ma", "title": "Ms RA", "given": "Ma", "family": "Smith", "initials": "M. S.", "capitalized_force": "Ms Ra Ma Smith"} +{"name": "Smith, Ms VC Ma", "title": "Ms VC", "given": "Ma", "family": "Smith", "initials": "M. S.", "capitalized_force": "Ms Vc Ma Smith"} {"name": "Smith, Ms.", "family": "Smith", "suffix": "Ms.", "initials": "S.", "capitalized_force": "Smith, MS."} {"name": "Smith, Ms. Jane", "title": "Ms.", "given": "Jane", "family": "Smith", "initials": "J. S."} {"name": "Smith, PSM I", "family": "Smith", "suffix": "PSM I", "initials": "S.", "generation": "I", "credentials": "PSM"} @@ -4292,13 +4290,13 @@ {"name": "Smith, PhD Ma", "family": "Smith", "suffix": "PhD Ma", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (declared)"], "initials": "S.", "capitalized_force": "Smith, PhD MA"} {"name": "Smith, Pharm D", "given": "Pharm", "middle": "D", "family": "Smith", "initials": "P. D. S."} {"name": "Smith, Prof.", "title": "Prof.", "family": "Smith", "initials": "S."} -{"name": "Smith, RA PhD Ma", "title": "RA", "given": "PhD", "middle": "Ma", "family": "Smith", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (vocabulary)"], "initials": "P. M. S.", "capitalized_force": "Ra PhD Ma Smith"} {"name": "Smith, RN - CRNA", "family": "Smith", "suffix": "RN - CRNA", "initials": "S."} {"name": "Smith, Sgt Major", "title": "Sgt Major", "family": "Smith", "initials": "S."} {"name": "Smith, Sir", "title": "Sir", "given": "Smith", "initials": "S."} {"name": "Smith, Sr.", "family": "Smith", "suffix": "Sr.", "initials": "S.", "generation": "Sr."} {"name": "Smith, U.S. Senator John", "title": "U.S. Senator", "given": "John", "family": "Smith", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (shape)"], "initials": "J. S."} {"name": "Smith, V; MD", "given": "V;", "family": "Smith", "suffix": "MD", "initials": "V. S."} +{"name": "Smith, VC PhD Ma", "title": "VC", "given": "PhD", "middle": "Ma", "family": "Smith", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (vocabulary)"], "initials": "P. M. S.", "capitalized_force": "Vc PhD Ma Smith"} {"name": "Smith, Van V", "given": "Van", "family": "Smith", "suffix": "V", "initials": "V. S.", "generation": "V"} {"name": "Smith, XYZ", "given": "XYZ", "family": "Smith", "initials": "X. S.", "capitalized_force": "Xyz Smith"} {"name": "Smith, de Mesnil Jean", "family": "Smith de Mesnil Jean", "initials": "S. M. J."} @@ -4536,6 +4534,8 @@ {"name": "VAN DER WALT", "given": "VAN", "family": "DER WALT", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: particle as family (vocabulary)"], "initials": "V. W.", "capitalized": "Van der Walt"} {"name": "VAN GOGH VINCENT", "given": "VAN", "middle": "GOGH", "family": "VINCENT", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: particle as family (vocabulary)"], "initials": "V. G. V.", "capitalized": "Van Gogh Vincent"} {"name": "VAN TER HORST", "given": "VAN", "family": "TER HORST", "ambiguities": ["PARTICLE_OR_GIVEN"], "alternatives": ["PARTICLE_OR_GIVEN: particle as family (vocabulary)"], "initials": "V. H.", "capitalized": "Van ter Horst"} +{"name": "VC DDS", "title": "VC", "family": "DDS", "initials": "D.", "capitalized": "Vc Dds"} +{"name": "VC PhD Jr., John", "given": "John", "family": "VC", "suffix": "PhD Jr.", "initials": "J. V.", "capitalized_force": "John Vc PhD Jr.", "generation": "Jr.", "credentials": "PhD"} {"name": "VI, AD", "given": "AD", "family": "VI", "initials": "A. V.", "capitalized": "Ad Vi"} {"name": "VINCENT VAN GOGH", "given": "VINCENT", "family": "VAN GOGH", "initials": "V. G.", "capitalized": "Vincent van Gogh"} {"name": "Va'apu'u Vitale", "given": "Va'apu'u", "family": "Vitale", "initials": "V. V.", "capitalized_force": "Va'Apu'U Vitale"} From 5e7759831cb767da608e065f3439f5dc777ce3da Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Sat, 21 Nov 2026 20:14:23 -0800 Subject: [PATCH 2/5] Address review of #1520: the remaining RA duals, the costs, the figures, rows The four reviews of the first commit found RA still standing as the title/suffix dual in five decisions Standing lines (S7, H3 and H4 now stating readings that no longer hold), in six _pieces.py and _comma.py docstrings, and in rules/C9 and C12; each now writes VC, read as RA was. The decisions entry records the costs the first commit missed: a lone RA after a family comma in a name written wholly in capitals is the given name, a title behind a leading RA falls into the middle name, R.A with no comma ends the name as the family, and the spaced Sig. ra no longer joins the title (decisions/R4's #840 entry marked). Its config_diff figures are re-taken on the corpora holding the respelled examples (422 names, 99, 110 and 32 moved) with the second command written out, and its snapshot breakdown and the CLDR rendering's provenance are corrected. The release log and migrate.rst state the capitals limit. New case rows pin the comma, order and spelling paths (Kim, Ra; KING, RA; Jane Doe R.A; Kim RA, Jr.; kim ra; Ra Kim, Mi; Sig. ra Rossi; both family-first orders), and the German-choice test gains the second-comma, capitals and strict Kim Ra rows. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- ...aracter-suffix-word-inside-a-comma-part.md | 2 +- docs/design/decisions/H3-title-runs-floor.md | 2 +- ...t-vocabulary-still-has-to-name-somebody.md | 2 +- .../H6-title-before-a-family-comma.md | 2 +- .../R4-case-repair-reads-the-unjoined-mark.md | 2 +- ...S7-company-of-an-unambiguous-credential.md | 2 +- .../design/decisions/vocabulary-collisions.md | 6 +- ...x-word-ending-the-name-before-the-comma.md | 2 +- ...aracter-suffix-word-inside-a-comma-part.md | 2 +- docs/locales.rst | 6 +- docs/migrate.rst | 8 +- docs/release_log.rst | 2 +- nameparser/_pipeline/_comma.py | 2 +- nameparser/_pipeline/_pieces.py | 14 +- tests/v2/cases.py | 125 ++++++++++++++++-- tests/v2/pipeline/test_pieces.py | 2 +- tests/v2/test_cases.py | 12 +- tests/v2/test_parser.py | 23 +++- tests/v2/test_reading_index.py | 2 +- tools/differential/corpus_rules.jsonl | 2 +- tools/differential/snapshot.jsonl | 2 +- 22 files changed, 171 insertions(+), 53 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 980997425..a95c4173a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -385,7 +385,7 @@ Don't use the bare `python3 -m doctest .rst` CLI (no `optionflags`) to che **`pr/NNN` local branches** track upstream PRs — don't commit to them by accident. Check `git branch --show-current` before starting work. -**Title vs suffix is positional for BARE words, and the leading period-abbreviation rule overrides even that** — a word matching `TITLES` at the front of a name becomes `title`; the same word matching `SUFFIX_ACRONYMS`/`SUFFIX_WORDS` at the end becomes `suffix` (never both, regardless of the word's real-world meaning). The `TITLES`/suffix overlap was audited in #296 (2026-08-23): the pure postnominals (`jr`, `junior`, `phd`, `do`, `se`) left `TITLES`, the v1-residue `dr`/`sra` left the suffix sets, and the ten words in both on 2026-11-21 (`ms`, `sr`, `lt`, `vc`, the ranks `cpl`, `cpo`, `cpt`, `csm`, `sgm`, and since #1128 the Cyrillic `д-р`; `md`, `sa` and `ra` were duals too until #853 took `md`'s title reading out, a leading `Md` being the given name Muhammad, #857 took `sa` out of the vocabulary, and #1483 gave `ra` a Korean name reading, which makes its title one only inside a title phrase, rules/H9) are deliberate duals that position decides (recount with `L = Parser().lexicon._sets; sorted(L.titles & (L.suffix_acronyms | L.suffix_words))`). External test sources (old issue gists, etc.) sometimes assert `suffix` for a leading professional abbreviation like `RA`/`PD`/`Dipl.-Ing.` — that's the source data being wrong, not a parser bug. Verify position before "fixing" it. Two qualifications the older "purely positional" wording papered over, the first measured 2026-08-01 and the second answered 2026-09-08 (#316): a PERIOD-marked leading word is claimed by the shape rule before any vocabulary is read (`"Esq. Smith"` → `title`, though `esq` is suffix-only), save a listed title and, since #789, a given name written short (`"Chas. Smith"` → `given`), while a run of single letters, which the shape rule never takes, is a title at the head only by rules/H10's vocabulary (`"U.S. Senator John Smith"` → `title='U.S. Senator'`), and a PERIOD-marked trailing word is claimed by VOCABULARY — first the suffix sets, which the peel reads before anything else (`"John Smith Esq."` → `suffix`), then the titles (`"John Smith Prof."` → `title='Prof.'`, `rules/H5`) — while an unlisted abbreviation there stays a name part (`"John Smith Xyz."` → `family='Xyz.'`) unless it is written as two or more period-separated chunks, which since 2.4 IS a trailing shape rule (`Policy.unlisted_dotted_suffixes`, default on: `"John Smith X.Y.Z."` → `suffix='X.Y.Z.'`, read by the same words-to-spare count a bare ambiguous acronym takes, `rules/S3`), except paired initials in a script with capitals, which stay a name word (`"Ram Bahadur B.K."` → `family='B.K.'`, #864). The SINGLE trailing period is still not one, deliberately — it is the abbreviation shape any word can wear. The bare word is where "positional" still holds whole -- outside a part past the second comma, which holds no name word, so C2 reads a bare title word there as a title since #603 (`Eric H. Holder, Jr., Attorney General`), and outside a listed salutation ending the given part after a family comma, which rules/H8 reads as the title since #835 (`Doe, Jane Mrs`), the comma having marked the surname's place -- and the reason it must: `TITLES` holds words that are in no suffix set — 787 of them on 2026-10-11 (746 before #606's salutations), measured with `L = Parser().lexicon._sets; len(L.titles - L.suffix_acronyms - L.suffix_words)`, a figure that grows with the vocabulary and never shrinks the argument — and many are ordinary surnames (`pope`, `bishop`, `judge`, `sheriff`, `baron`, `master`, ...), so a vocabulary-first rule over BARE trailing words would read `"Mary Jane Pope"` as `title='Pope'`, `family='Jane'`. The period is what separates the safe case from that one, and it separates it by being a WRITING convention rather than by making the collision go away: `"Mary Jane Pope"` keeps `family='Pope'` while `"Mary Jane Pope."` reads `title='Pope.'`, `family='Jane'`, a cost accepted under the input-is-a-name premise rather than one the rule prevents (the trailing-position bullet in decisions/vocabulary-exclusions, measured 2026-09-09). Since #316 that sentence describes the shipped rule rather than an aspiration. +**Title vs suffix is positional for BARE words, and the leading period-abbreviation rule overrides even that** — a word matching `TITLES` at the front of a name becomes `title`; the same word matching `SUFFIX_ACRONYMS`/`SUFFIX_WORDS` at the end becomes `suffix` (never both, regardless of the word's real-world meaning). The `TITLES`/suffix overlap was audited in #296 (2026-08-23): the pure postnominals (`jr`, `junior`, `phd`, `do`, `se`) left `TITLES`, the v1-residue `dr`/`sra` left the suffix sets, and the ten words in both on 2026-11-21 (`ms`, `sr`, `lt`, `vc`, the ranks `cpl`, `cpo`, `cpt`, `csm`, `sgm`, and since #1128 the Cyrillic `д-р`; `md`, `sa` and `ra` were duals too until #853 took `md`'s title reading out, a leading `Md` being the given name Muhammad, #857 took `sa` out of the vocabulary, and #1483 gave `ra` a Korean name reading, which makes its title one only inside a title phrase, rules/H9) are deliberate duals that position decides (recount with `L = Parser().lexicon._sets; sorted(L.titles & (L.suffix_acronyms | L.suffix_words))`). External test sources (old issue gists, etc.) sometimes assert `suffix` for a leading professional abbreviation like `PD`/`Dipl.-Ing.` — that's the source data being wrong, not a parser bug. Verify position before "fixing" it. Two qualifications the older "purely positional" wording papered over, the first measured 2026-08-01 and the second answered 2026-09-08 (#316): a PERIOD-marked leading word is claimed by the shape rule before any vocabulary is read (`"Esq. Smith"` → `title`, though `esq` is suffix-only), save a listed title and, since #789, a given name written short (`"Chas. Smith"` → `given`), while a run of single letters, which the shape rule never takes, is a title at the head only by rules/H10's vocabulary (`"U.S. Senator John Smith"` → `title='U.S. Senator'`), and a PERIOD-marked trailing word is claimed by VOCABULARY — first the suffix sets, which the peel reads before anything else (`"John Smith Esq."` → `suffix`), then the titles (`"John Smith Prof."` → `title='Prof.'`, `rules/H5`) — while an unlisted abbreviation there stays a name part (`"John Smith Xyz."` → `family='Xyz.'`) unless it is written as two or more period-separated chunks, which since 2.4 IS a trailing shape rule (`Policy.unlisted_dotted_suffixes`, default on: `"John Smith X.Y.Z."` → `suffix='X.Y.Z.'`, read by the same words-to-spare count a bare ambiguous acronym takes, `rules/S3`), except paired initials in a script with capitals, which stay a name word (`"Ram Bahadur B.K."` → `family='B.K.'`, #864). The SINGLE trailing period is still not one, deliberately — it is the abbreviation shape any word can wear. The bare word is where "positional" still holds whole -- outside a part past the second comma, which holds no name word, so C2 reads a bare title word there as a title since #603 (`Eric H. Holder, Jr., Attorney General`), and outside a listed salutation ending the given part after a family comma, which rules/H8 reads as the title since #835 (`Doe, Jane Mrs`), the comma having marked the surname's place -- and the reason it must: `TITLES` holds words that are in no suffix set — 787 of them on 2026-10-11 (746 before #606's salutations), measured with `L = Parser().lexicon._sets; len(L.titles - L.suffix_acronyms - L.suffix_words)`, a figure that grows with the vocabulary and never shrinks the argument — and many are ordinary surnames (`pope`, `bishop`, `judge`, `sheriff`, `baron`, `master`, ...), so a vocabulary-first rule over BARE trailing words would read `"Mary Jane Pope"` as `title='Pope'`, `family='Jane'`. The period is what separates the safe case from that one, and it separates it by being a WRITING convention rather than by making the collision go away: `"Mary Jane Pope"` keeps `family='Pope'` while `"Mary Jane Pope."` reads `title='Pope.'`, `family='Jane'`, a cost accepted under the input-is-a-name premise rather than one the rule prevents (the trailing-position bullet in decisions/vocabulary-exclusions, measured 2026-09-09). Since #316 that sentence describes the shipped rule rather than an aspiration. ### Tests (`tests/`) diff --git a/docs/design/decisions/C9-one-character-suffix-word-inside-a-comma-part.md b/docs/design/decisions/C9-one-character-suffix-word-inside-a-comma-part.md index 38361f39e..afd122509 100644 --- a/docs/design/decisions/C9-one-character-suffix-word-inside-a-comma-part.md +++ b/docs/design/decisions/C9-one-character-suffix-word-inside-a-comma-part.md @@ -3,7 +3,7 @@ ## Standing - Inside a comma part a one-character suffix word is read by what stands before it: behind another suffix word it continues the run, with a period or without (`Smith, PSM I` → suffix 'PSM I'; `Smith, PSM I.` → suffix 'PSM I.'), and behind a name word an ASCII period makes it a middle initial while the bare letter, with no further comma after it, is the suffix (`Smith, John V.` → middle 'V.'; `Smith, John V` → suffix 'V', v1 parity) — 2026-08-25 #430. -- The class is one-character suffix vocabulary, not a roman numeral (`Smith, John 2.` → middle '2.'), and a run's first word that is title vocabulary too stays in the run (`Smith, RA I` → suffix 'RA I'; `Smith, Jr. I` → suffix 'Jr. I') — 2026-08-25 #430. +- The class is one-character suffix vocabulary, not a roman numeral (`Smith, John 2.` → middle '2.'), and a run's first word that is title vocabulary too stays in the run (`Smith, VC I` → suffix 'VC I'; `Smith, Jr. I` → suffix 'Jr. I') — 2026-08-25 #430. - The given part asks no initial in front of a numeral, the no-comma reading of one, so a numeral behind an initial stays the suffix (`Chang, Andy C I` → middle 'C', suffix 'I') — 2026-08-25 #430. - A lone letter ending the given part ahead of a further comma is the middle initial whatever stands before it, a credential run in front stopping short of it (`Smith, John PhD I, Jr.` → middle 'I', suffix 'PhD, Jr.'), at the cost of splitting a certification level from its credential (`Smith, John PSM I, Jr.`) — 2026-10-25 #819. - The given part's walk asks the numeral's predicate, which reads a one-letter numeral there by the vocabulary, so an unlisted letter stays the middle initial (`SMITH, JOHN X`), and a numeral of two or more letters as the generation (`Smith, John VI` → suffix 'VI') — 2026-10-25 #819. diff --git a/docs/design/decisions/H3-title-runs-floor.md b/docs/design/decisions/H3-title-runs-floor.md index ed6adce8e..5f9c35f7c 100644 --- a/docs/design/decisions/H3-title-runs-floor.md +++ b/docs/design/decisions/H3-title-runs-floor.md @@ -4,7 +4,7 @@ - The leading title run gives back its last word where everything behind the run is suffix pieces and that word is not suffix vocabulary: `Dr Pope Jr` → title 'Dr', family 'Pope', suffix 'Jr' — 2026-09-08 #316. - It gives back one word only: a joined title unit stays the title (`Prince of Wales Jr` → family 'Jr'), and where the word given back is the whole name it reads as the given name (`Dr Jr` → given 'Dr', suffix 'Jr', reporting `title-or-name`) — 2026-09-08 #316. -- The floor asks about the run's last word and nothing else: a run ending in suffix vocabulary keeps it (`Dr Pope RA PhD` → title 'Dr Pope RA'), and a bare numeral behind the run is the numeral fork's, not this floor's (`Dr Pope V` → title 'Dr Pope', given 'V') — 2026-09-08 #316. +- The floor asks about the run's last word and nothing else: a run ending in suffix vocabulary keeps it (`Dr Pope VC PhD` → title 'Dr Pope VC'), and a bare numeral behind the run is the numeral fork's, not this floor's (`Dr Pope V` → title 'Dr Pope', given 'V') — 2026-09-08 #316. Open: none in this file. diff --git a/docs/design/decisions/H4-input-that-is-nothing-but-vocabulary-still-has-to-name-somebody.md b/docs/design/decisions/H4-input-that-is-nothing-but-vocabulary-still-has-to-name-somebody.md index 3bec9c492..b20bc2586 100644 --- a/docs/design/decisions/H4-input-that-is-nothing-but-vocabulary-still-has-to-name-somebody.md +++ b/docs/design/decisions/H4-input-that-is-nothing-but-vocabulary-still-has-to-name-somebody.md @@ -5,7 +5,7 @@ - An input the title peel eats down to one last word that is itself title vocabulary reads that word as the name and reports `title-or-name`, the `detail` naming the word: `Lord Chancellor` → family 'Chancellor', `Dr. Pope` reports — 2026-09-07 #491. - `title-or-name` is emitted at assign's lone-name-word site, not at H1's retag, so it is reported under every name order, and so is the suffix half's `suffix-or-name`; the peel half's `detail` names no field — 2026-09-07 #491. - Nothing is reported where no word was chosen or where the word left standing is no title word: a title alone or a title run with nothing behind it (`Dr.`, `Prince of Wales`), and a title before an ordinary word (`Dr. Smith`) — 2026-09-07 #491. -- An input whose every word is post-nominal vocabulary reads its first word as the name and reports `suffix-or-name` (`Rinpoche`, `QC MP` → given 'QC', `PhD`), reached only where no title was peeled (`RA DDS` reports nothing) and not with a maiden name beside it (`abd née Jones`) or for a lone CJK honorific a script order placed (`さん`); `Jr.` alone is H2's title — 2026-09-07 #491. +- An input whose every word is post-nominal vocabulary reads its first word as the name and reports `suffix-or-name` (`Rinpoche`, `QC MP` → given 'QC', `PhD`), reached only where no title was peeled (`VC DDS` reports nothing) and not with a maiden name beside it (`abd née Jones`) or for a lone CJK honorific a script order placed (`さん`); `Jr.` alone is H2's title — 2026-09-07 #491. - `MA` alone reports `given-or-family` where `PhD` alone reports `suffix-or-name`, an asymmetry between this rule and O5 recorded and not fixed — 2026-09-07 #491. - A lone name unit that is a join carrying title vocabulary reports `title-or-name` too (`John of Bishop`, `Smith and Bishop`; `prince` was the example until it left TITLES on 2026-10-27, decisions/H9), stated since 2026-10-20 as rules/H7 — 2026-09-07 #491. - The join clause (rules/H7's, recorded here) stands beside the peel clause, so a peeled title, a maiden name or a claimed word does not silence it (`Dr. Smith and Bishop`, `van and Bishop`, `Attorney General of Minnesota` report) — 2026-09-08 #518. diff --git a/docs/design/decisions/H6-title-before-a-family-comma.md b/docs/design/decisions/H6-title-before-a-family-comma.md index a09310a17..3b07f456b 100644 --- a/docs/design/decisions/H6-title-before-a-family-comma.md +++ b/docs/design/decisions/H6-title-before-a-family-comma.md @@ -4,7 +4,7 @@ - A run of title words opening the part before a family comma is the title, joining the title field in input order with any title after the comma, and the comma decision is untouched, so the reading is the same under every name order: `Dr. Smith, John` → title 'Dr.', family 'Smith'; `Prof. Dr. Brühl, Ada Cornelia` → title 'Prof. Dr.' — 2026-10-17 #701. - The run admits a word by vocabulary only, never by H2's shape, since the slot is a surname's slot too and a period-marked word there is as often a surname's abbreviated head, a given name written short or a stray period as a title: `Xyz. Smith, John` → family 'Xyz. Smith', `Mt. Pleasant, Jane` → family 'Mt. Pleasant'. `Sta. Maria, Juan` → family 'Sta. Maria' is the particle stop's since #725, which a shape peel would have to keep. A title missing there is fixed by listing it, a given name written short by a `given` reading with `same_as`, and a stray period reads where the rules put it — 2026-10-17 #701; 2026-10-18 #710; 2026-11-06 #1115. -- The run leaves the family its last piece (`Dr., John` → family 'Dr.'), stops at a word that is a particle too (`St Pierre, Ed` and `Freiherr von Berg, Ed` keep their families, while `Dr. Freiherr von Berg, Ed` peels 'Dr.'), and stops where nothing but post-nominals stands behind a title (`RA PhD Jr., John` → family 'RA'), so a title/suffix dual with a name word behind it peels (`Rev. Sr. Smith, Mary` → title 'Rev. Sr.') — 2026-10-17 #701. +- The run leaves the family its last piece (`Dr., John` → family 'Dr.'), stops at a word that is a particle too (`St Pierre, Ed` and `Freiherr von Berg, Ed` keep their families, while `Dr. Freiherr von Berg, Ed` peels 'Dr.'), and stops where nothing but post-nominals stands behind a title (`VC PhD Jr., John` → family 'VC'), so a title/suffix dual with a name word behind it peels (`Rev. Sr. Smith, Mary` → title 'Rev. Sr.') — 2026-10-17 #701. - A surname-like title opening a two-word surname is the title (`Pope Smith, John` → title 'Pope'), an accepted cost — 2026-10-17 #701. - `gov` is a title (`Lt. Gov. Smith, John` → title 'Lt. Gov.'), the first piece the run leaves is the family whatever it is (`Dr. PhD Smith, John` → family 'PhD Smith'), and the particle stop is all that keeps a rank in the family, so `Herzog Lambsdorff, Otto` reads title 'Herzog' (`Graf Lambsdorff, Otto`, a rank particle since decisions/vocabulary-collisions' 2026-11-04 (Derek), #709 entry, keeps family 'Graf Lambsdorff') — 2026-10-17 #701. - The comma-less writing of an abbreviated surname is not this rule's; `sta` and `sto` are saint particles, so `Juan Sta. Maria` reads family 'Sta. Maria' and `Juan Sta. Maria Reyes` family 'Sta. Maria Reyes' — 2026-10-18 #710; 2026-11-04 #725. diff --git a/docs/design/decisions/R4-case-repair-reads-the-unjoined-mark.md b/docs/design/decisions/R4-case-repair-reads-the-unjoined-mark.md index 9b53b60b6..5825bf7c7 100644 --- a/docs/design/decisions/R4-case-repair-reads-the-unjoined-mark.md +++ b/docs/design/decisions/R4-case-repair-reads-the-unjoined-mark.md @@ -117,7 +117,7 @@ Accepted costs, deferred to the rescoped #459 rather than relitigated here: the - 2026-10-22 #826 — CASE IS A COMPARED SURFACE: the snapshot records `capitalized()` and `capitalized(force=True)` for every corpus name, reversing 2026-08-29, WHY CASE IS NOT A COMPARED SURFACE on the test that entry's 2026-09-02 amendment set, a case change that escapes as #408's initials did. Two have. #478 shipped `jose ortega-y-gasset` repaired to `Ortega-Y-Gasset` in 2.2.0 and 2.3.0 (the all-caps spelling had read that way since 2.0.0), and #808 repaired `PA-C` to `Pa-C` and `FNP-BC` to `Fnp-Bc` from 2.0.0 through 2.5.0, each with every check green. The 2026-08-29 entry's other objection, a column arriving pre-failed by 139 entries against 1.4.0, was about the differential ledger. The snapshot (#664) records the tree's own reading and reports only what a change moves, so the column started empty. BOTH VIEWS, because they see different things: only the plain view sees rules/R5's gate, and the one-case names where #478 and #808 showed are its population; the forced view runs the repair over the mixed-case majority, which the gate otherwise hides. Over the 6006 entries on this date, 238 record a `capitalized` view and 695 a `capitalized_force` view. EACH VIEW IS RECORDED ONLY WHERE IT MOVES SOMETHING: `capitalized` where it renders other than `str()` of the parse, `capitalized_force` where it renders other than `capitalized()` does. A name repair leaves alone records neither, so a role move echoes into a case view only in a name repair changes, and there whenever it changes the rendering, since a view is the whole repaired name (`JOHN SMITH` → 'John Smith', under FAMILY_FIRST 'Smith John', no word recased): the echo the initials column has. A snapshot recorded before this entry carries no case view, so `snapshot.py` compares the views only against one that records them (`--since v2.5.0` reported 961 entries before that rule, 910 of them the keys appearing, and 51 after it, as master's own snapshot does). NEGATIVE CONTROLS, run as `snapshot.py --tree ` against this snapshot. The tree before #808's fix (`1ae2aedc^`) moves three entries: `JOHN SMITH, FNP-BC` and `john smith, otr/l` in `capitalized`, and `John Smith, otr/l` in `capitalized_force`, the last seen by the forced view alone. The tree before #478's fix (`20cf32f6^`) moves 405 entries, most of them later behavior changes; among them `JOSE ORTEGA-Y-GASSET` and `jose ortega-y-gasset` move in `capitalized`, and `Jose Ortega-Y-Gasset` in `capitalized_force`, which only the forced view sees. The facade's `capitalize()` is not recorded, since it renders through the same repair. `compare.py` records both views for a 2.x baseline and neither for 1.4.0, whose rows go through `facade_view`. Cost on this date: the two views take 0.18s of `snapshot.read`'s 1.38s, and the file grew from 799,124 to 847,676 bytes. The forced view put some long-standing repairs on record, among them `A.B. Vajpayee` → 'A.b. Vajpayee' and `Ibn-ʿAlī` → 'ibn-ʿalī'. They are recorded as the tree reads them, not adjudicated here. SUPERSEDES: 2026-08-29, WHY CASE IS NOT A COMPARED SURFACE; and in 2026-08-29, THE VERIFICATION LIMIT, its claims that no ledger run at any baseline can see a change that moves only case and that nothing is owed for one, and its 2026-09-02 amendment's conclusion that no `capitalized()` column is owed yet. `compare.py --baseline 2.1.0` now shows that entry's own deviation (`ANH DO` → 'Anh Do', where 2.1.0 gave 'Anh do'); a 1.4.0 baseline still cannot. - 2026-10-22 #838 — CAPITALS INSIDE A WORD. The fall-through was `str.capitalize()` on the whole `_WORD` match, which holds a word's interior full stops and any modifier letter (category Lm, which `\w` matches) that opens it, so a capital not standing first was lowered: `j.r.r. tolkien` → 'J.r.r. Tolkien', `AHMAD IBN-ʿALĪ` → 'Ahmad ibn-ʿalī', and under force `A.B. Vajpayee` → 'A.b. Vajpayee'. 1.4.0 through 2.5.0 give the old readings (wheels, measured 2026-10-22, `HumanName(n).capitalize(force=True)`), so this is a fix, not a regression. The fix title-cases each full-stop chunk from its first character outside Lm. TWO ANSWERS. Every chunk is a word of its own rather than every letter a capital, which gives `St.John`, not `ST.JOHN`, and matches the hyphen split: a chunk takes the Mac/Mc convention as a hyphen part does (`J.MCDONALD SMITH` → 'J.McDonald Smith', where 2.5.0 gave 'J.mcdonald'; `mcdonald.jones` → 'McDonald.Jones'), which the first version missed, the Mac branch then running before the split and keeping everything after the first full stop as written (review of #839). Only Lm is passed over: an apostrophe of any spelling (`'`, U+2018, U+2019) is not a word character, so `'abd` was already 'Abd'; a digit is not passed over, or `3rd` would become '3Rd'. THE COST, ACCEPTED: an unlisted abbreviation whose own ending follows its full stop reads as two words. The snapshot showed it on the CLDR fictional `Dut.ra Prof.ra` ('Dut.Ra Prof.Ra' under force), and with it go the one-case Italian salutations (`SIG.RA` → 'Sig.Ra', `DOTT.SSA` → 'Dott.Ssa') that `str.capitalize()` had always repaired correctly, and the Latvian and Norwegian degrees (`dr.philol.` → 'Dr.Philol.', `st.repr.` → 'St.Repr.', three CLDR-only rows), which now read as their spaced spellings do (`Dr. med. univ.` forced → 'Dr. Med. Univ.', decisions/R5's title-repair evidence). A NARROWING WAS BUILT AND DECLINED: two or more letters after the last full stop, closed by none, kept lowercase as an abbreviation's written ending. It kept `Sig.ra` but gave `st.john` → 'St.john', `lt.gov` → 'Lt.gov' and forced `J.Smith` → 'J.smith', and still missed `dr.philol.`, whose ending is closed; a shape cannot tell an ending from a joined name or word, so the remedy is a listed casing, a `cased` mask asked before this clause. DECIDED (Derek, 2026-10-22): the `St.John` reading, with the Italian abbreviated salutations to be listed as titles with masks before 2.6.0 ships. Unlisted joined credentials are a vocabulary question as well (`jd.cpa` → 'Jd.Cpa'). BONUS: 'ʼn' upper-cases to the Lm apostrophe plus 'N', so 'ʼNa' is now a fixpoint, where the second pass gave 'ʼna'; capitalized()'s docstring no longer lists it. SNAPSHOT, 2026-10-22: the moved entries are listed in this change's diff of snapshot.jsonl, each read. Pinned by rules/R4's examples (each fix row fails on the parent) and test_a_word_takes_its_capital_past_a_caseless_lead. -- 2026-10-22 #840 — THE REMEDY FOR #838's ITALIAN COST SHIPS: the abbreviated salutations and letter-heading honorifics whose ending follows their full stop are titles with `cased` masks (decisions/salutation-titles), so `SIG.RA MARIA ROSSI` repairs to 'Sig.ra Maria Rossi' again, as 1.4.0 through 2.5.0 gave it, and `dott.ssa` to 'Dott.ssa'. The mask is asked before the chunk split, the precedence the 2026-10-22 #838 entry relied on. The accepted cost stands for an unlisted ending (the Sardinian `DUT.RA` → 'Dut.Ra', CLDR's `Dut.ra Prof.ra`). A spaced `Sig. ra` is out of reach: it joins as a title run, `ra` being a listed title, and forced repair writes 'Sig. Ra'. +- 2026-10-22 #840 (its spaced `Sig. ra` sentence's reason superseded by decisions/vocabulary-collisions' 2026-11-21 #1483 entry: `ra` is a title only inside a title phrase since, so `Sig. ra Rossi` reads title 'Sig.', given 'ra'; forced repair still writes 'Sig. Ra') — THE REMEDY FOR #838's ITALIAN COST SHIPS: the abbreviated salutations and letter-heading honorifics whose ending follows their full stop are titles with `cased` masks (decisions/salutation-titles), so `SIG.RA MARIA ROSSI` repairs to 'Sig.ra Maria Rossi' again, as 1.4.0 through 2.5.0 gave it, and `dott.ssa` to 'Dott.ssa'. The mask is asked before the chunk split, the precedence the 2026-10-22 #838 entry relied on. The accepted cost stands for an unlisted ending (the Sardinian `DUT.RA` → 'Dut.Ra', CLDR's `Dut.ra Prof.ra`). A spaced `Sig. ra` is out of reach: it joins as a title run, `ra` being a listed title, and forced repair writes 'Sig. Ra'. - 2026-10-28 #357 — THE SHIM'S HALVES OF THIS RULE'S ENTRIES GO WITH THE SHIM (decisions/3-0-reevaluations' 2026-10-28 #357, REMOVAL entry): the v1 pickle load as a second producer of `UNCLASSIFIED_TAG`, leaving `replace()` the one; the first-parse raise for a v1 `Constants` carrying a mismatched mask (2026-09-23 #459, A DECIDED EXCEPTION), the core `Lexicon` raising on it as before; and the filter of v1 `Constants` entries with its folded cross-set checks (2026-10-02 #541, 2026-10-02 #582). A punctuated mask such as 1.4.0's `M.D.` stays legal in a `Lexicon`. SUPERSEDES: the 2026-09-23 #459, A DECIDED EXCEPTION, 2026-10-02 #541 and 2026-10-02 #582 entries, all about translating a v1 `Constants`, and the 2026-08-29 (#458 review) entry's second producer, the v1 pickle load. - 2026-10-28 #939 — A CONNECTIVE BETWEEN PARTICLES: rules/R4's all-particles Except sets aside a connective that is not also particle vocabulary, standing between the part's words, as rules/R2 does, so `FRITZ FREIHERR UND VON BAR` should repair to 'Fritz Freiherr und Von Bar' where it gives 'Fritz freiherr und von bar', a deviation #939 tracks; decided and measured in decisions/R2's 2026-10-28 #754 (Derek), A CONNECTIVE AMONG PARTICLES entry. - 2026-11-02 #1014 (Derek), DECIDED — A NAME OPENING MAC TAKES ITS INNER CAPITAL FROM A MASK, NOT FROM ITS SPELLING. The fall-through had capitalized after any `ma?c` prefix with two or more letters behind it since 0.2.3, so a single-case `MACHADO` repaired to 'MacHado', `MACIAS` to 'MacIas', `MACIEJEWSKI` to 'MacIejewski'; #56 asked in 2015 for an exceptions list beside the regex, and only the length check shipped. Measured over the mixed-case writings of every word the regex matched, each counted as its writer typed it, in the ORCID family-name box and the names of the UK Electoral Commission donors, GOV.UK people and ClinicalTrials.gov officials local corpora (2026-11-02): 4,616 writings of 970 words, the old convention matching the writer's spelling in 16.3% and plain title case in 83.7%; over the same four sources the Mc convention matched 96.8% of 6,312 Mc writings (94.3% of ORCID's 2,764), the rest mostly names Mc opens that are not Gaelic, `Mchunu` 24 the commonest, then `Mchedlishvili` and `Mchome` 5 each. The Gaelic Mac names split by family, so no shape decides them: `MacDonald` 143 against `Macdonald` 77, `Mackenzie` 59 against `MacKenzie` 44, `Mackay` 73 against `MacKay` 26, `MacLeod` 39 against `Macleod` 18. The mask records the spelling where its bearers lean one way: a word written MacX in more than half of at least three writings carries one, 42 words, which brings the measured match to 91.2% (in-sample, since the masks were chosen from the writings they are scored on; at least two writings gave 60 masks and 92.0%, at least five 25 and 90.2%). Recipe: for each source, read the field named (`family` for ORCID's `raw.jsonl`, `name` for the other three) and take every match of `(? None: notes="the given name its bearers file it as (#1469)"), # #1483: `ra` is a Korean surname and given name as well as en.toml's # credential and de.toml's title, so ko.toml's name readings gate both - # (rules/S4, rules/H9). Each row checked against the 1.4.0 and 3.1.0 - # wheels on 2026-11-21; the feat rows fail on master + # (rules/S4, rules/H9). Each row's notes checked against the wheels + # they name on 2026-11-21; the feat rows fail on master Case("a_korean_surname_ra_ending_two_words_is_the_family", "Kim Ra", {"given": "Kim", "family": "Ra"}, @@ -1510,9 +1510,10 @@ def _check_cjk_shape_purity(self) -> None: Case("ra_keeps_the_credential_after_a_second_comma", "Jane Doe, PT, RA", {"given": "Jane", "family": "Doe", "suffix": "PT, RA"}, - notes="boundary: a family name alone read without the gate " - "would have read de.toml's title past the second comma " - "(rules/C2); the given reading gates the title too"), + notes="boundary: with the family reading alone de.toml's " + "title would stay ungated, only a given reading making a " + "title one inside a phrase (rules/H9), and rules/C2 would " + "read it as the title past the second comma"), Case("ra_written_with_its_stops_keeps_the_credential", "Jane Doe, R.A.", {"given": "Jane", "family": "Doe", "suffix": "R.A."}, @@ -1526,7 +1527,7 @@ def _check_cjk_shape_purity(self) -> None: notes="an accepted cost: the gated class written without its " "last stop is no dotted acronym, and the one-word part " "after a family comma is the given name, as 'Jane Doe, " - "M.A' reads on master (decisions/suffix-acronym-collisions, " + "M.A' reads on master (decisions/vocabulary-collisions, " "2026-11-21 #1483); 1.4.0 through 3.1.0 read suffix 'R.A'"), Case("ra_alone_after_a_family_comma_in_capitals_is_the_credential", "Doe, RA", @@ -1543,8 +1544,9 @@ def _check_cjk_shape_purity(self) -> None: classification="feat(#1483)", notes="an accepted cost: Rechtsanwalt in front is a title only " "in a phrase now (rules/H9), and no choice of languages " - "drops ko.toml's name reading; 1.4.0 through 3.1.0 read " - "title 'RA'"), + "drops ko.toml's name reading (a strict German choice " + "reads none and keeps the title); 1.4.0 through 3.1.0 " + "read title 'RA'"), Case("ra_ending_a_name_in_capitals_stays_the_credential", "KIM MI RA", {"given": "KIM", "family": "MI", "suffix": "RA"}, @@ -1552,6 +1554,101 @@ def _check_cjk_shape_purity(self) -> None: notes="boundary, not fixed: a name written wholly in capitals " "gives no case signal (rules/S6) and has a word to spare " "(rules/S4); 1.4.0 read the same fields"), + Case("ra_alone_after_a_family_comma_is_the_given_name", + "Kim, Ra", + {"given": "Ra", "family": "Kim"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="Title case leans to the name (rules/S6); 1.4.0 read " + "title 'Ra', first 'Kim', 2.2.0 through 3.1.0 suffix 'Ra' " + "with no given name"), + Case("ra_alone_after_a_family_comma_in_capitals_is_the_given_name", + "KING, RA", + {"given": "RA", "family": "KING"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="a name wholly in capitals gives no case signal (rules/S6), " + "so the lone member after a family comma is the given name: " + "the initials such filers mean, the credential's cost " + "otherwise; 1.4.0 read title 'RA', 3.1.0 suffix 'RA'"), + Case("ra_without_its_last_stop_ending_a_name_is_the_family", + "Jane Doe R.A", + {"given": "Jane", "middle": "Doe", "family": "R.A"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="an accepted cost, the no-comma twin of 'Jane Doe, R.A': " + "no dotted acronym (rules/S3), so the gate reads the name " + "word, as 'John Smith M.A' reads on master; 1.4.0 through " + "3.1.0 read suffix 'R.A'"), + Case("ra_in_capitals_before_a_generation_comma_leaves_a_lone_given", + "Kim RA, Jr.", + {"given": "Kim", "suffix": "RA, Jr."}, + classification="feat(#1483)", + ambiguities=("given-or-family",), + notes="an accepted cost: capitals in a name of mixed case settle " + "the credential, leaving 'Kim' one name word, given by " + "default (rules/O5); 1.4.0 read last 'RA', 3.1.0 family " + "'Kim'"), + Case("ra_before_a_generation_comma_is_the_family", + "Kim Ra, Jr.", + {"given": "Kim", "family": "Ra", "suffix": "Jr."}, + ambiguities=("suffix-or-name",), + notes="the Title-case twin of 'Kim RA, Jr.'; 1.4.0 read the same " + "fields, 2.x through 3.1.0 family 'Kim', suffix 'Ra, Jr.'"), + Case("ra_before_a_credential_comma_is_the_family", + "Kim Ra, PhD", + {"given": "Kim", "family": "Ra", "suffix": "PhD"}, + ambiguities=("suffix-or-name",), + notes="1.4.0 read the same fields, 3.1.0 family 'Kim', suffix " + "'Ra, PhD'"), + Case("ra_in_lower_case_ending_two_words_is_the_family", + "kim ra", + {"given": "kim", "family": "ra"}, + ambiguities=("suffix-or-name",), + notes="a name wholly in one case, with no word to spare (rules/S4); " + "1.4.0 read the same fields, 3.1.0 suffix 'ra'"), + Case("ra_in_lower_case_ending_three_words_stays_the_credential", + "sang hak ra", + {"given": "sang", "family": "hak", "suffix": "ra"}, + ambiguities=("suffix-or-name",), + notes="boundary, the lower-case twin of 'KIM MI RA': no case " + "signal and a word to spare; 1.4.0 and 3.1.0 read the same " + "fields, unreported"), + Case("ra_before_a_family_comma_is_part_of_the_family", + "Ra Kim, Mi", + {"given": "Mi", "family": "Ra Kim"}, + notes="rules/H6 peels a title before a family comma by " + "vocabulary, and 'ra' is a title only inside a phrase now; " + "1.4.0 read the same fields, 3.1.0 title 'Ra', family 'Kim'"), + Case("a_spaced_italian_sig_ra_no_longer_joins_the_title", + "Sig. ra Rossi", + {"title": "Sig.", "given": "ra", "family": "Rossi"}, + classification="feat(#1483)", + notes="an accepted cost: the spaced ending of Signora is no title " + "run once 'ra' is a title only inside a phrase; the glued " + "'Sig.ra Rossi' is unchanged (decisions/R4's #840 entry); " + "1.4.0 through 3.1.0 read title 'Sig. ra'"), + Case("ra_opening_a_german_name_takes_the_next_title_into_the_middle", + "RA Dr. Hans Müller", + {"given": "RA", "middle": "Dr. Hans", "family": "Müller"}, + classification="feat(#1483)", + notes="an accepted cost, cost 1's worst shape: 'Dr.' behind a " + "given name is no leading title, as 'Dean Dr. Hans Müller' " + "reads on master; 1.4.0 through 3.1.0 read title 'RA Dr.'"), + Case("ra_opening_a_family_first_given_last_name_is_the_family", + "Ra Mi Kim", + {"given": "Kim", "middle": "Mi", "family": "Ra"}, + policy=Policy(name_order=FAMILY_FIRST_GIVEN_LAST), + classification="feat(#1483)", + notes="3.1.0 read title 'Ra', given 'Kim', family 'Mi'"), + Case("ra_ending_a_family_first_name_is_the_given_name", + "Kim Ra", + {"given": "Ra", "family": "Kim"}, + policy=Policy(name_order=FAMILY_FIRST), + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="the gated credential under a family-first order; 3.1.0 " + "read given 'Kim', suffix 'Ra'"), Case("ra_after_a_birth_marker_is_the_maiden_name", "Jane Doe née Ra", {"given": "Jane", "family": "Doe", "maiden": "Ra"}, @@ -4657,7 +4754,7 @@ def _check_cjk_shape_purity(self) -> None: "1.4.0 read the same; 2.3.0 read suffix 'VC MEng', " "the reading #540's marking moved. " "Spelled with 'RA' until #1483 gave ra a name reading; " - "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0"), + "'VC' reads as 'RA' did under 1.4.0, 2.2.0 and 2.3.0"), Case("a_dual_opening_the_given_part_turns_the_anchor_off", "Smith, Ms VC Ma", {"title": "Ms VC", "given": "Ma", "family": "Smith"}, @@ -4666,7 +4763,7 @@ def _check_cjk_shape_purity(self) -> None: "nothing, the second dual standing in that same run. " "1.4.0 and 2.3.0 read the same. " "Spelled with 'RA' until #1483 gave ra a name reading; " - "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0", + "'VC' reads as 'RA' did under 1.4.0, 2.2.0 and 2.3.0", shape=2), Case("a_dual_opening_the_given_part_silences_a_later_degree", "Smith, VC PhD Ma", @@ -4683,7 +4780,7 @@ def _check_cjk_shape_purity(self) -> None: "through 2.1.0 title 'VC PhD', first 'Ma', 'phd' being " "title vocabulary until #296. " "Spelled with 'RA' until #1483 gave ra a name reading; " - "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0", + "'VC' reads as 'RA' did under 1.4.0, 2.2.0 and 2.3.0", shape=2), Case("a_numeral_in_front_anchors_nothing", "smith, v ed", @@ -7570,7 +7667,7 @@ def _check_cjk_shape_purity(self) -> None: notes="#1323 boundary: a word in front of the pair speaks for " "nothing (rules/C5); only credentials behind it do. " "Spelled with 'RA' until #1483 gave ra a name reading; " - "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0"), + "'VC' reads as 'RA' did under 1.4.0, 2.2.0 and 2.3.0"), Case("two_caps_behind_a_member_with_nothing_behind_stay_initials", "John Smith, MA MJ", {"given": "MA", "middle": "MJ", "family": "John Smith"}, @@ -7608,7 +7705,7 @@ def _check_cjk_shape_purity(self) -> None: "suffix": "PhD"}, notes="#1323 boundary: as 'MS BM PhD'. " "Spelled with 'RA' until #1483 gave ra a name reading; " - "'LT' reads the same under 1.4.0, 2.2.0 and 2.3.0"), + "'LT' reads as 'RA' did under 1.4.0, 2.2.0 and 2.3.0"), Case("two_caps_before_a_capitals_dual_are_a_credential", "Jane Doe, MJ MS", {"given": "Jane", "family": "Doe", "suffix": "MJ MS"}, @@ -13039,7 +13136,7 @@ def _check_cjk_shape_purity(self) -> None: "policy the string reads the same, the built-in hyphen " "being no delimiter after a family comma either (#889). " "Spelled with 'RA' until #1483 gave ra a name reading; " - "'VC' reads the same under 1.4.0, 2.2.0 and 2.3.0"), + "'VC' reads as 'RA' did under 1.4.0, 2.2.0 and 2.3.0"), Case("semicolon_glued_after_a_whole_name", "John Smith, MD; PhD", {"given": "John", "family": "Smith", "suffix": "MD; PhD"}, classification="fix(semicolon-suffix-delimiter)", diff --git a/tests/v2/pipeline/test_pieces.py b/tests/v2/pipeline/test_pieces.py index 408fc3d8b..3fbd8b221 100644 --- a/tests/v2/pipeline/test_pieces.py +++ b/tests/v2/pipeline/test_pieces.py @@ -223,7 +223,7 @@ def test_the_leading_run_declines_to_give_back_a_suffix_word() -> None: what leaves the whole-segment carve-out and the all-title inputs exactly as they were. """ - assert _leading("VC DDS") == 1 # 'VC' is suffix vocabulary ('RA' until #1483 gave ra a name reading) + assert _leading("VC DDS") == 1 # 'VC' is suffix vocabulary ('RA' until #1483 took ra out of the titles) assert _leading("Jr. Ph. D.") == 1 # so is 'Jr.' assert _leading("Marquess of Bath") == 1 # nothing behind the run assert _leading("Dr.") == 1 # the whole-segment carve-out diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index f6f3a788c..a8d50d7e4 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -531,9 +531,10 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # test review's eight rows under three orders and its family-first # row under its declared policy; 2321 -> 2330 the same day, #1128's # reporting rows; 2330 -> 2342 the same day, #1483's `ra` rows - # reporting suffix-or-name. - assert claims == 2342, ( - f"the field sweep checks {claims} claims, recorded as 2342 on " + # reporting suffix-or-name; 2342 -> 2367 the same day, its review's + # comma, order and spelling rows. + assert claims == 2367, ( + f"the field sweep checks {claims} claims, recorded as 2367 on " f"2026-11-21") @@ -1036,8 +1037,9 @@ def test_the_alternative_sweep_sees_the_fields_it_checks() -> None: # 2026-11-21, #1517's five caps-shape rows under three orders, # 'Smith, M.B. ChB' being a stand-in reread; 647 -> 669 the same # day, its test review's rows; 669 -> 672 the same day, #1483's - # `ra` rows reporting suffix-or-name - assert (checked, skipped) == (672, 512), (checked, skipped) + # `ra` rows reporting suffix-or-name; 672 -> 675 the same day, its + # review's rows + assert (checked, skipped) == (675, 512), (checked, skipped) def test_every_case_name_is_unique() -> None: diff --git a/tests/v2/test_parser.py b/tests/v2/test_parser.py index 6e6a4666e..67a14bbbe 100644 --- a/tests/v2/test_parser.py +++ b/tests/v2/test_parser.py @@ -3595,8 +3595,9 @@ def test_a_strict_choice_keeps_a_callers_readings_over_the_union( # name, which a plain German choice would otherwise lose: choosing de # turns en.toml's credential off, de.toml holding a vocabulary # reading of the word, while ko.toml's name readings stay on, and a - # lone RA after a family comma read as the given name, the name - # reversed (#1483) + # lone RA after a comma read as the given name, making the comma a + # family comma and reversing the name ('Hans Müller, RA' -> given + # 'RA', family 'Hans Müller') (#1483) (False, "Hans Müller, RA", {"given": "Hans", "family": "Müller", "suffix": "RA"}), (False, "Müller, RA", {"family": "Müller", "suffix": "RA"}), @@ -3604,8 +3605,18 @@ def test_a_strict_choice_keeps_a_callers_readings_over_the_union( {"given": "Hans", "family": "Müller", "suffix": "LL.M., RA"}), (False, "Hans Müller RA", {"given": "Hans", "family": "Müller", "suffix": "RA"}), - # in front a plain choice reads the name reading, as the default does + (False, "Hans Müller, Dr., RA", + {"title": "Dr.", "given": "Hans", "family": "Müller", "suffix": "RA"}), + (False, "Jane Doe, PT, RA", + {"given": "Jane", "family": "Doe", "suffix": "PT, RA"}), + # in front a plain choice reads the name reading, as the default does, + # a title behind it falling into the middle name; in capitals after a + # family comma it is the given name, no case speaking for the + # credential (False, "RA Müller", {"given": "RA", "family": "Müller"}), + (False, "RA Dr. Hans Müller", + {"given": "RA", "middle": "Dr. Hans", "family": "Müller"}), + (False, "KING, RA", {"given": "RA", "family": "KING"}), # a strict choice reads no ko.toml: the title in front, the # credential behind (True, "RA Müller", {"title": "RA", "family": "Müller"}), @@ -3613,6 +3624,12 @@ def test_a_strict_choice_keeps_a_callers_readings_over_the_union( {"title": "RA Dr.", "given": "Hans", "family": "Müller"}), (True, "Hans Müller, RA", {"given": "Hans", "family": "Müller", "suffix": "RA"}), + (True, "Jane Doe, PT, RA", + {"given": "Jane", "family": "Doe", "suffix": "PT, RA"}), + (True, "KING, RA", {"family": "KING", "suffix": "RA"}), + # its cost: a Korean surname ending a name is the credential again, + # as the default read it before #1483 + (True, "Kim Ra", {"given": "Kim", "suffix": "Ra"}), ]) def test_a_german_choice_reads_ra_after_the_name_as_the_credential( strict: bool, text: str, fields: dict[str, str]) -> None: diff --git a/tests/v2/test_reading_index.py b/tests/v2/test_reading_index.py index dee43d888..b2fe32cbe 100644 --- a/tests/v2/test_reading_index.py +++ b/tests/v2/test_reading_index.py @@ -393,7 +393,7 @@ def test_a_file_holding_only_familiar_readings_is_chosen_only_strictly( #: ranks, whose given names only en.toml writes; de's and en's ra, #: whose name readings only ko.toml writes, #1483 on 2026-11-21, a #: strict German or English choice reading the credential as master's -#: default did). A +#: default did, and a strict German one the title in front). A #: word leaves this table when a name reading is written in the chosen #: file whose names carry it, and joins it when a chosen file's #: vocabulary reading loses its gate: review each move. diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index 80740ac9c..b7166386e 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -921,8 +921,8 @@ "John Smith Jr. Jones" "John Smith Jr. PhD Jones" "John Smith Jr. Prof." -"John Smith Jr., AD RA" "John Smith Jr., AD Sr. and Mr." +"John Smith Jr., AD VC" "John Smith Jr., J." "John Smith Jr., M.J." "John Smith Jr., MBChB PhD" diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index ca92f645f..1c5b15446 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -2242,8 +2242,8 @@ {"name": "John Smith Jr. Jones", "given": "John", "middle": "Smith Jr.", "family": "Jones", "initials": "J. S. J. J."} {"name": "John Smith Jr. PhD Jones", "given": "John", "family": "Smith", "suffix": "Jr. PhD Jones", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as family (position)"], "initials": "J. S.", "generation": "Jr.", "credentials": "PhD Jones"} {"name": "John Smith Jr. Prof.", "title": "Prof.", "given": "John", "family": "Smith", "suffix": "Jr.", "initials": "J. S.", "generation": "Jr."} -{"name": "John Smith Jr., AD RA", "given": "John", "family": "Smith", "suffix": "Jr., AD RA", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "J. S.", "generation": "Jr.", "credentials": "AD RA"} {"name": "John Smith Jr., AD Sr. and Mr.", "title": "Sr. and Mr.", "given": "John", "family": "Smith", "suffix": "Jr., AD", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "J. S.", "generation": "Jr.", "credentials": "AD"} +{"name": "John Smith Jr., AD VC", "given": "John", "family": "Smith", "suffix": "Jr., AD VC", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: name as given (position)"], "initials": "J. S.", "generation": "Jr.", "credentials": "AD VC"} {"name": "John Smith Jr., J.", "given": "J.", "family": "John Smith", "suffix": "Jr.", "initials": "J. J. S.", "generation": "Jr."} {"name": "John Smith Jr., M.J.", "given": "M.", "middle": "J.", "family": "John Smith", "suffix": "Jr.", "ambiguities": ["SUFFIX_OR_NAME"], "alternatives": ["SUFFIX_OR_NAME: credential as suffix (shape)"], "initials": "M. J. J. S.", "generation": "Jr."} {"name": "John Smith Jr., MBChB PhD", "given": "John", "family": "Smith", "suffix": "Jr., MBChB PhD", "initials": "J. S.", "generation": "Jr.", "credentials": "MBChB PhD"} From 88ccf549c5aef52fc970c74aaeb2c9db701483ee Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Sat, 21 Nov 2026 20:24:45 -0800 Subject: [PATCH 3/5] Address the fix review of #1520: C11, the capitals and given-part costs, rows The review of the first fix found rules/C11's prose still using RA as the dual, now false ('Smith, Ms RA Ma' reads title 'Ms', given 'RA'); it writes VC. The capitals cost was narrower than the behavior: RA opening the part after a family comma in a name wholly in capitals is the given name before a credential too ('SMITH, RA MD'). And RA opening the given part after a family comma ahead of a name word is the given name, not the title ('Smith, RA John', 'Muller, RA Hans' under a plain German choice), rules/H9's reading of 'Smith, Dean John' on master: recorded as cost (7), with rows, and the release log and migrate.rst say both. The member-pair settlers and the openers grid take VC for RA: with RA the member-pair control had moved to 1632 unseen, and with VC it reads the recorded 1608 again; the openers control re-taken at c1ceb3b3 reads 1,062 in both spellings. The Measured bullet cites the pushed 5e775983 for its figures, whose corpora match, and its snapshot breakdown says which examples read alike. A version note, locales.rst's "by default", the de.toml bullet's comma, and locales/AGENTS.md's double comma. Co-Authored-By: Claude Opus 5.5 --- .../design/decisions/vocabulary-collisions.md | 8 +++---- .../C11-what-the-comma-decision-reports.md | 2 +- docs/locales.rst | 2 +- docs/migrate.rst | 9 ++++---- docs/release_log.rst | 2 +- nameparser/locales/AGENTS.md | 2 +- tests/v2/cases.py | 21 ++++++++++++++++++- tests/v2/pipeline/test_post_rules.py | 7 +++++-- tests/v2/test_cases.py | 7 ++++--- tests/v2/test_properties.py | 5 +++-- 10 files changed, 45 insertions(+), 20 deletions(-) diff --git a/docs/design/decisions/vocabulary-collisions.md b/docs/design/decisions/vocabulary-collisions.md index 1a6b2bf74..aaa989cb4 100644 --- a/docs/design/decisions/vocabulary-collisions.md +++ b/docs/design/decisions/vocabulary-collisions.md @@ -123,7 +123,7 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - **Measured** 2026-11-20 against a checkout of master `0d8c6fa8`: `local_agreement.py orcid-researchers --base`, 1 record fixed (an `aus der` family box), 0 broken; psc-individuals, none moved by the word; `snapshot.py --local fec-individuals --base`, the case repair above; ctgov-officials, `Karen aus der Fünten, MD, MChiro`-shaped names gaining the family; the committed snapshot, `KAREN AUS DER FÜNTEN` (family 'AUS DER FÜNTEN', repaired `Karen aus der Fünten`), which takes rules/R12's `aus der` example out of its Accepted bullet (`unter der` stands there now). Recompute: those commands with `--base `; the 6 names and the 24 by `config_diff.py diff default 'expr:Parser(lexicon=Lexicon.default().remove("aus", kind="given"))' --local all --match` over the word, the given reading removed leaving the never-given particle, which lists the names matched and moved; the bearer counts are on the word (`tools/vocab/query.py --word aus`). - 2026-11-21 #1483 — `RA` IS A KOREAN FAMILY NAME AND GIVEN NAME BY DEFAULT (PROPOSAL B), AND DE.TOML READS IT AFTER THE NAME AS A CREDENTIAL. Decided 2026-11-21. SUPERSEDES: the 2026-11-19 #1483 entry's sentence leaving Proposal B open. `ra` was en.toml's ungated credential and de.toml's academic title (Rechtsanwalt) with no name reading, so it was the suffix ending a name in any case (`Kim Ra`, `Sang Hak Ra`) and the title opening one (`Ra Mi Kim`), though it is borne as both. C-i asks for the marking where a word is borne in the position its claim acts on: Korean surnames end a name written given first and Korean given names open one. - **The readings.** ko.toml gives `ra` a `family` and a `given` reading, the file of the language whose names carry it (nameparser/vocab/README.md); mul.toml was declined, since every strict choice reads it, `en` among them, which would gate the credential in English lists, and a my.toml copy moves nothing, a strict `my` choice already reading the word as a name. The bearer counts are on the entry (`tools/name_usage.py Ra --boxes`, 2026-11-21): ORCID's boxes in Korea hold it 25 times as a given name and 37 as a family name, PatentsView's Korean inventors 135 and 100, the US SSA 251 births, the US Census 1,458 surnames (72.5% asian/PI), ORCID's Myanmar given boxes 2 of 1,755 holders. The name readings derive the gated markers (`SUFFIX_ACRONYMS_AMBIGUOUS`, and `TITLES_AMBIGUOUS` in place of `TITLES`), so the credential needs a word to spare and the case signal (rules/S4, rules/S6) and the title reads only inside a title phrase (rules/H9). Family alone was declined on the measurement made for the decision, re-taken here: it leaves de.toml's title ungated past a second comma, where rules/C2 reads a bare title word (`Jane Doe, PT, RA` title 'RA', 5 names) and after a family comma written in capitals (`KING, RA`, 9 FEC names, suffix to title). - - **de.toml's credential.** A plain German choice turns the other files' vocabulary readings of a word off where de.toml holds one, so with the name readings on it lost en.toml's credential and read a lone `RA` after a family comma as the given name (`Hans Müller, RA` → given 'RA', family 'Hans Müller'; master read title 'RA'). de.toml now carries a `credential` reading beside its academic title, Rechtsanwalt written after the name, which the default compile already held through en.toml (`_compiled.py` byte-identical, build checks 4 and 5 passing). Under a plain German choice `Hans Müller, RA`, `Müller, RA` and `John Smith, RA` read suffix 'RA', `Hans Müller, LL.M., RA` suffix 'LL.M., RA' and `Hans Müller RA` suffix 'RA', where master read title 'RA' after a comma and family 'RA' with none. A strict German choice, which reads no ko.toml, keeps the title in front (`RA Müller`, `RA Dr. Hans Müller`) and now reads the credential behind it; it and a strict English choice ungate `ra`, which joins tests/v2/test_reading_index.py's reviewed table. - - **Accepted costs.** (1) `RA` opening a German name is the given name (`RA Müller` → given 'RA'), by default and under a plain German choice, a plain choice never dropping a name reading and no German pack existing; a strict German choice, which reads no ko.toml, keeps the title. A title behind it then falls into the middle name, as behind any given name (`RA Dr. Hans Müller` → given 'RA', middle 'Dr. Hans'; `Herr RA Dr. Müller` → title 'Herr', given 'RA', middle 'Dr.'), the class's reading (`Dean Dr. Hans Müller` reads so on master). No corpus name writes Rechtsanwalt in front. (2) A gated credential written without its last full stop is no dotted acronym (rules/S3), so after a family comma a one-word part reads as the given name, the name reversed (`Jane Doe, R.A` → given 'R.', middle 'A', family 'Jane Doe'; 4 ClinicalTrials.gov names, 2 people), and with no comma it ends the name as the family (`Jane Doe R.A` → middle 'Doe', family 'R.A'). It is the class's reading already (`Jane Doe, M.A`, `Jane Doe, B.A` and `John Smith M.A` read so on master), classify asking the gated set with the stop inside the word, so keeping the suffix means widening that test for every gated acronym, not a vocabulary change; left. A bracketed `R.A.` inside a name reads as a middle name for the same class reason (`John (R.A.) Smith`, as `John (M.A.) Smith` on master). (3) A name written wholly in capitals gives no case signal (rules/S6): `KIM MI RA` keeps suffix 'RA', not fixed, and a lone `RA` after a family comma in one is the given name (`KING, RA`, `DOE, RA` and `, RA` → given 'RA', where master read suffix 'RA'), the initials FEC's filers mean. (4) A word glued to `ra` at a full stop reads its chunk as the gated acronym: rules/R4's example `DUT.RA MARIA SILVA` and CLDR's fictional `Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo` read given 'DUT.RA' and 'Dut.ra' where they read the title (the CLDR record re-recorded; R4's fence asserts the case repair, unchanged), and `Sang Hak Dut.ra` reads suffix 'Dut.ra'. (5) `Kim RA, Jr.`: the capitals settle the credential, leaving `Kim` a lone given name (rules/O5) where the title reading had left it the family. (6) The spaced Italian `Sig. ra Rossi` reads title 'Sig.', given 'ra', where `ra` joined the title run (title 'Sig. ra'); the glued `Sig.ra Rossi` is unchanged, and decisions/R4's 2026-10-22 #840 entry is marked. Also moved, not costs: `Ra Kim, Mi` reads family 'Ra Kim', as 1.4.0 did, rules/H6's peel before a family comma reading the vocabulary's titles; and `Kim Ae Ra` and `Kim, Ae Ra` still read suffix 'Ae Ra', so decisions/S3's 2026-10-25 question now rests on `ae` alone. - - **The examples that used RA as a dual.** Nine rule examples (rules/H3, H4, H6, S1, S7, C5, C12 and C13), two rule sentences (H4, C9), five decisions Standing lines (H3, H4, H6, S7, C9), eight case rows, eleven code comments and docstrings, a tools test and the paired-initials benchmark used `RA` as a word of both the title and the suffix vocabulary, which it no longer is. Each now writes `VC`, a row naming a rank `LT`; each spelling reads as `RA` did under 1.4.0, 2.2.0 and 2.3.0 and on master, measured 2026-11-21, so the notes' version claims stand. The benchmark's counts were re-taken: 35 and 131 `is_suffix_piece` calls on the tree, 120 and 1,620 at 47fb2b21, as with `RA`. - - **Measured** on 2026-11-21. In this tree, at `d672700c` (the corpora holding the respelled examples), `config_diff.py diff "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='family').remove('ra', kind='given'))" "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='given'))" default --committed --local all --match '(?i)(? None: "so the lone member after a family comma is the given name: " "the initials such filers mean, the credential's cost " "otherwise; 1.4.0 read title 'RA', 3.1.0 suffix 'RA'"), + Case("ra_opening_a_capitals_part_before_a_credential_is_the_given_name", + "SMITH, RA MD", + {"given": "RA", "family": "SMITH", "suffix": "MD"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="an accepted cost, as 'KING, RA' with a credential behind " + "it: no case signal in a name wholly in capitals " + "(rules/S6); 1.4.0 read title 'RA', first 'MD', 3.1.0 " + "suffix 'RA MD'"), + Case("ra_opening_the_given_part_ahead_of_a_name_is_the_given_name", + "Smith, RA John", + {"given": "RA", "middle": "John", "family": "Smith"}, + classification="feat(#1483)", + ambiguities=("suffix-or-name",), + notes="an accepted cost: a title that is also a given name is a " + "title only inside a phrase (rules/H9), as 'Smith, Dean " + "John' reads on master; 1.4.0 through 3.1.0 read title " + "'RA', given 'John'"), Case("ra_without_its_last_stop_ending_a_name_is_the_family", "Jane Doe R.A", {"given": "Jane", "middle": "Doe", "family": "R.A"}, @@ -1594,7 +1612,8 @@ def _check_cjk_shape_purity(self) -> None: {"given": "Kim", "family": "Ra", "suffix": "Jr."}, ambiguities=("suffix-or-name",), notes="the Title-case twin of 'Kim RA, Jr.'; 1.4.0 read the same " - "fields, 2.x through 3.1.0 family 'Kim', suffix 'Ra, Jr.'"), + "fields, 2.0.0 through 2.3.0 given 'Kim', 2.4.0 through " + "3.1.0 family 'Kim', each suffix 'Ra, Jr.'"), Case("ra_before_a_credential_comma_is_the_family", "Kim Ra, PhD", {"given": "Kim", "family": "Ra", "suffix": "PhD"}, diff --git a/tests/v2/pipeline/test_post_rules.py b/tests/v2/pipeline/test_post_rules.py index efe75c5a8..575168e47 100644 --- a/tests/v2/pipeline/test_post_rules.py +++ b/tests/v2/pipeline/test_post_rules.py @@ -2082,7 +2082,7 @@ def test_a_joined_credential_reads_as_its_spelling_written_apart() -> None: #: credential settles the member in its clause (rules/S1), so the two #: spellings read alike in every shape. Fields only, as above. _MEMBERS = ("MA", "Ma", "M.A", "MBA", "Ed", "KC", "JD") -_SETTLERS = ("PhD", "MD", "RN", "Esq", "NP-C", "MS", "RA") +_SETTLERS = ("PhD", "MD", "RN", "Esq", "NP-C", "MS", "VC") #: How many rows' two spellings read differently with `set_apart_kind` #: reading a joined word holding a member as a plain suffix, the @@ -2091,7 +2091,10 @@ def test_a_joined_credential_reads_as_its_spelling_written_apart() -> None: #: Each is a joined pair inside or before a name word, set apart where #: its spelling written apart stays the nickname. 'MS' and 'RA', words #: that are titles too, joined the settlers after the second review -#: found them settling a joined member and not a clause one. +#: found them settling a joined member and not a clause one; 'VC' took +#: RA's place when #1483 made ra a title only inside a phrase, which had +#: moved this control to 1632, unseen, and with VC it reads 1608 again +#: (re-taken 2026-11-21). _UNGUARDED_MEMBER_PAIRS_1138 = 1608 #: How many (pair, shape, order) rows the member invariant reads. diff --git a/tests/v2/test_cases.py b/tests/v2/test_cases.py index a8d50d7e4..2953dc943 100644 --- a/tests/v2/test_cases.py +++ b/tests/v2/test_cases.py @@ -532,9 +532,10 @@ def test_the_field_sweep_sees_the_claims_it_checks() -> None: # row under its declared policy; 2321 -> 2330 the same day, #1128's # reporting rows; 2330 -> 2342 the same day, #1483's `ra` rows # reporting suffix-or-name; 2342 -> 2367 the same day, its review's - # comma, order and spelling rows. - assert claims == 2367, ( - f"the field sweep checks {claims} claims, recorded as 2367 on " + # comma, order and spelling rows; 2367 -> 2373 the same day, its + # second review's 'SMITH, RA MD' and 'Smith, RA John'. + assert claims == 2373, ( + f"the field sweep checks {claims} claims, recorded as 2373 on " f"2026-11-21") diff --git a/tests/v2/test_properties.py b/tests/v2/test_properties.py index ea9f6aa5b..af0c05ce6 100644 --- a/tests/v2/test_properties.py +++ b/tests/v2/test_properties.py @@ -470,7 +470,7 @@ def test_an_empty_head_reads_as_its_family_comma_twin() -> None: #: title/suffix duals, period-marked suffix words H2 reads as titles, #: and a plain name and a plain title beside them. _OPENERS = ("Md", "MD", "Cem", "JP", "A.M.", "M.S.", "Junior", "Jr", "PhD", - "II", "Mdiv", "Sr.", "Ms", "RA", "Jr.", "Esq.", "Md.", "Sam", + "II", "Mdiv", "Sr.", "Ms", "VC", "Jr.", "Esq.", "Md.", "Sam", "Dr.") _OPENED_BODIES = ("Rahman", "van der Berg", "Smith Jones", "(Bob) Rahman", "Rahman nee Khan", "de la Vega") @@ -489,7 +489,8 @@ def test_a_head_before_a_credential_reads_as_it_does_alone() -> None: Negative control, recorded 2026-11-02 on master at c1ceb3b3, before C3 counted an opening suffix word: 1,062 of the 2,052 rows differed - from the head alone.""" + from the head alone; the same at c1ceb3b3 with 'VC' in the openers + in place of 'RA', re-taken 2026-11-21 (#1483).""" rows = 0 differ = [] for order in (GIVEN_FIRST, FAMILY_FIRST, FAMILY_FIRST_GIVEN_LAST): From c94ed75174681d177f0bf540da244ee0525de25f Mon Sep 17 00:00:00 2001 From: Derek Gulbranson Date: Sat, 21 Nov 2026 20:33:25 -0800 Subject: [PATCH 4/5] Address the second fix review of #1520: the costs' reach, the figures' provenance The review of 88ccf549 found the Measured bullet's "but for rules/C12's" false (5e775983 holds all nine respellings: 21 committed names match the filter at master, 12 there) and its "9 entries" breakdown reproducible from no committed tree; it now states what the committed snapshot lists against master's record (nine out, nine in, two moved) and how the seven moving RA texts are found. Cost (7) reaches RA behind a title after a family comma too ('Smith, Mr RA John'), ahead of a credential the part staying the run ('Smith, RA PhD'); cost (3) says RA behind a credential stays in the run ('SMITH, MD RA') and records 'SMITH, RA, JOHN'; and two readings the gated class already gives on master are recorded ('ROBERT (RA) ALLEN', 'Smith, RA PhD Ma'). The release log and migrate.rst say "opening the part" and "ahead of a name word", as the entry does. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/vocabulary-collisions.md | 4 ++-- docs/migrate.rst | 9 +++++---- docs/release_log.rst | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/design/decisions/vocabulary-collisions.md b/docs/design/decisions/vocabulary-collisions.md index aaa989cb4..23a6f2029 100644 --- a/docs/design/decisions/vocabulary-collisions.md +++ b/docs/design/decisions/vocabulary-collisions.md @@ -124,6 +124,6 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - 2026-11-21 #1483 — `RA` IS A KOREAN FAMILY NAME AND GIVEN NAME BY DEFAULT (PROPOSAL B), AND DE.TOML READS IT AFTER THE NAME AS A CREDENTIAL. Decided 2026-11-21. SUPERSEDES: the 2026-11-19 #1483 entry's sentence leaving Proposal B open. `ra` was en.toml's ungated credential and de.toml's academic title (Rechtsanwalt) with no name reading, so it was the suffix ending a name in any case (`Kim Ra`, `Sang Hak Ra`) and the title opening one (`Ra Mi Kim`), though it is borne as both. C-i asks for the marking where a word is borne in the position its claim acts on: Korean surnames end a name written given first and Korean given names open one. - **The readings.** ko.toml gives `ra` a `family` and a `given` reading, the file of the language whose names carry it (nameparser/vocab/README.md); mul.toml was declined, since every strict choice reads it, `en` among them, which would gate the credential in English lists, and a my.toml copy moves nothing, a strict `my` choice already reading the word as a name. The bearer counts are on the entry (`tools/name_usage.py Ra --boxes`, 2026-11-21): ORCID's boxes in Korea hold it 25 times as a given name and 37 as a family name, PatentsView's Korean inventors 135 and 100, the US SSA 251 births, the US Census 1,458 surnames (72.5% asian/PI), ORCID's Myanmar given boxes 2 of 1,755 holders. The name readings derive the gated markers (`SUFFIX_ACRONYMS_AMBIGUOUS`, and `TITLES_AMBIGUOUS` in place of `TITLES`), so the credential needs a word to spare and the case signal (rules/S4, rules/S6) and the title reads only inside a title phrase (rules/H9). Family alone was declined on the measurement made for the decision, re-taken here: it leaves de.toml's title ungated past a second comma, where rules/C2 reads a bare title word (`Jane Doe, PT, RA` title 'RA', 5 names) and after a family comma written in capitals (`KING, RA`, 9 FEC names, suffix to title). - **de.toml's credential.** A plain German choice turns the other files' vocabulary readings of a word off where de.toml holds one, so with the name readings on it lost en.toml's credential and read a lone `RA` after a comma as the given name, making the comma a family comma (`Hans Müller, RA` → given 'RA', family 'Hans Müller'; master read title 'RA'). de.toml now carries a `credential` reading beside its academic title, Rechtsanwalt written after the name, which the default compile already held through en.toml (`_compiled.py` byte-identical, build checks 4 and 5 passing). Under a plain German choice `Hans Müller, RA`, `Müller, RA` and `John Smith, RA` read suffix 'RA', `Hans Müller, LL.M., RA` suffix 'LL.M., RA' and `Hans Müller RA` suffix 'RA', where master read title 'RA' after a comma and family 'RA' with none. A strict German choice, which reads no ko.toml, keeps the title in front (`RA Müller`, `RA Dr. Hans Müller`) and now reads the credential behind it; it and a strict English choice ungate `ra`, which joins tests/v2/test_reading_index.py's reviewed table. - - **Accepted costs.** (1) `RA` opening a German name is the given name (`RA Müller` → given 'RA'), by default and under a plain German choice, a plain choice never dropping a name reading and no German pack existing; a strict German choice, which reads no ko.toml, keeps the title. A title behind it then falls into the middle name, as behind any given name (`RA Dr. Hans Müller` → given 'RA', middle 'Dr. Hans'; `Herr RA Dr. Müller` → title 'Herr', given 'RA', middle 'Dr.'), the class's reading (`Dean Dr. Hans Müller` reads so on master). No corpus name writes Rechtsanwalt in front. (2) A gated credential written without its last full stop is no dotted acronym (rules/S3), so after a family comma a one-word part reads as the given name, the name reversed (`Jane Doe, R.A` → given 'R.', middle 'A', family 'Jane Doe'; 4 ClinicalTrials.gov names, 2 people), and with no comma it ends the name as the family (`Jane Doe R.A` → middle 'Doe', family 'R.A'). It is the class's reading already (`Jane Doe, M.A`, `Jane Doe, B.A` and `John Smith M.A` read so on master), classify asking the gated set with the stop inside the word, so keeping the suffix means widening that test for every gated acronym, not a vocabulary change; left. A bracketed `R.A.` inside a name reads as a middle name for the same class reason (`John (R.A.) Smith`, as `John (M.A.) Smith` on master). (3) A name written wholly in capitals gives no case signal (rules/S6): `KIM MI RA` keeps suffix 'RA', not fixed, and `RA` opening the part after a family comma in one is the given name, alone or before a credential (`KING, RA`, `DOE, RA`, `, RA` → given 'RA'; `SMITH, RA MD` → given 'RA', suffix 'MD'; where master read suffix 'RA'), the initials FEC's filers mean. (4) A word glued to `ra` at a full stop reads its chunk as the gated acronym: rules/R4's example `DUT.RA MARIA SILVA` and CLDR's fictional `Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo` read given 'DUT.RA' and 'Dut.ra' where they read the title (the CLDR record re-recorded; R4's fence asserts the case repair, unchanged), and `Sang Hak Dut.ra` reads suffix 'Dut.ra'. (5) `Kim RA, Jr.`: the capitals settle the credential, leaving `Kim` a lone given name (rules/O5) where the title reading had left it the family. (6) The spaced Italian `Sig. ra Rossi` reads title 'Sig.', given 'ra', where `ra` joined the title run (title 'Sig. ra'); the glued `Sig.ra Rossi` is unchanged, and decisions/R4's 2026-10-22 #840 entry is marked. (7) `RA` opening the given part after a family comma ahead of a name word is the given name, not the title (`Smith, RA John` → given 'RA', middle 'John'; `Müller, RA Hans` → given 'RA', middle 'Hans', under a plain German choice too), where 1.4.0 and master read title 'RA': rules/H9's reading of a title that is also a given name, as `Smith, Dean John` reads on master; a strict German choice keeps the title. Also moved, not costs: `Ra Kim, Mi` reads family 'Ra Kim', as 1.4.0 did, rules/H6's peel before a family comma reading the vocabulary's titles; and `Kim Ae Ra` and `Kim, Ae Ra` still read suffix 'Ae Ra', so decisions/S3's 2026-10-25 question now rests on `ae` alone. + - **Accepted costs.** (1) `RA` opening a German name is the given name (`RA Müller` → given 'RA'), by default and under a plain German choice, a plain choice never dropping a name reading and no German pack existing; a strict German choice, which reads no ko.toml, keeps the title. A title behind it then falls into the middle name, as behind any given name (`RA Dr. Hans Müller` → given 'RA', middle 'Dr. Hans'; `Herr RA Dr. Müller` → title 'Herr', given 'RA', middle 'Dr.'), the class's reading (`Dean Dr. Hans Müller` reads so on master). No corpus name writes Rechtsanwalt in front. (2) A gated credential written without its last full stop is no dotted acronym (rules/S3), so after a family comma a one-word part reads as the given name, the name reversed (`Jane Doe, R.A` → given 'R.', middle 'A', family 'Jane Doe'; 4 ClinicalTrials.gov names, 2 people), and with no comma it ends the name as the family (`Jane Doe R.A` → middle 'Doe', family 'R.A'). It is the class's reading already (`Jane Doe, M.A`, `Jane Doe, B.A` and `John Smith M.A` read so on master), classify asking the gated set with the stop inside the word, so keeping the suffix means widening that test for every gated acronym, not a vocabulary change; left. A bracketed `R.A.` inside a name reads as a middle name for the same class reason (`John (R.A.) Smith`, as `John (M.A.) Smith` on master). (3) A name written wholly in capitals gives no case signal (rules/S6): `KIM MI RA` keeps suffix 'RA', not fixed, and `RA` opening the part after a family comma in one is the given name, alone or before a credential (`KING, RA`, `DOE, RA`, `, RA` → given 'RA'; `SMITH, RA MD` → given 'RA', suffix 'MD'; where master read the whole part as the suffix, 'RA' and 'RA MD'), while `RA` behind a credential there stays in the run (`SMITH, MD RA` → suffix 'MD RA'), and `SMITH, RA, JOHN` reads given 'RA', suffix 'JOHN' (master: suffix 'RA, JOHN'), the initials FEC's filers mean. (4) A word glued to `ra` at a full stop reads its chunk as the gated acronym: rules/R4's example `DUT.RA MARIA SILVA` and CLDR's fictional `Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo` read given 'DUT.RA' and 'Dut.ra' where they read the title (the CLDR record re-recorded; R4's fence asserts the case repair, unchanged), and `Sang Hak Dut.ra` reads suffix 'Dut.ra'. (5) `Kim RA, Jr.`: the capitals settle the credential, leaving `Kim` a lone given name (rules/O5) where the title reading had left it the family. (6) The spaced Italian `Sig. ra Rossi` reads title 'Sig.', given 'ra', where `ra` joined the title run (title 'Sig. ra'); the glued `Sig.ra Rossi` is unchanged, and decisions/R4's 2026-10-22 #840 entry is marked. (7) `RA` opening the given part after a family comma ahead of a name word, or behind a title there, is the given name, not the title (`Smith, RA John` → given 'RA', middle 'John'; `Smith, Mr RA John` → title 'Mr', given 'RA', where master read title 'Mr RA'; `Müller, RA Hans` → given 'RA', middle 'Hans', under a plain German choice too), where 1.4.0 and master read title 'RA': rules/H9's reading of a title that is also a given name, as `Smith, Dean John` and `Smith, Mr Dean John` read on master; a strict German choice keeps the title; ahead of a credential the part is still the credential run (`Smith, RA PhD` → suffix 'RA PhD'). Two more read as the gated class reads on master: `ROBERT (RA) ALLEN` reads nickname 'RA' where it read suffix 'RA', as `ROBERT (MA) ALLEN` does, and `Smith, RA PhD Ma` reads suffix 'RA PhD Ma' where it read title 'RA', given 'PhD', as `Smith, MA PhD Ma` does. Also moved, not costs: `Ra Kim, Mi` reads family 'Ra Kim', as 1.4.0 did, rules/H6's peel before a family comma reading the vocabulary's titles; and `Kim Ae Ra` and `Kim, Ae Ra` still read suffix 'Ae Ra', so decisions/S3's 2026-10-25 question now rests on `ae` alone. - **The examples that used RA as a dual.** Nine rule examples (rules/H3, H4, H6, S1, S7, C5, C12 and C13), three rule sentences (H4, C9, C11), five decisions Standing lines (H3, H4, H6, S7, C9), eight case rows, eleven code comments and docstrings, a tools test and the paired-initials benchmark used `RA` as a word of both the title and the suffix vocabulary, which it no longer is. Each now writes `VC`, a row naming a rank `LT`; each spelling reads as `RA` did under 1.4.0, 2.2.0 and 2.3.0 and on master, measured 2026-11-21, so the notes' version claims stand. The benchmark's counts were re-taken: 35 and 131 `is_suffix_piece` calls on the tree, 120 and 1,620 at 47fb2b21, as with `RA`. - - **Measured** on 2026-11-21. On the tree committed as `5e775983` (the corpora holding the respelled examples, but for rules/C12's, which reads alike in both spellings), `config_diff.py diff "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='family').remove('ra', kind='given'))" "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='given'))" default --committed --local all --match '(?i)(? Date: Sat, 21 Nov 2026 20:36:46 -0800 Subject: [PATCH 5/5] Address the third fix review of #1520: the summaries name Kim, Ra and Smith, Mr RA The review of c94ed751 found no claim wrong and the summaries still wider than the behavior: migrate.rst said Ra ending a name after a comma is the credential, where only RA in capitals is ('Kim, Ra' reads given 'Ra'); cost (7) could be read as reaching 'Smith, Mr RA', which keeps suffix 'RA'; and cost (3)'s FEC clause had drifted from 'KING, RA'. The release log and migrate.rst list 'Kim, Ra' among the moves, and migrate.rst says 2.0 through 3.1 read a two-word name ending in Ra as the credential too. Co-Authored-By: Claude Opus 5.5 --- docs/design/decisions/vocabulary-collisions.md | 2 +- docs/migrate.rst | 15 ++++++++------- docs/release_log.rst | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/design/decisions/vocabulary-collisions.md b/docs/design/decisions/vocabulary-collisions.md index 23a6f2029..23dc86543 100644 --- a/docs/design/decisions/vocabulary-collisions.md +++ b/docs/design/decisions/vocabulary-collisions.md @@ -124,6 +124,6 @@ Elsewhere: C-i reaches the titles through a `given` reading, which makes a title - 2026-11-21 #1483 — `RA` IS A KOREAN FAMILY NAME AND GIVEN NAME BY DEFAULT (PROPOSAL B), AND DE.TOML READS IT AFTER THE NAME AS A CREDENTIAL. Decided 2026-11-21. SUPERSEDES: the 2026-11-19 #1483 entry's sentence leaving Proposal B open. `ra` was en.toml's ungated credential and de.toml's academic title (Rechtsanwalt) with no name reading, so it was the suffix ending a name in any case (`Kim Ra`, `Sang Hak Ra`) and the title opening one (`Ra Mi Kim`), though it is borne as both. C-i asks for the marking where a word is borne in the position its claim acts on: Korean surnames end a name written given first and Korean given names open one. - **The readings.** ko.toml gives `ra` a `family` and a `given` reading, the file of the language whose names carry it (nameparser/vocab/README.md); mul.toml was declined, since every strict choice reads it, `en` among them, which would gate the credential in English lists, and a my.toml copy moves nothing, a strict `my` choice already reading the word as a name. The bearer counts are on the entry (`tools/name_usage.py Ra --boxes`, 2026-11-21): ORCID's boxes in Korea hold it 25 times as a given name and 37 as a family name, PatentsView's Korean inventors 135 and 100, the US SSA 251 births, the US Census 1,458 surnames (72.5% asian/PI), ORCID's Myanmar given boxes 2 of 1,755 holders. The name readings derive the gated markers (`SUFFIX_ACRONYMS_AMBIGUOUS`, and `TITLES_AMBIGUOUS` in place of `TITLES`), so the credential needs a word to spare and the case signal (rules/S4, rules/S6) and the title reads only inside a title phrase (rules/H9). Family alone was declined on the measurement made for the decision, re-taken here: it leaves de.toml's title ungated past a second comma, where rules/C2 reads a bare title word (`Jane Doe, PT, RA` title 'RA', 5 names) and after a family comma written in capitals (`KING, RA`, 9 FEC names, suffix to title). - **de.toml's credential.** A plain German choice turns the other files' vocabulary readings of a word off where de.toml holds one, so with the name readings on it lost en.toml's credential and read a lone `RA` after a comma as the given name, making the comma a family comma (`Hans Müller, RA` → given 'RA', family 'Hans Müller'; master read title 'RA'). de.toml now carries a `credential` reading beside its academic title, Rechtsanwalt written after the name, which the default compile already held through en.toml (`_compiled.py` byte-identical, build checks 4 and 5 passing). Under a plain German choice `Hans Müller, RA`, `Müller, RA` and `John Smith, RA` read suffix 'RA', `Hans Müller, LL.M., RA` suffix 'LL.M., RA' and `Hans Müller RA` suffix 'RA', where master read title 'RA' after a comma and family 'RA' with none. A strict German choice, which reads no ko.toml, keeps the title in front (`RA Müller`, `RA Dr. Hans Müller`) and now reads the credential behind it; it and a strict English choice ungate `ra`, which joins tests/v2/test_reading_index.py's reviewed table. - - **Accepted costs.** (1) `RA` opening a German name is the given name (`RA Müller` → given 'RA'), by default and under a plain German choice, a plain choice never dropping a name reading and no German pack existing; a strict German choice, which reads no ko.toml, keeps the title. A title behind it then falls into the middle name, as behind any given name (`RA Dr. Hans Müller` → given 'RA', middle 'Dr. Hans'; `Herr RA Dr. Müller` → title 'Herr', given 'RA', middle 'Dr.'), the class's reading (`Dean Dr. Hans Müller` reads so on master). No corpus name writes Rechtsanwalt in front. (2) A gated credential written without its last full stop is no dotted acronym (rules/S3), so after a family comma a one-word part reads as the given name, the name reversed (`Jane Doe, R.A` → given 'R.', middle 'A', family 'Jane Doe'; 4 ClinicalTrials.gov names, 2 people), and with no comma it ends the name as the family (`Jane Doe R.A` → middle 'Doe', family 'R.A'). It is the class's reading already (`Jane Doe, M.A`, `Jane Doe, B.A` and `John Smith M.A` read so on master), classify asking the gated set with the stop inside the word, so keeping the suffix means widening that test for every gated acronym, not a vocabulary change; left. A bracketed `R.A.` inside a name reads as a middle name for the same class reason (`John (R.A.) Smith`, as `John (M.A.) Smith` on master). (3) A name written wholly in capitals gives no case signal (rules/S6): `KIM MI RA` keeps suffix 'RA', not fixed, and `RA` opening the part after a family comma in one is the given name, alone or before a credential (`KING, RA`, `DOE, RA`, `, RA` → given 'RA'; `SMITH, RA MD` → given 'RA', suffix 'MD'; where master read the whole part as the suffix, 'RA' and 'RA MD'), while `RA` behind a credential there stays in the run (`SMITH, MD RA` → suffix 'MD RA'), and `SMITH, RA, JOHN` reads given 'RA', suffix 'JOHN' (master: suffix 'RA, JOHN'), the initials FEC's filers mean. (4) A word glued to `ra` at a full stop reads its chunk as the gated acronym: rules/R4's example `DUT.RA MARIA SILVA` and CLDR's fictional `Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo` read given 'DUT.RA' and 'Dut.ra' where they read the title (the CLDR record re-recorded; R4's fence asserts the case repair, unchanged), and `Sang Hak Dut.ra` reads suffix 'Dut.ra'. (5) `Kim RA, Jr.`: the capitals settle the credential, leaving `Kim` a lone given name (rules/O5) where the title reading had left it the family. (6) The spaced Italian `Sig. ra Rossi` reads title 'Sig.', given 'ra', where `ra` joined the title run (title 'Sig. ra'); the glued `Sig.ra Rossi` is unchanged, and decisions/R4's 2026-10-22 #840 entry is marked. (7) `RA` opening the given part after a family comma ahead of a name word, or behind a title there, is the given name, not the title (`Smith, RA John` → given 'RA', middle 'John'; `Smith, Mr RA John` → title 'Mr', given 'RA', where master read title 'Mr RA'; `Müller, RA Hans` → given 'RA', middle 'Hans', under a plain German choice too), where 1.4.0 and master read title 'RA': rules/H9's reading of a title that is also a given name, as `Smith, Dean John` and `Smith, Mr Dean John` read on master; a strict German choice keeps the title; ahead of a credential the part is still the credential run (`Smith, RA PhD` → suffix 'RA PhD'). Two more read as the gated class reads on master: `ROBERT (RA) ALLEN` reads nickname 'RA' where it read suffix 'RA', as `ROBERT (MA) ALLEN` does, and `Smith, RA PhD Ma` reads suffix 'RA PhD Ma' where it read title 'RA', given 'PhD', as `Smith, MA PhD Ma` does. Also moved, not costs: `Ra Kim, Mi` reads family 'Ra Kim', as 1.4.0 did, rules/H6's peel before a family comma reading the vocabulary's titles; and `Kim Ae Ra` and `Kim, Ae Ra` still read suffix 'Ae Ra', so decisions/S3's 2026-10-25 question now rests on `ae` alone. + - **Accepted costs.** (1) `RA` opening a German name is the given name (`RA Müller` → given 'RA'), by default and under a plain German choice, a plain choice never dropping a name reading and no German pack existing; a strict German choice, which reads no ko.toml, keeps the title. A title behind it then falls into the middle name, as behind any given name (`RA Dr. Hans Müller` → given 'RA', middle 'Dr. Hans'; `Herr RA Dr. Müller` → title 'Herr', given 'RA', middle 'Dr.'), the class's reading (`Dean Dr. Hans Müller` reads so on master). No corpus name writes Rechtsanwalt in front. (2) A gated credential written without its last full stop is no dotted acronym (rules/S3), so after a family comma a one-word part reads as the given name, the name reversed (`Jane Doe, R.A` → given 'R.', middle 'A', family 'Jane Doe'; 4 ClinicalTrials.gov names, 2 people), and with no comma it ends the name as the family (`Jane Doe R.A` → middle 'Doe', family 'R.A'). It is the class's reading already (`Jane Doe, M.A`, `Jane Doe, B.A` and `John Smith M.A` read so on master), classify asking the gated set with the stop inside the word, so keeping the suffix means widening that test for every gated acronym, not a vocabulary change; left. A bracketed `R.A.` inside a name reads as a middle name for the same class reason (`John (R.A.) Smith`, as `John (M.A.) Smith` on master). (3) A name written wholly in capitals gives no case signal (rules/S6): `KIM MI RA` keeps suffix 'RA', not fixed, and `RA` opening the part after a family comma in one is the given name, alone or before a credential (`KING, RA`, `DOE, RA`, `, RA` → given 'RA', the initials FEC's filers mean; `SMITH, RA MD` → given 'RA', suffix 'MD'; where master read the whole part as the suffix, 'RA' and 'RA MD'), while `RA` behind a credential there stays in the run (`SMITH, MD RA` → suffix 'MD RA'), and `SMITH, RA, JOHN` reads given 'RA', suffix 'JOHN' (master: suffix 'RA, JOHN'). (4) A word glued to `ra` at a full stop reads its chunk as the gated acronym: rules/R4's example `DUT.RA MARIA SILVA` and CLDR's fictional `Dut.ra Prof.ra Maria Giusepa Juana Teresa von Brühl González Domingo` read given 'DUT.RA' and 'Dut.ra' where they read the title (the CLDR record re-recorded; R4's fence asserts the case repair, unchanged), and `Sang Hak Dut.ra` reads suffix 'Dut.ra'. (5) `Kim RA, Jr.`: the capitals settle the credential, leaving `Kim` a lone given name (rules/O5) where the title reading had left it the family. (6) The spaced Italian `Sig. ra Rossi` reads title 'Sig.', given 'ra', where `ra` joined the title run (title 'Sig. ra'); the glued `Sig.ra Rossi` is unchanged, and decisions/R4's 2026-10-22 #840 entry is marked. (7) `RA` in the given part after a family comma ahead of a name word, behind a title or not, is the given name, not a title (`Smith, RA John` → given 'RA', middle 'John', where 1.4.0 and master read title 'RA'; `Smith, Mr RA John` → title 'Mr', given 'RA', where they read title 'Mr RA'; with no name word after it, `Smith, Mr RA` keeps suffix 'RA'; `Müller, RA Hans` → given 'RA', middle 'Hans', under a plain German choice too): rules/H9's reading of a title that is also a given name, as `Smith, Dean John` and `Smith, Mr Dean John` read on master; a strict German choice keeps the title; ahead of a credential the part is still the credential run (`Smith, RA PhD` → suffix 'RA PhD'). Two more read as the gated class reads on master: `ROBERT (RA) ALLEN` reads nickname 'RA' where it read suffix 'RA', as `ROBERT (MA) ALLEN` does, and `Smith, RA PhD Ma` reads suffix 'RA PhD Ma' where it read title 'RA', given 'PhD', as `Smith, MA PhD Ma` does. Also moved, not costs: `Ra Kim, Mi` reads family 'Ra Kim', as 1.4.0 did, rules/H6's peel before a family comma reading the vocabulary's titles; and `Kim Ae Ra` and `Kim, Ae Ra` still read suffix 'Ae Ra', so decisions/S3's 2026-10-25 question now rests on `ae` alone. - **The examples that used RA as a dual.** Nine rule examples (rules/H3, H4, H6, S1, S7, C5, C12 and C13), three rule sentences (H4, C9, C11), five decisions Standing lines (H3, H4, H6, S7, C9), eight case rows, eleven code comments and docstrings, a tools test and the paired-initials benchmark used `RA` as a word of both the title and the suffix vocabulary, which it no longer is. Each now writes `VC`, a row naming a rank `LT`; each spelling reads as `RA` did under 1.4.0, 2.2.0 and 2.3.0 and on master, measured 2026-11-21, so the notes' version claims stand. The benchmark's counts were re-taken: 35 and 131 `is_suffix_piece` calls on the tree, 120 and 1,620 at 47fb2b21, as with `RA`. - **Measured** on 2026-11-21. On the tree committed as `5e775983` (the corpora holding all nine respelled examples: the committed corpus holds 21 names matching the filter at master, 12 there), `config_diff.py diff "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='family').remove('ra', kind='given'))" "expr:Parser(lexicon=Lexicon.default().remove('ra', kind='given'))" default --committed --local all --match '(?i)(?