Skip to content

Settle two match readings of initials, and say what a key promises - #1390

Merged
derek73 merged 3 commits into
masterfrom
fix/issue-1350-family-initials-alone
Nov 14, 2026
Merged

derek73 merged 3 commits into
masterfrom
fix/issue-1350-family-initials-alone

Conversation

@derek73

@derek73 derek73 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

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.

  • Where both family names, or both maiden names, are initials alone, the row reads initials-agree where the letters agree in order, and no other leniency.
  • So J. P., Ann / P. J., Ann, J., Ann / J. P., Ann and J.-P., Ann / J., Ann conflict under every setting, +family-initial included.
  • Master read each of these family pairs part-of-other, and the maiden (née J.-P.) / (née J.) initial.
  • One branch of _text_outcomes serves both roles. The given and middle names are not held to it: J.-P. Smith / J. Smith still reads initial.

#1351: a given name of capitals reads as the initials the other side spells.

  • When it applies: a given name of two or three capitals, with no middle name, whose given or family name holds a lower-case letter (a title, suffix, nickname or maiden name in mixed case leaves Dr. JP SMITH and JP SMITH (née Jones) refused).
  • What it does: it reads initial in 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).
  • Words are counted as the dotted spelling's comparison counts them, so a bound given name such as Abdul Adil spells nothing, and a capitals word on the other side spells no letter (JR Paul Smith spells J, R, P).
  • It applies only where it makes the pair consistent, judged after the cross-role search, so it never takes a match away.
  • The parse and the keys are unchanged.

Keys: docs/matching.rst ("Grouping by key") and Matching.keys now 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:

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_ALONE and _CAPITALS rows in tests/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:

  • "exactly": 2,628 newly consistent pairs among names sharing a key (a dated snapshot; the recipe and seeds are in the entry).
  • "as J. P. reads": 46,940 newly consistent; refused on a seeded sample of its 44,312 added pairs, 0 of 100 the same person.
  • Samples of "exactly", 125 pairs: 34 the same person, 36 another person with the same initials (dotted initials' own error class), 55 unclear.

Accepted, recorded

Checks

  • uv run pytest and uv run pytest -n0 -m serial
  • uv run mypy and uv run ruff check
  • uv run sphinx-build -b doctest docs <tmp>: 899 tests, 0 failures
  • python -m doctest README.rst
  • tools/vocab/build.py --check
  • Python 3.15 in its own environment
  • the suite without namedivider-python
  • match_diff.py --base, as above
  • Negative controls, recorded in the tests:
    • the new test file run against master's _match.py fails 12 of _INITIALS_ALONE's 37 rows under each of the 9 settings;
    • with _capitals_spelled answering False, 16 of _CAPITALS' 53 rows fail;
    • each clause of the gate has a row only it refuses, the other-side capitals test and the maiden name's exclusion included;
    • _same_letters without its empty-word filter fails the two family and maiden stray-hyphen rows under each setting; _initial_outcome reading _same_letters fails the five given, middle and nickname stray-hyphen rows; dropping the NFC step on the other side's words fails the decomposed ÉR Paul Smith row.
  • Cost, call events for one check (master / this branch): same pair 194 / 194, J. Smith / John Smith 260 / 260, John Smith / Jane Smith 312 / 317, JP Smith / John Paul Smith 324 / 445.

Review aspects run

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. Smith read 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

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]>
@derek73 derek73 added this to the 3.1 milestone Nov 14, 2026
@derek73 derek73 added enhancement matching Name matching: Parser.matching(), check() and keys() initials Reading initials and the initials() view (rules/T) labels Nov 14, 2026
@derek73 derek73 self-assigned this Nov 14, 2026
derek73 and others added 2 commits November 13, 2026 22:40
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
derek73 merged commit aad9ca8 into master Nov 14, 2026
14 checks passed
@derek73
derek73 deleted the fix/issue-1350-family-initials-alone branch November 14, 2026 20:53
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement initials Reading initials and the initials() view (rules/T) matching Name matching: Parser.matching(), check() and keys()

Projects

None yet

1 participant