Repository navigation
Settle two match readings of initials, and say what a key promises - #1390
Merged
Merged
Conversation
A family or maiden name of initials alone on both sides now agrees letter for letter, in order, or not at all: `J. P., Ann` / `P. J., Ann`, `J., Ann` / `J. P., Ann` and `J.-P., Ann` / `J., Ann` conflict under every setting, where master read the family name `part-of-other` and the maiden name `initial`. One branch of `_text_outcomes` serves both roles; the given and middle names are not held to it. A given name of two or three capitals with no middle name, in a name whose own words are not all capitals, reads as initials where the other side's given and middle names spell its letters exactly, in order (`JP Smith` / `John Paul Smith`), counted as the dotted spelling's comparison counts them, and only where that makes the pair consistent, judged after the cross-role search. docs/matching.rst and `Matching.keys` now say a key is a bucket cut by one release under one matcher's settings: store names, rebuild keys. Closes #1350 Closes #1351 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The review of a40c2ca: a capitals word on the other side counted as one name word for its first letter, so `JP Smith` / `JR Paul Smith` and `JJ Smith` / `John JP Smith` matched, and `JP Smith` / `JP Paul Smith` hid a one-sided middle name the caller refused. Such a word now spells no letter, being initials by the rule's own reading. The capitals gate reads the given and family names alone, a maiden name being another name's writing (`JP SMITH (née Jones)`). "Both initials alone" and "the same letters in order" are each one predicate now (`_initials_alone`, `_same_letters`), which moves no verdict; `check` computes its verdict once and calls the cross-role pass only where `across-roles` is accepted (194 frames for a same pair, as master). Records: master read the family `J.-` / `J.` `part-of-other`; the control recipe's count; the glued-initials limit in the Standing line and the user doc; the substitution figure's partner set; made-up names for the corpus records; the #1351 measurement's recipe and seeds; the match_diff lesson in AGENTS.md and the tools README (22 settings); #1350's keys question answered; the gate's wording; #1391 and #1392; a shorter release bullet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The review of 1629bd5: folding `_initial_outcome`'s word test into `_same_letters` dropped an empty word in the given, middle and nickname rows too, so `J. Smith` / `-J. Smith`, `Ann J. Smith` / `Ann -J. Smith` and three more pairs read consistent. Those rows keep the exact split again, as master did; the family and maiden names still drop a word of hyphens alone. Rows pin all five. The capitals branch's cross-role pass runs only where `across-roles` is accepted (445 frames for `JP Smith` / `John Paul Smith`). Rows pin a decomposed capitals word on the other side and the Accepted boundary (a word with a digit or four capitals counts as a name word). Two more names in the entry are made up. Co-Authored-By: Claude Opus 5.5 <[email protected]>
derek73
added a commit
that referenced
this pull request
Nov 14, 2026
#1390's capitals rule meets `MD`, now a listed short form of Muhammad: `MD Rahman` / `Mohammad Dewan Rahman` reads its listed spelling before the rule is asked, so its `_CAPITALS` row moves to the already-consistent group and the recorded control from 16 rows to 15. A test pins both readings of `MD`, and the decisions entry records the interplay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two of the name match's readings of initials settled before 3.1 freezes them, and a statement of what a key promises. Name matching is new in 3.1, so tightening a verdict now breaks no caller.
What changes
#1350: a family or maiden name of initials alone agrees letter for letter.
initials-agreewhere the letters agree in order, and no other leniency.J. P., Ann/P. J., Ann,J., Ann/J. P., AnnandJ.-P., Ann/J., Annconflict under every setting,+family-initialincluded.part-of-other, and the maiden(née J.-P.)/(née J.)initial._text_outcomesserves both roles. The given and middle names are not held to it:J.-P. Smith/J. Smithstill readsinitial.#1351: a given name of capitals reads as the initials the other side spells.
Dr. JP SMITHandJP SMITH (née Jones)refused).initialin the given and middle rows where the other side's given name and middle names spell its letters exactly, in order (JP Smith/John Paul Smith).Abdul Adilspells nothing, and a capitals word on the other side spells no letter (JR Paul Smithspells J, R, P).Keys: docs/matching.rst ("Grouping by key") and
Matching.keysnow say what a key is: a bucket cut from a parse, by one nameparser version under one matcher's settings. Store names, not keys, and rebuild keys after upgrading or changing settings. A doctest shows the same text keyed two ways under two parsers. No new API.What moved
uv run python tools/differential/match_diff.py --base <a checkout of 3dadc263>reads 31,350 pairs under 22 settings. The key guarantee holds, and 1,084 of 689,700 rows move:J. P., Ann/P. J., Annreads familypart-of-other, consistent) #1350:part-of-other→conflict484, →initials-agree66;initial→conflict22, →initials-agree44 (the stray-hyphenJ.-/J.);JP SmithmatchJohn Paul Smith? An undotted pair of capitals reads as one given name, so the pair conflicts whereJ.P. Smithmatches #1351: givenconflict→initial461, middleone-side→initial468, on the spelled pairs.JP Smith/JR Paul Smith,JJ Smith/John JP Smith,JP Smith/JP Paul Smithunder-one-side,JP SMITH (née Jones)/John Paul Smith).AL Smith/Anna Louise Smithunder other-readings, 2 rows: it no longer needs its other reading.match_diff's own draw held no pair of either shape: before this branch's test rows existed, both changes moved 0 of 687,500 rows. The pairs above come from the new
_INITIALS_ALONEand_CAPITALSrows intests/v2/test_match.py, which the tool draws from, and from seeded pairings of their names.Corpus measurement for #1351 (decisions/name-matching, 2026-11-13 #1351), over five local corpora:
J. P.reads": 46,940 newly consistent; refused on a seeded sample of its 44,312 added pairs, 0 of 100 the same person.Accepted, recorded
de J. P., Ann/de P. J., Ann) still readspart-of-other, an unwritten shape.JP Smith~John Paul Smith~John Smith, withJP Smith!~John Smith;JPR Smith~John Paul Robert Smith~John Paul Smith, withJPR Smith!~John Paul Smith.Smith, JPandSmith JPunderFAMILY_FIRSTread suffixJP(Should two capitals after a surname and comma read as initials when they are also a credential? (Smith, JPgives suffixJPand no given name; citation lists) #1391);Hae Rin Cho, MH, PhD, Two unlisted capitals between a name and a credential read as the given name (Ji Eun Lee, MH, PhDgives given 'MH', family 'Ji Eun Lee') #1392).J.P., Ann/J., Annstill readsfamily-initial.JP 王,JP S.) is refused by the capitals gate.JP Smith/J2 Paul Smith), a capitals word being two or three letters.Checks
uv run pytestanduv run pytest -n0 -m serialuv run mypyanduv run ruff checkuv run sphinx-build -b doctest docs <tmp>: 899 tests, 0 failurespython -m doctest README.rsttools/vocab/build.py --checknamedivider-pythonmatch_diff.py --base, as above_match.pyfails 12 of_INITIALS_ALONE's 37 rows under each of the 9 settings;_capitals_spelledanswering False, 16 of_CAPITALS' 53 rows fail;_same_letterswithout its empty-word filter fails the two family and maiden stray-hyphen rows under each setting;_initial_outcomereading_same_lettersfails the five given, middle and nickname stray-hyphen rows; dropping the NFC step on the other side's words fails the decomposedÉR Paul Smithrow.check(master / this branch): same pair 194 / 194,J. Smith/John Smith260 / 260,John Smith/Jane Smith312 / 317,JP Smith/John Paul Smith324 / 445.Review aspects run
pr-review-toolkit:code-reviewerfound three issues:JP Jones/John Paul Smith (née Jones)was refused underacross-roles;Dr. JP SMITH);(née J.-)).pr-review-toolkit:pr-test-analyzerfound that four gate clauses, the scope of the Should a family name of initials alone match the same initials in another order, or fewer? (J. P., Ann/P. J., Annreads familypart-of-other, consistent) #1350 branch, the narrower accept sets and other comma shapes, orders and packs had no rows. It also found "nothing else" wording thatsame/foldedcontradict.All of these are fixed in a40c2ca, with rows. The coordinator's independent review of a40c2ca found no defect against the contract and a list fixed in 1629bd5: a capitals word on the other side counted as a name word; the maiden name passed the capitals gate; the two initials predicates had inline twins; check paid 9 more frames; and records (master's
J.-reading, the recipe count, the glued limit, the substitution figure's partner set, corpus names, the measurement recipe, the match_diff lesson, the keys question, the gate's wording, the issue links, the release bullet). Its review of 1629bd5 found that commit's fold of the "same letters" test moved the given, middle and nickname rows (J. Smith/-J. Smithread consistent): restored in the last commit, with rows, the capitals branch's cross-role pass gated, two more names made up, and rows for a decomposed capitals word on the other side and for the Accepted boundary.Closes #1350
Closes #1351
🤖 Generated with Claude Code