diff --git a/docs/design/decisions/H9-title-phrase.md b/docs/design/decisions/H9-title-phrase.md index c88d7537..5a2647f3 100644 --- a/docs/design/decisions/H9-title-phrase.md +++ b/docs/design/decisions/H9-title-phrase.md @@ -39,3 +39,9 @@ - MEASURED (2026-10-26, against master `12384fae`, py3.11, every local check with `--base`; the shape grid, 26,460 parses, by the design-docs review). No corpus holds a trailing `Wing.` or a full name before `, Wing`. fec-individuals 14 moved, every one a `FAMILY, WING …` donor now read with given 'WING' (`AA, WING` 7, `AA, WING AA…` 6, `AA, WING A. MR.` 1). The committed corpora move one name, this rule's former Accepted example `Lau, Wing` (`snapshot.py`); CLDR and GND agreement unchanged (`cldr_agreement.py`). PSC (1,039,174 scored, the fetch dated 2026-10-22), ctgov-officials and tse-donors do not move: PSC scores its names in spoken order, which decision 10 already reads. Spelling consistency (mechanisms.md#PAIRED-SPELLINGS-PER-CHANGE, per person, against master): jrc-names 0 now alike, 0 apart, of 218,822 persons with two or more spellings; nepal-candidates 0 and 0 of 126,981 pairs. No spelling in either writes `Wing` after a comma. - THE BOUNDARY LEFT. The modifier test takes any title after the word as its head, a salutation too, so `LAU, WING MR` keeps title 'WING MR' where `LAU, DEAN MR` reads given 'DEAN'. No FEC donor writes it: the one with a salutation writes an initial between (`AA, WING A. MR.`), which breaks the run, and reads right. Pinned as a case row rather than narrowed. Recompute: `uv run python tools/differential/snapshot.py --local fec-individuals --base ` (and `ctgov-officials`, `tse-donors`), `uv run python tools/differential/local_agreement.py psc-individuals --base `. +- **2026-10-26 #752, phase 2j, `mahdi` and `bard` (#867) — THE SECOND TITLE BATCH: TWO TITLES WRITTEN BEFORE A NAME AS GIVEN NAMES, AND AS EPITHETS WITH THEIR ARTICLE.** The batch decisions/vocabulary-model's 2026-10-24 #752 (Derek) entry put second, `bard` joining `mahdi` from #867. Each gains a dated `given` reading, so each leaves `titles` for `titles_ambiguous` and is a title only inside a title phrase. No listed phrase holds either, so neither reports (the report's reach, above): `Mahdi Karimi`, `Mr Mahdi Karimi`, `Karimi, Mahdi` and `Bard Larsen` read the given name, unreported, where 1.4.0 through 2.6.0 read title 'Mahdi' or 'Bard' (and `Mr Mahdi`). Unlike `wing`, neither is a modifier, so the contested word's partners apply: a modifier or a style before it, or `of` after it (`Grand Mahdi Karimi` and `Mahdi of Sudan` keep the title; `Mahdi Grand Karimi` does not). Like every word H9 reads, each now reads as a name word wherever no phrase holds it: ending the name (`John Karimi Mahdi.` → family 'Mahdi.', as 1.4.0 through 2.2.0 read it, where 2.3.0 through 2.6.0 read a title), alone after a full name and a comma (`John Karimi, Mahdi` → given 'Mahdi', family 'John Karimi', as `John Smith, Dean` reads), and past a second comma (`Karimi, John, Mahdi` → suffix, `comma-structure`, as C2 reads `Smith, John, Dean`). + - WHAT THE TITLE READINGS SERVED, AND THE COST. `mahdi` is a messianic title written as an epithet, never as an honorific before a person's own name; `bard`, from the 2014 title list with no recorded reason (#867), is mostly the Norwegian given name `Bård` with its accent dropped (in jrc-names, 31 of 36 persons with a spelling that starts `Bard` also have one that starts `Bård`). The epithet glued or alone reads the same in 1.4.0, 2.6.0 and this tree (`Muhammad Ahmad al-Mahdi` family 'al-Mahdi', `The Mahdi` given 'The'), but written with its article before a name or after a comma it read as the title in every release and now reads as the given name: `The Mahdi Muhammad Ahmad` → given 'The Mahdi', `Muhammad Ahmad, the Mahdi` → given 'the Mahdi', family 'Muhammad Ahmad', and the same for `The Bard William Shakespeare` and `William Shakespeare, the Bard` (found by the design-docs review). No local corpus writes either shape: 0 spellings holding `the Mahdi` or `the Bard` in jrc-names, fec-individuals, ctgov-officials, psc-individuals or ukec-individuals (2026-10-26), against the 79 PSC records and 26 ctgov and FEC names the given reading fixes. Recorded in rules/H9's Accepted clause. Under both family-first orders the joined epithet before a name is the family name (`The Mahdi Muhammad Ahmad` → family 'The Mahdi'), the comma shapes the given name under all three. + - THE BECAUSE, WIDENED. rules/H9's Because had said a word after a comma is read as written save a modifier also borne as a given name, wrong for `dean` since phase 2i (`John Smith, Dean` → given 'Dean'); it now names every word borne as a given name, and the claim rests on what was measured there: `dean`'s FEC listing forms (phase 2i), `wing`'s 14 and `mahdi`'s and `bard`'s 17 FEC and 6 ctgov names, every one the listing form's given name. `justice`, `major`, `marshal` and `grace` alone after a comma were not measured, and `John Smith, Major`, a rank in a listing, is the shape that would test the claim for a later batch. + - THE COUNTS, recorded on the words (`uv run python tools/name_usage.py Mahdi Bard Bård`, 2026-10-26): `mahdi` given US SSA 2,398 births, Wikidata 141 (a lower bound; Iran 43, Iraq 9), nam_dict band 5 in Arabia/Persia, family Census 1,241, Wikidata 13; `bard` given US SSA 218 (SSA folds `Bård`), Wikidata 10 and 107 more spelled `Bård`, nam_dict band 5 in Norway as `Bård`, family Census 5,953, Wikidata 100. PSC's filers put `Mahdi` in the forename box 84 times as its first word and never in the title box (#853, #867). + - MEASURED (2026-10-26, against master `32049ade`, py3.11, every local check with `--base`). PSC (1,039,174 scored, the fetch dated 2026-10-22): 79 records fixed, none broken, 6 changed, the 6 still disagreeing only because the filer typed two words in the surname box, which the default order reads as middle and family (`Mr MAHDI Aa Aa`, `Aa MAHDI Aa Aa`). ctgov-officials 6 moved, each a `Mahdi Aa, CRED` shape now read with given 'Mahdi'; fec-individuals 20, all fixes: `AA, MAHDI` 10, `AA, BARD` 6, and one each of `AA AA, MAHDI`, `AA, BARD AA`, `AA, BARD A. T` and `BARD AA, AA`, whose family part keeps `BARD` as a surname where H6 had peeled it as a title. The committed corpora, CLDR and GND agreement, and tse-donors do not move: no committed corpus held either word before this change, whose rules examples add two. Spelling consistency (mechanisms.md#PAIRED-SPELLINGS-PER-CHANGE, per person, against master): jrc-names 44 persons now alike and none apart, of 218,822 with two or more spellings, the spellings that read the word as a title and those that did not; nepal-candidates 0 and 0. + Recompute: `uv run python tools/differential/local_agreement.py psc-individuals --base `, and `uv run python tools/differential/snapshot.py --local ctgov-officials --base ` (and `fec-individuals`, `tse-donors`). diff --git a/docs/design/decisions/vocabulary-model.md b/docs/design/decisions/vocabulary-model.md index f6fc7788..0a40b3bc 100644 --- a/docs/design/decisions/vocabulary-model.md +++ b/docs/design/decisions/vocabulary-model.md @@ -217,6 +217,7 @@ Open: #752 (phase 2, derived ambiguity; its sub-phases 2a to 2m, each its own PR - `dean`, `justice` and `major` gain an office or military reading beside a dated `given` one; `justice`'s exclusion (#606) is replaced by the reading. The batches of 2j declare the rest. Adding the four fields changes `Lexicon`'s pickle layout, as phase 2h did. - **2026-10-26 #752, phase 2i (Derek) — `attaches` MAY NAME A TITLE WORD AS WELL AS A KIND, AND `grace` AND `marshal` JOIN THE CONTESTED TITLES.** Amends the `attaches` bullet of the 2026-10-25 #752, phase 2i entry: a kind reaches every word that later joins it, and once `marshal` became a contested military word the military kind made `Sgt Marshal Smith` a title phrase. A list entry that is no kind must be a word with a title reading (a build check, its mutation in tests/v2/test_vocab.py). `major` attaches to `general` and `sergeant` and `sgt` to `major`. `grace` (style) and `marshal` (military, its #606 exclusion replaced) carry dated `given` readings. The measurement and Derek's answers are decisions/H9's entry of this date. +- **2026-10-26 #752, phase 2j, `mahdi` and `bard` (#867) — THE SECOND TITLE BATCH: both words have a dated `given` reading.** `Mahdi Karimi`, `Mr Mahdi Karimi`, `Karimi, Mahdi` and `Bard Larsen` read the given name, where 1.4.0 through 2.6.0 read a title; no listed phrase holds either word, so nothing is reported. The measurement is decisions/H9's entry of this date. - **2026-10-26 #752, phase 2j, `wing` — THE FIRST TITLE BATCH: `wing` HAS A DATED `given` READING.** The order is the 2026-10-24 #752 (Derek) entry's. Decision 10 had already read `wing` as a name at the head of the name, so the reading reaches the parts decision 10 left as listed, after a comma and ending the name: `Lau, Wing Kai` reads given 'Wing', and `John Smith Wing.` family 'Wing.'. The rule and the measurement are decisions/H9's entry of this date. - **2026-10-26 (Derek), #785 — PHASE 2g NARROWED: a capitals member with a name word behind it, and no family comma, does not start the credential's run**, the name word being evidence of initials; `Maria Ana MA Silva`, `Jean Pierre MA DUPONT` and `Mary Jane MA King` keep the readings 1.4.0 through 2.6.0 gave, and `John Smith MA Jones` keeping family 'Jones' is the cost. The record is decisions/S6's entry of this date. - **2026-10-26 #789, #752, phase 2k — A GIVEN NAME WRITTEN SHORT IS A `given` READING WITH `same_as`, AND IT OUTRANKS rules/H2's SHAPE.** Carries out item 14 of the 2026-10-23 #752 entry above and the second half of #789; the first half, bare `wm` out of the titles, is the 2026-10-22 #789 entry. SUPERSEDES: in the README's property table, `same_as` as a property of every category but `name`. What changes in the vocabulary: diff --git a/docs/design/rules/H9-title-phrase.md b/docs/design/rules/H9-title-phrase.md index b789989d..c39c8454 100644 --- a/docs/design/rules/H9-title-phrase.md +++ b/docs/design/rules/H9-title-phrase.md @@ -19,6 +19,7 @@ "General Major John Smith" → given="Major" "Grace Dean Smith" → given="Grace" "Sgt Marshal Smith" → given="Marshal" + "Mr Mahdi Karimi" → given="Mahdi" ``` - **A modifier in the leading run of titles before the first comma** has its phrase in a head title after it in that run, in `of` after it, or in the object of `of` or `the` there. A modifier outside that run, ending the name or after a comma, is read as any title is, save one that may be a given name, which is read everywhere as it is in that run. ``` @@ -40,6 +41,7 @@ "Mr Dean Smith" → ambiguities=("title-or-name",) "Dean Smith, MD" → ambiguities=("title-or-name",) "Grace Smith" → ambiguities=() + "Bard Larsen" → ambiguities=() "GRACE SMITH" → ambiguities=() "SMITH, DEAN MR." → ambiguities=() ", Dean" → ambiguities=() @@ -47,7 +49,7 @@ "John Dean Smith" → ambiguities=() ``` -**Because:** a title addresses the name after it, so the front of a name has no count to read, and what tells the person "Dean Smith" from the office in "Dean of Students" is the phrase the word stands in. A word that only qualifies a head title, as wing qualifies commander, says nothing about the person on its own. After a comma the part is read as written there, as decision 10 measured: a lone title word in a part after the name is the person's role, and reading it as a name reversed the name, save a modifier also borne as a given name, which without its head is far more often the listing form's given name, or at the end a surname, than a role. +**Because:** a title addresses the name after it, so the front of a name has no count to read, and what tells the person "Dean Smith" from the office in "Dean of Students" is the phrase the word stands in. A word that only qualifies a head title, as wing qualifies commander, says nothing about the person on its own. After a comma the part is read as written there, as decision 10 measured: a lone title word in a part after the name is the person's role, and reading it as a name reversed the name, save a word also borne as a given name, which the name data measured so far writes there as the listing form's given name, or at the end as a surname, rather than a role. ``` "Dean Smith" → given="Dean" @@ -103,6 +105,11 @@ "The Hon. Wing Lau" → title="The Hon. Wing" "John Smith Wing. Jr." → title="Wing." ``` +- An epithet that is also a given name, written with its article before the name or after a comma, reads as a name word, the article joining it; no name data at hand writes either shape. + ``` + "The Mahdi Muhammad Ahmad" → given="The Mahdi" + "William Shakespeare, the Bard" → given="the Bard" + ``` - Once a partner has made the word a title, a coordinating join behind it takes the next word into the title too. ``` "Chief Dean and Mary Smith" → title="Chief Dean and Mary" diff --git a/docs/release_log.rst b/docs/release_log.rst index afe7a886..562c8e36 100644 --- a/docs/release_log.rst +++ b/docs/release_log.rst @@ -14,6 +14,7 @@ Release Log - **Read the Brazilian agnomens and French fils as suffixes where the name has a word to spare.** ``Pedro Alves Filho`` and ``Alexandre Dumas fils`` give last ``Alves`` and ``Dumas``, suffix ``Filho`` and ``fils``, where 1.4.0 through 2.6.0 gave middle ``Alves`` and ``Dumas``, last ``Filho`` and ``fils``; ``Neto``, ``Netto``, ``Sobrinho`` and the feminines ``Filha``, ``Neta``, ``Sobrinha`` read the same way. Each is a surname too, so a name of two words keeps it as the last name (``Ana Neto``, ``PEDRO FILHO``) and ``Fils`` in Title case in a mixed-case name stays the last name (``Marie Fils``), the parse reports the choice as a ``suffix-or-name`` ambiguity. ``Lexicon.suffix_words_ambiguous`` lists the words and ``Lexicon.agnomens`` the ones read by the word count alone. :issue:`843`, :issue:`752` - **Read a credential that is also a name, written in capitals in a mixed-case name, as settled.** ``John Smith MA`` reports no ``suffix-or-name`` ambiguity, where 2.0.0 through 2.6.0 reported one, and ``Smith, John MA Jones`` gives suffix ``MA Jones``, where 2.0.0 through 2.6.0 gave middle ``MA Jones`` and 1.4.0 middle ``Jones``, suffix ``MA``. A name written in one case still reports (``JOHN SMITH MA``), and with no comma a name word behind the capitals keeps them a name word, since they may be initials (``Maria Ana MA Silva`` keeps last ``Silva``). :issue:`785`, :issue:`752` - **Read a title that is also a given name as a title only inside a title phrase.** ``Chief Justice John Roberts`` gives title ``Chief Justice``, first ``John``, where 1.4.0 through 2.6.0 gave title ``Chief``, first ``Justice``; ``Field Marshal Bernard Montgomery``, ``Dean of Students Jane Smith`` and ``Major General John Smith`` give the phrase as the title too. Outside a phrase the word is still a name, so ``Dean Smith`` and ``Grace Smith`` give first ``Dean`` and ``Grace``; ``Dean Smith`` now reports a ``title-or-name`` ambiguity unless a comma has marked the given name (``Smith, Dean``), while ``Grace``, a title only in a phrase such as ``His Grace``, reports nothing. Listing the word as a title still makes it one everywhere (``Lexicon.default().add(titles={"dean"})``). :issue:`752`, :issue:`853` + - **Fix the given names Mahdi and Bard reading as titles.** ``Mahdi Karimi`` and ``Bard Larsen`` give first ``Mahdi`` and ``Bard``, where 1.4.0 through 2.6.0 gave title ``Mahdi`` and ``Bard`` with no first name; ``Mr Mahdi Karimi`` and ``Karimi, Mahdi`` read the same. Inside a title phrase either is still a title (``Mahdi of Sudan``), but the epithet with its article is not: ``Muhammad Ahmad, the Mahdi`` gives first ``the Mahdi``, last ``Muhammad Ahmad``, where 1.4.0 through 2.6.0 gave title ``the Mahdi``. :issue:`867`, :issue:`752` - **Fix a lone title qualifier at the head of a name reading as a title.** ``Wing Lau`` and ``Mr Wing Lau`` give first ``Wing``, where 1.4.0 through 2.6.0 gave title ``Wing`` and ``Mr Wing``; a qualifier such as ``Wing``, ``Vice`` or ``Grand`` is a title only with a title after it (``Wing Commander Lau``). After a comma it is still a title (``John Smith, Vice``), except ``Wing``, which is also a given name: ``Lau, Wing Kai`` gives first ``Wing``, middle ``Kai``, where 1.4.0 through 2.6.0 gave title ``Wing``, first ``Kai``. ``John Smith Wing.`` gives last ``Wing.``, as 1.4.0 through 2.2.0 did, where 2.3.0 through 2.6.0 gave title ``Wing.``. Like ``Dean``, it reverses a full name before a comma (``John Smith, Wing`` gives first ``Wing``, last ``John Smith``). :issue:`752` - **Read Chas., Wm. and the other given names written short as given names rather than titles.** ``Chas. Smith`` and ``Ma. Cristina Reyes`` give first ``Chas.`` and ``Ma.``, where 1.4.0 through 2.6.0 gave title ``Chas.`` and ``Ma.``; ``Thos.``, ``Jas.``, ``Geo.``, ``Robt.``, ``Benj.``, ``Jno.``, ``Saml.``, ``Edw.``, ``Richd.``, ``Wm.`` and the Filipino ``Jo.`` read the same way, behind a title too (``Mrs Ma. Liza Cruz`` gives title ``Mrs``, first ``Ma.``). An unlisted abbreviation in front is still a title (``Insp. Jane Morse``), and ``Lexicon.given_name_abbreviations`` lists the words. :issue:`789`, :issue:`752` - **A Lexicon or Parser pickled by an earlier release no longer loads.** Loading one raises ``ValueError`` naming the new fields (``suffix_words_ambiguous``, ``agnomens``, ``titles_ambiguous``, ``title_modifiers``, ``title_styles``, ``title_phrases``, ``given_name_abbreviations``); re-pickle after upgrading. ``ParsedName`` and ``HumanName`` pickles still load. :issue:`752` diff --git a/nameparser/config/_compiled.py b/nameparser/config/_compiled.py index 41ce8cfd..5d3674c2 100644 --- a/nameparser/config/_compiled.py +++ b/nameparser/config/_compiled.py @@ -138,7 +138,6 @@ 'banker', 'banner', 'bapak', - 'bard', 'baron', 'baroness', 'barrister', @@ -469,7 +468,6 @@ 'magnate', 'maharajah', 'maharani', - 'mahdi', 'maid', 'maj', 'majesty', @@ -966,9 +964,11 @@ }) TITLES_AMBIGUOUS: frozenset[str] = frozenset({ + 'bard', 'dean', 'grace', 'justice', + 'mahdi', 'major', 'marshal', 'wing', diff --git a/nameparser/vocab/ar.toml b/nameparser/vocab/ar.toml index 3cc74dd0..d509bee1 100644 --- a/nameparser/vocab/ar.toml +++ b/nameparser/vocab/ar.toml @@ -98,7 +98,9 @@ religious = { note = "addresses by the TITLE, not the given name, and the tradit [[word]] text = "mahdi" -religious = {} +religious = { issue = 867, decided = 2026-10-26, note = "a messianic title, written as an epithet with the article or after a name ('the Mahdi', 'al-Mahdi'), not as an honorific before a person's own name; a title only inside a title phrase, so the epithet with its article before a name or after a comma reads as the given name (rules/H9's Accepted clause), its given reading the clash (rules/H9): 'Mahdi Karimi' and 'Mr Mahdi Karimi' read the given name, unreported, since no listed phrase holds it" } +given = { us_ssa = 2398, wikidata = 141, as_of = 2026-10-26, note = "US SSA: male births; Wikidata is a lower bound (Iran 43, Iraq 9); nam_dict band 5 in Arabia/Persia" } +family = { us_census_2010 = 1241, wikidata = 13, as_of = 2026-10-26 } [[word]] text = "mufti" diff --git a/nameparser/vocab/en.toml b/nameparser/vocab/en.toml index 3550b037..9f97d37f 100644 --- a/nameparser/vocab/en.toml +++ b/nameparser/vocab/en.toml @@ -1226,7 +1226,9 @@ occupation = {} [[word]] text = "bard" -occupation = {} +occupation = { issue = 867, decided = 2026-10-26, note = "a title only inside a title phrase, its given reading the clash (rules/H9): 'Bard Larsen' reads the given name, unreported, since no listed phrase holds it" } +given = { us_ssa = 218, wikidata = 10, as_of = 2026-10-26, note = "mostly the Norwegian Bård with its accent dropped: US SSA folds it to BARD (male births); Wikidata is a lower bound, and holds 107 more spelled 'Bård' (Norway 87); nam_dict band 5 in Norway as 'Bård'" } +family = { us_census_2010 = 5953, wikidata = 100, as_of = 2026-10-26 } [[word]] text = "barrister" diff --git a/tests/v2/cases.py b/tests/v2/cases.py index dde2fed2..5a17157e 100644 --- a/tests/v2/cases.py +++ b/tests/v2/cases.py @@ -12270,9 +12270,9 @@ def _check_cjk_shape_purity(self) -> None: notes="C2, as 'Smith, John, Dean' reads; title 'Wing' before"), Case("given_name_modifier_ending_the_name", "John Smith Wing.", {"given": "John", "middle": "Smith", "family": "Wing."}, - classification="fix(#752)", notes="H9 over H5: a modifier that may be a given name needs its " - "head at the end too; read title 'Wing.' before"), + "head at the end too; 1.4.0's reading, which 2.3.0 " + "through 2.6.0 read as title 'Wing.'"), Case("given_name_modifier_before_a_dotted_suffix", "John Smith Wing. Jr.", {"title": "Wing.", "given": "John", "family": "Smith", "suffix": "Jr."}, @@ -12283,6 +12283,53 @@ def _check_cjk_shape_purity(self) -> None: {"title": "The Hon. Wing", "family": "Lau"}, notes="H9's Accepted clause: the object of 'the' keeps the " "title, as master read it (#752 phase 2j)"), + Case("given_name_title_mahdi_at_the_head", "Mahdi Karimi", + {"given": "Mahdi", "family": "Karimi"}, classification="fix(#867)", + notes="H9: no listed phrase holds 'mahdi', so no report; read " + "title 'Mahdi', no given name, 1.4.0 through 2.6.0 " + "(#752 phase 2j)"), + Case("given_name_title_mahdi_after_a_salutation", "Mr Mahdi Karimi", + {"title": "Mr", "given": "Mahdi", "family": "Karimi"}, + classification="fix(#867)", + notes="H9: a salutation is no partner (#853); read title " + "'Mr Mahdi' before"), + Case("given_name_title_mahdi_after_a_family_comma", "Karimi, Mahdi", + {"given": "Mahdi", "family": "Karimi"}, classification="fix(#867)", + notes="H9; read title 'Mahdi' before"), + Case("given_name_title_mahdi_after_an_empty_head", ", Mahdi", + {"given": "Mahdi"}, classification="fix(#867)", + notes="H9; read title 'Mahdi' before"), + Case("given_name_title_mahdi_after_a_title", "Imam Mahdi Karimi", + {"title": "Imam", "given": "Mahdi", "family": "Karimi"}, + classification="fix(#867)", + notes="H9: a title that is no style, modifier or attaching " + "partner leaves the word a given name; read title " + "'Imam Mahdi' before"), + Case("given_name_title_mahdi_as_an_epithet", "Muhammad Ahmad al-Mahdi", + {"given": "Muhammad", "middle": "Ahmad", "family": "al-Mahdi"}, + notes="the epithet the title reading names reads as the family " + "in 1.4.0, 2.6.0 and now: the reading never served it"), + Case("given_name_title_mahdi_as_an_epithet_after_a_comma", + "Muhammad Ahmad, the Mahdi", + {"given": "the Mahdi", "family": "Muhammad Ahmad"}, + classification="fix(#867)", + notes="H9's Accepted clause: the epithet with its article reads " + "as the given name; read title 'the Mahdi' in every " + "release before (#752 phase 2j)"), + Case("given_name_title_mahdi_ending_the_name", "John Karimi Mahdi.", + {"given": "John", "middle": "Karimi", "family": "Mahdi."}, + notes="H9; 1.4.0's reading, which 2.3.0 through 2.6.0 read as " + "title 'Mahdi.' (H5)"), + Case("given_name_title_bard_at_the_head", "Bard Larsen", + {"given": "Bard", "family": "Larsen"}, classification="fix(#867)", + notes="H9: 'Bard' is mostly Norwegian 'Bård' written without " + "its accent; read title 'Bard' before (#752 phase 2j)"), + Case("given_name_title_bard_in_capitals_after_a_comma", "LARSEN, BARD", + {"given": "BARD", "family": "LARSEN"}, classification="fix(#867)", + notes="H9, the FEC listing form; read title 'BARD' before"), + Case("given_name_title_bard_as_a_surname", "Ola Bard", + {"given": "Ola", "family": "Bard"}, + notes="a trailing bare title word was already a name word"), Case("given_name_modifier_after_a_style", "Hon. Wing Lau", {"title": "Hon.", "given": "Wing", "family": "Lau"}, notes="H9: the modifier's test, not a contested word's style " diff --git a/tests/v2/rules_budget.json b/tests/v2/rules_budget.json index da6ba660..d8073a3a 100644 --- a/tests/v2/rules_budget.json +++ b/tests/v2/rules_budget.json @@ -25,7 +25,7 @@ "H6": {"words": 316, "then_words": 79, "because_sentences": 3, "except": 4, "precedence": 0, "accepted": 2, "accepted_words": 100}, "H7": {"words": 343, "then_words": 274, "because_sentences": 2, "except": 0, "precedence": 0, "accepted": 1, "accepted_words": 54}, "H8": {"words": 431, "then_words": 68, "because_sentences": 3, "except": 3, "precedence": 3, "accepted": 3, "accepted_words": 128}, - "H9": {"words": 622, "then_words": 263, "because_sentences": 3, "except": 0, "precedence": 5, "accepted": 6, "accepted_words": 211}, + "H9": {"words": 626, "then_words": 263, "because_sentences": 3, "except": 0, "precedence": 5, "accepted": 7, "accepted_words": 247}, "M1": {"words": 231, "then_words": 120, "because_sentences": 2, "except": 1, "precedence": 2, "accepted": 0, "accepted_words": 0}, "M2": {"words": 714, "then_words": 435, "because_sentences": 1, "except": 4, "precedence": 1, "accepted": 6, "accepted_words": 209}, "M3": {"words": 234, "then_words": 84, "because_sentences": 2, "except": 2, "precedence": 2, "accepted": 1, "accepted_words": 80}, diff --git a/tools/differential/corpus_rules.jsonl b/tools/differential/corpus_rules.jsonl index 251bba11..ad760ca8 100644 --- a/tools/differential/corpus_rules.jsonl +++ b/tools/differential/corpus_rules.jsonl @@ -61,6 +61,7 @@ "Asst. Vice Chancellor John Smith" "Attorney General of Minnesota" "Bahadur, Ram B.K." +"Bard Larsen" "Beethoven Ludwig Maria van" "Beethoven Ludwig van" "Beethoven, Ludwig van" @@ -613,6 +614,7 @@ "Mother Superior of the Convent Mary Smith" "Mr Dean Smith" "Mr Justice Smith" +"Mr Mahdi Karimi" "Mr Smith" "Mr Wing Lau" "Mr. Jack Jill" @@ -822,6 +824,7 @@ "Steven Hardman, RN - CRNA" "The Hon. Justice Mary Smith" "The Hon. Wing Lau" +"The Mahdi Muhammad Ahmad" "The Right Hon. the President of the Queen's Bench Division" "VI, AD" "Van Buren, Ed" @@ -831,6 +834,7 @@ "Wang M.Eng." "Wang Ma PhD" "Wilhelm I." +"William Shakespeare, the Bard" "Wing Commander Lau" "Wing Lau" "Wing Smith, John" diff --git a/tools/differential/snapshot.jsonl b/tools/differential/snapshot.jsonl index f9ae1957..813b262b 100644 --- a/tools/differential/snapshot.jsonl +++ b/tools/differential/snapshot.jsonl @@ -321,6 +321,7 @@ {"name": "Barbara Brukalska", "given": "Barbara", "family": "Brukalska", "initials": "B. B."} {"name": "Barbara Scharf", "given": "Barbara", "family": "Scharf", "initials": "B. S."} {"name": "Barbara Scharf, CPPM", "given": "Barbara", "family": "Scharf", "suffix": "CPPM", "initials": "B. S."} +{"name": "Bard Larsen", "given": "Bard", "family": "Larsen", "initials": "B. L."} {"name": "Baron Davis", "title": "Baron", "family": "Davis", "initials": "D."} {"name": "Barrera y Leirado, Cayetano Alberto de la", "given": "Cayetano", "middle": "Alberto", "family": "de la Barrera y Leirado", "ambiguities": ["PARTICLE_OR_GIVEN"], "initials": "C. A. B. L."} {"name": "Baʿal-Maḥshoves̀", "given": "Baʿal-Maḥshoves̀", "ambiguities": ["GIVEN_OR_FAMILY"], "initials": "B."} @@ -2546,6 +2547,7 @@ {"name": "Mr Dean Smith", "title": "Mr", "given": "Dean", "family": "Smith", "ambiguities": ["TITLE_OR_NAME"], "initials": "D. S."} {"name": "Mr Justice Smith", "title": "Mr", "given": "Justice", "family": "Smith", "ambiguities": ["TITLE_OR_NAME"], "initials": "J. S."} {"name": "Mr MA", "title": "Mr", "family": "MA", "initials": "M.", "capitalized_force": "Mr Ma"} +{"name": "Mr Mahdi Karimi", "title": "Mr", "given": "Mahdi", "family": "Karimi", "initials": "M. K."} {"name": "Mr Md Karim Uddin", "title": "Mr", "given": "Md", "middle": "Karim", "family": "Uddin", "initials": "M. K. U."} {"name": "Mr Smith", "title": "Mr", "family": "Smith", "initials": "S."} {"name": "Mr Wing Lau", "title": "Mr", "given": "Wing", "family": "Lau", "initials": "W. L."} @@ -3370,6 +3372,7 @@ {"name": "The Hon. Justice Mary Smith", "title": "The Hon. Justice", "given": "Mary", "family": "Smith", "initials": "M. S.", "capitalized_force": "the Hon. Justice Mary Smith"} {"name": "The Hon. Wing Lau", "title": "The Hon. Wing", "family": "Lau", "initials": "L.", "capitalized_force": "the Hon. Wing Lau"} {"name": "The Lord of the Universe", "title": "The Lord of the Universe", "capitalized_force": "the Lord of the Universe"} +{"name": "The Mahdi Muhammad Ahmad", "given": "The Mahdi", "middle": "Muhammad", "family": "Ahmad", "initials": "M. M. A.", "capitalized_force": "the Mahdi Muhammad Ahmad"} {"name": "The Right Hon. the President of the Queen's Bench Division", "title": "The Right Hon. the President of the Queen's Bench", "family": "Division", "ambiguities": ["TITLE_OR_NAME"], "initials": "D.", "capitalized_force": "the Right Hon. the President of the Queen'S Bench Division"} {"name": "The Rt Hon", "title": "The Rt", "family": "Hon", "ambiguities": ["TITLE_OR_NAME"], "initials": "H.", "capitalized_force": "the Rt Hon"} {"name": "The Rt Hon John Jones", "title": "The Rt Hon", "given": "John", "family": "Jones", "initials": "J. J.", "capitalized_force": "the Rt Hon John Jones"} @@ -3535,6 +3538,7 @@ {"name": "Willemse Heidi Johannes", "order": "FAMILY_FIRST", "given": "Heidi", "middle": "Johannes", "family": "Willemse", "initials": "H. J. W."} {"name": "Willemse, Bertus Wilbers Henri Retief", "given": "Bertus", "middle": "Wilbers Henri Retief", "family": "Willemse", "initials": "B. W. H. R. W."} {"name": "Willemse, Heidi Johannes", "given": "Heidi", "middle": "Johannes", "family": "Willemse", "initials": "H. J. W."} +{"name": "William Shakespeare, the Bard", "given": "the Bard", "family": "William Shakespeare", "initials": "B. W. S."} {"name": "Willington Baena Ortiz", "given": "Willington", "middle": "Baena", "family": "Ortiz", "initials": "W. B. O."} {"name": "Wing Commander Lau", "title": "Wing Commander", "family": "Lau", "initials": "L."} {"name": "Wing Lau", "given": "Wing", "family": "Lau", "initials": "W. L."}