Skip to content

Join a Latin bound given name past the first word with the name word after it (#1464) - #1496

Merged
derek73 merged 3 commits into
masterfrom
fix/issue-1464-abdul-joins
Nov 20, 2026
Merged

derek73 merged 3 commits into
masterfrom
fix/issue-1464-abdul-joins

Conversation

@derek73

@derek73 derek73 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Closes #1464

As decided on the issue: a Latin bound given name joins the plain name word after it past the first name word, as an amendment to rules/P12 (a bound given name and the word that completes it), stated through two properties on the bound_given reading rather than a hard-coded set. Position places the pair, the family where it ends the name and one middle name inside it. abdul joins only in a name of four name words or more. abu and Arabic-script عبد are unchanged.

Tariq Abdel Aziz          → family 'Abdel Aziz'          (1.4.0–3.1.0: middle 'Abdel', family 'Aziz')
Nadia Ali Abdul Rahim     → middle 'Ali', family 'Abdul Rahim'   (1.4.0–3.1.0: middle 'Ali Abdul', family 'Rahim')
Nadia Abdul Rahim Ali     → middle 'Abdul Rahim'          (unchanged: inside the name)
Tariq Abdul Aziz          → middle 'Abdul', family 'Aziz' (unchanged: abdul in a three-word name)
Haddad, Nadia Abd Karim   → middle 'Abd Karim'            (1.4.0–3.1.0: middle 'Karim', suffix 'Abd')

What it adds

  • Vocabulary (nameparser/vocab/ar.toml):
    • completes_any = true on abd, abdel, abdal, abou, abdul.
    • long_names_only = true on abdul, with the per-population three-word counts on its entry, so the next word declined is a data change.
  • Compiled sets: BOUND_COMPLETES_ANY and BOUND_LONG_NAMES_ONLY, compiled through the BEHAVIORAL table like any curated sub-set.
  • Build checks: each property must be true or unwritten, and the build refuses long_names_only without completes_any.
  • Callers: may state either property with Lexicon.add. long_names_only alone is accepted and inert, not refused, since an inert entry misparses nothing.
  • Rule (_classify.py): P12's phrase test also tags a completes_any word before a plain word: no tag except H9's contested-title one, and holding a letter. Group's existing P12 join pairs them, and the first word stays P5's.
  • The four-word count (_name_words) runs after H9's phrase test and reads each comma part before a maiden clause:
    • each part's leading title run counts as none (listed, a title phrase, dotted, H2's shape, connectives with the word they join);
    • after the pair, only a plain word, a bound given name or a pair of initials up to the next comma counts, a numeral written other than in Title case not counting.
  • No new vocabulary kind, no new API.

Measured

Against filers' boxes, records whose name holds one of the five words, fixed / broken against master 1ca93b25. The recipe is in decisions/P12's 2026-11-19 entry.

particle reading (dropped) join, all five words join, abdul declined in three words (shipped)
ORCID, every country 1,944 / 324 1,671 / 122 1,243 / 30
Malaysia 636 / 14 625 / 7 445 / 5
Egypt 398 / 31 301 / 1 298 / 1
Bangladesh 11 / 72 11 / 51 1 / 2
PSC, every nationality 301 / 643 270 / 346 166 / 76
British 126 / 385 113 / 215 70 / 44
PatentsView 95 / 170 83 / 91 66 / 51
  • Against the prototype: the shipped build reads ORCID and PatentsView exactly as the prototype of the same variant did, and PSC with 6 fewer broken records (titled names the prototype's filter missed).
  • measure.py --base against 1ca93b25, on the final code, 30 steps, none failed:
    • Agreement progress / regression: ORCID 1,247 / 31, PSC 148 / 73, PatentsView 68 / 56.
    • JRC-Names: 61 persons now alike, 89 now apart.
    • Moves: ORCID 1,586, JRC-Names 592, ClinicalTrials.gov officials 399 and contacts 249, PSC 265, PatentsView 126, TSE donors 37, my-candidates 24, parliaments 9.
    • Every other local corpus, CLDR and GND unmoved. Each move is a pair joining, save Abd after a family comma, which no longer reads as the credential ABD.
  • Why the particle route was dropped: it scored lowest in PSC and PatentsView. It also cost a given name before a credential comma (Abd Karim, MD, 49 ClinicalTrials.gov names), cut bin chains, and lower-cased the word.

Frames (the AGENTS.md frame budget), counted with sys.setprofile on py3.11:

Name master branch
Reference row, Dr. Juan0001 de la Vega III 196 196
Comma name, Smith, John 98 98
Abdul Rahman Ali (bound word first) 132 132
Tariq Abdul Aziz (the four-word count) 127 129
Tariq Abdel Aziz (the pair joins) 127 135
Nadia Ali Abdul Rahim (the pair joins) 143 154

Still wrong (recorded in decisions/P12)

Changes

  • Code: nameparser/_pipeline/_classify.py, _reading_index.py, _lexicon.py, tools/vocab/build.py, nameparser/vocab/ar.toml. Compiled modules rebuilt.
  • Rules:
    • P12: When, a new Then bullet, Excepts, Because, Signal.
    • P5: Precedence names the family-comma Abd that P12 now joins.
    • O6: the bound-pair example moves to Umm Kulthum, since a Latin pair P12 joins is one unit O6 takes.
    • S8: an example's family.
    • The README glossary gains P12's count.
  • Decisions: decisions/P12 gains a dated entry, new Standing lines and an Open line, and supersedes the 2026-11-04 decline of the Latin spellings.
  • User docs: customize.rst (the bound-given section and a Malaysian recipe), migrate.rst (a Changed in 3.2 entry), one release-log bullet, the vocab README rows, the root AGENTS.md set list, and the nameparser/AGENTS.md sweep lessons this change earned.
  • Tests:

Reviews

Run on this branch, each fix commit reviewed in turn:

  • Code review (pr-review-toolkit:code-reviewer).
  • Test coverage with mutations (pr-test-analyzer).
  • Comments (comment-analyzer).
  • Design docs (design-docs-reviewer).
  • Three successive reviews of the fix commits; the last found no defects.

The reviews found:

  • the count reading a comma-less suffix, a shape title and a title phrase as name words;
  • a lone mark taken as a partner;
  • a cached count across two pairs;
  • a particle after a title taken for the title's object;
  • the join refusing a contested title read as a name;
  • lower-case numerals counted;
  • stale prose.

Each is fixed with a row.

Full suite, -m serial, mypy, ruff, Sphinx doctest, README doctest, build.py --check and parity_check.py all pass.

🤖 Generated with Claude Code

…after it (#1464)

abd, abdel, abdal and abou carry `completes_any` on their bound_given
reading, and abdul `long_names_only` beside it: rules/P12 joins the
bound word with a plain name word after it past the first name word,
abdul only in a name of four name words or more, and position places
the pair (family where it ends the name, one middle name inside it).
`Tariq Abdel Aziz` gives family 'Abdel Aziz'; `Tariq Abdul Aziz` keeps
middle 'Abdul'; `Haddad, Nadia Abd Karim` no longer reads ABD. abu and
Arabic-script عبد are unchanged.

The four-word count runs after classify's H9 phrase test, part by
part: each part's leading title run counts as none, and after the pair
only a plain word, a bound given name or a pair of initials up to the
next comma, a numeral written other than in Title case not counting.

Two properties compile into BOUND_COMPLETES_ANY and
BOUND_LONG_NAMES_ONLY; the build refuses long_names_only alone. Rules
P12, P5, O6 and S8 amended; decisions/P12 records the three routes
measured, the three-word split by population and what is still wrong.
Snapshot, rules corpus and CLDR agreement re-recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 20, 2026
@derek73 derek73 added vocabulary Fixed by a word-list entry: per-word vocabulary and language packs particles Particles and surname prefixes (rules/P) name-order Name order, family-first and two family names (rules/O) labels Nov 20, 2026
@derek73 derek73 self-assigned this Nov 20, 2026
derek73 and others added 2 commits November 19, 2026 19:27
The count's skip of a word with no letter had no row reaching it, which
codecov/patch reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pen line at locales.MS (#1179)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 34771e2 into master Nov 20, 2026
14 checks passed
@derek73
derek73 deleted the fix/issue-1464-abdul-joins branch November 20, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name-order Name order, family-first and two family names (rules/O) particles Particles and surname prefixes (rules/P) vocabulary Fixed by a word-list entry: per-word vocabulary and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should Abdul join the word after it when it is not the first word? (Ahmad Abdul Rahman gives middle Abdul, family Rahman)

1 participant