Skip to content

Link a lone letter after a connective, and join a connective with nothing to link to the word before it (#1097, #1098) - #1105

Merged
derek73 merged 7 commits into
masterfrom
fix/issue-1097-1098-connective-before-numeral
Nov 6, 2026
Merged

derek73 merged 7 commits into
masterfrom
fix/issue-1097-1098-connective-before-numeral

Conversation

@derek73

@derek73 derek73 commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Closes #1097
Closes #1098

What moved

A new rule, P13 (a connective ending the name words), sits beside P6. It makes two joins before P3's three-word carve-out, in the part that holds the family name.

Input 1.4.0 – 2.8.2 this PR
John Smith y V middle Smith, family y, suffix V family Smith y V
Juan García y L. middle García y, family L. family García y L.
Puig i V, Joan family Puig V, suffix i (to 2.6.0); family Puig, suffix i V (2.7.0 – 2.8.2) family Puig i V
John Smith y III middle Smith, family y, suffix III family Smith y, suffix III
John Smith y VI family Smith y VI family Smith y, suffix VI
John Paul Smith y III family Smith y III family Smith y, suffix III
John Smith and Jr. family Smith and Jr. family Smith and, suffix Jr.
  • A lone letter after a single-letter connective is the second surname it links. This covers a numeral or an initial, with or without its period. It applies with or without a comma, and to the Catalan i as well.
  • A connective with nothing to link joins the word before it alone. This covers any connective written as a word, when only suffixes or a trailing title stand behind it. It no longer takes a suffix or a title as the name it links.

Decided in chat

  • Family-first orders. Without a comma, the joins apply only under a given-first order, because there the end of the name is the family. The part before a family comma joins under every order.
  • One-case names. These link a lone letter as their mixed-case twins do (JOHN SMITH Y V → family SMITH Y V). A cased single letter ending a one-case name keeps its reading. Every such name in the local corpora is an initial: CHENG GUI Y keeps family Y, and under FAMILY_FIRST reads middle Y.
  • Rule home. Both clauses live in their own rule, P13, beside P6. P3 points to it.

Boundaries (case rows)

  • Smith y V and Dr. Smith y V keep the carve-out. Where the part is the whole name, the joins leave a word in front, so the name keeps its given name.
  • Smith y i V, John keeps suffix i V. This is a run of connectives. Count a family part's connectives out of its numeral count (#1093) #1095's S10 exception stays where P13 did not link the letter.
  • Mr. John Smith and Mrs. stays a couple's formula. A word connective with a period-marked title right behind it is left to P3. John Smith and Jr. Mrs. still joins Smith and.
  • John Smith & III is unchanged. A symbol is no word.
  • John Quincy Smith i keeps suffix i. A generational connective with nothing after it stays the generation.
  • John Smith Y keeps family Y. A capital letter in a mixed-case name is an initial (P8).
  • A name typed decomposed (NFD) reads as its composed twin.

Rules amended

Measured

The recipe is in decisions/P13; the base is 27298ec.

  • Grid: 14,362 of 237,888 parses move: 8,686 under the default order and 2,838 under each family-first order, every family-first move in a part before a comma. No move leaves a name without a given or family name it had.
  • Committed corpora: two rule examples move, Josep Lluis Carod i V and Smith i V, John.
  • Cached local corpora: of the 38,349 names holding a connective word, 5 move.
    • 4 PatentsView surnames whose accented letter the source lost to a space: Lecouv e, Boll e, Bjerk y, B e. Each now keeps the surname whole.
    • 1 garbage FEC record: OF CHIPPEWA OF ND.
  • Call cost: names with a connective that nothing joins pay 13–18 more Python calls (Mr. and Mrs. John Smith). That cost is constant per name and moves no benchmark guard. Names without a connective pay nothing.

Reviews

  • First round: the design-docs, code, test and comment reviewers.
  • Second round: a code review and a design-docs review of the fix commit, plus a focused review of the NFD and couple fix.
  • /simplify: reuse, simplification, efficiency and altitude.

Each finding was fixed or recorded in the commit that follows it. The test review's mutants each fail a row, save the ones recorded as unreachable.

Checks

These pass: uv run pytest, uv run pytest -n0 -m serial, uv run --python 3.15 pytest, uv run mypy and uv run ruff check.

🤖 Generated with Claude Code

derek73 and others added 5 commits November 5, 2026 16:54
…hing to link to the word before it (#1097, #1098)

P3 makes two joins ahead of its three-word carve-out, in the part
holding the family name: a single-letter connective in front of a lone
letter ending the name words joins it to the word before, the letter
being the second surname written as an initial (John Smith y V,
Juan Garcia y L., Puig i V, Joan, the Catalan i included); and a
connective with nothing but suffixes behind it joins the word before it
alone (John Smith y III -> family 'Smith y', suffix 'III'). The #1093
exception that kept the generational i in the family part's count goes
with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1098)

- P13, a connective ending the name words, beside P6: both joins move
  out of P3, which points at it; decisions/P13 holds the record.
- The end of the name is read under a given-first order only; the part
  before a family comma under every order.
- A connective is never the lone letter (one-case and caseless names);
  a trailing title H5 reads no longer stops the walk; the join with
  nothing to link reads any connective written as a word, a symbol
  left out; a cased single letter ending a one-case name keeps its
  reading (local corpora: each such name an initial).
- #1095's exception for a generational connective beside the numeral
  stays where P13 did not link the letter (Smith y i V, John).
- Rows for each finding; the trailing_start arm and the frozen-link
  control rehomed; the property-test exemption narrowed to a letter
  ending its role.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…title to P3 (#1098)

The second-round review found the rewrite had dropped the NFC fold, so a
decomposed initial or connective read as on master, and that the widened
join with nothing to link, past a trailing title, read couple formulas
('Mr. John Smith and Mrs.') as two titles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and notes (#1097, #1098)

- The couple-formula test reads the title standing right behind the
  word connective, not a title anywhere in the trailing run, so
  'John Smith and Jr. Mrs.' joins as before the narrowing.
- Case notes cite P13; history claims corrected (SMITH JONES Y JR.,
  JOHN from 2.4.0; Smith y VI, John since #893).
- P13: the one-case clause is on the Signal line as a case contrast;
  the lowercase and whole-name clauses say what the rule does.
- Release log limits scoped (family-first without a comma; particles
  for the two-word count); decisions/S10 Standing keeps the exception.
- decisions/P13's measurement re-run: committed corpora move two rule
  examples; local corpora over 38,349 names, the and/the/та/και added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, #1098)

/simplify: the nested name_word and connective defs become module
predicates, the lone-letter answer is read once, the couple test is
named, docstrings trimmed to the citation. The NFC fold is _vocab's
composed(), the per-token predicates keeping their inline fold (a call
per token moved the link-run frame band). Behavior unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added the bug label Nov 6, 2026
@derek73 derek73 self-assigned this Nov 6, 2026
@derek73 derek73 added this to the 3.0 milestone Nov 6, 2026
derek73 and others added 2 commits November 5, 2026 18:13
…-connective-before-numeral

# Conflicts:
#	tests/v2/test_cases.py
Codecov's patch check found _is_lone_letter's multi-word arm unreached;
'John Smith y Ph. D.' reaches it, the credential group merged before the
walk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 90a9a86 into master Nov 6, 2026
13 checks passed
@derek73
derek73 deleted the fix/issue-1097-1098-connective-before-numeral branch November 6, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should John Smith y V read family y? Should Puig i V, Joan keep the V in the family name, as Smith y V, John does?

1 participant