Skip to content

Peel a title written before a family comma into the title - #706

Merged
derek73 merged 8 commits into
masterfrom
fix/issue-701-titles-before-family-comma
Oct 18, 2026
Merged

derek73 merged 8 commits into
masterfrom
fix/issue-701-titles-before-family-comma

Conversation

@derek73

@derek73 derek73 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #701.

What changes

A run of listed title words opening the part before a family comma now goes to title instead of the family. Every release from 1.4.0 through 2.4.2 read it into the family (checked against the 1.4.0, 2.0.0, 2.3.0 and 2.4.2 wheels).

Input Before After
Dr. Smith, John family Dr. Smith title Dr., family Smith
Prof. Dr. Brühl, Ada family Prof. Dr. Brühl title Prof. Dr.
г-н Вернер, Иван Асен family г-н Вернер title г-н
Rev. Sr. Smith, Mary family Rev. Smith, suffix Sr. title Rev. Sr.
Xyz. Smith, John family Xyz. Smith unchanged (vocabulary only)
St Pierre, Ed, Freiherr von Berg, Ed family keeps the particle-title unchanged
MD PhD Jr., John family MD unchanged (H3's floor)

The run is defined in the new rule rules.md#H6:

  • Vocabulary only: H2's period shape does not fire in a surname's slot.
  • It stops at a word that is a particle too (St, Freiherr, bare or period-marked). That keeps C1's 1919 legal-surname reading.
  • It stops where nothing but post-nominals stands behind it (H3's floor).
  • It leaves the family its last piece.

Accepted cost: King Smith, John gives title King, as Greve Anna already does under H1.

Docs

  • rules.md: adds H6, rewrites the Accepted clauses of H1, H2 and H3 and C1's Freiherr clause, which stated the old reading, and qualifies the statements of C1, S2 and W3. The interacts: links run both ways.
  • decisions.md#H6 records the decision, the review finding, and the measurements.
  • Also updated: AGENTS.md (the gotcha, plus a sweep lesson about second-position duals), usage.rst (a fifth bound on the inference, with doctests), and a release-log bullet.

Measured (py3.11, against master eb2c1fa5)

  • Snapshot: 20 corpus entries move, all one shape (a title leaving the family). 18 of those names are held only by corpus_cldr.jsonl.
  • CLDR agreement: 29 fields now agree and 28 more get closer to CLDR's value, with none regressing.
  • After merging master (Add owura and bapak to TITLES (#662) #705 listed bapak): one more move of the same shape, Bapak Adinata, Dwi Putro bin MP → title Bapak.
  • Frames: the reference name 366 → 366, Smith, John 161 → 161 and Smith Jones, John 203 → 203: a part no title opens pays nothing. A titled part costs +1 (Dr. Smith, John 200 → 201). A /simplify round took out a re-ask of pieces past the floor, so a long post-nominal run costs +1 rather than one frame per member. No reading moved on an 88,740-head grid.

Review

A design-docs review found the first stop too broad: it asked "is the next word suffix vocabulary". A title/suffix dual second in a run blocked the peel and then read as a suffix inside the family (Rev. Sr. Smith, Mary), and so did Mc (Dr. Mc Donald, John). It found this by comparing T Smith, John with T John Smith over every title word. The stop is now H3's question instead. The same review found W3, C1 and S2 prose still calling the pre-comma part wholly family, and one-way interacts: links; both are fixed. A second round (code, test-coverage and comment reviewers) found no parse defects and led to the changes below. A focused review of those fix commits found one false claim about 1.4.0, now corrected.

  • gov added to TITLES (your call). Lt. Gov. Smith, John had split into title Lt., family Gov. Smith. The cost: 236 US Census surname bearers, so a surname written first loses it (Gov Sokha). Recorded in decisions.md#H6, with its own release bullet.
  • Dr. PhD Smith, John keeps family PhD Smith (your call). 1.4.0 and master read it family Dr. Smith, suffix PhD; the branch reads it as the untitled PhD Smith, John reads. No row, since it's garbage input.
  • H6's Accepted clause now names the particle stop as what keeps Freiherr, so Graf Lambsdorff, Otto reads title Graf. Whether the German ranks should all read as freiherr does goes to its own issue.
  • New rows: joined title units, Lt. Gov., Dr. King, a FAMILY_FIRST_GIVEN_LAST twin and bare Gov. These cover two mutants that had survived the whole suite.
  • Wording fixes in rules.md, AGENTS.md, usage.rst and the release log.

Full suite: 20526 passed. ruff and mypy are clean.

🤖 Generated with Claude Code

`Dr. Smith, John` read family 'Dr. Smith' in every release from 1.4.0
through 2.4.2. A run of listed title words opening the part before a
family comma now goes to `title` (rules.md#H6): vocabulary only, so
`Xyz. Smith, John` keeps its family; it stops at a word that is a
particle too (`St Pierre`, `Freiherr von Berg`) and where nothing but
post-nominals stands behind it (H3's floor: `MD PhD Jr., John`), and it
leaves the family its last word.

Amends H1, H2, H3 and C1's Accepted clauses, qualifies C1, S2 and W3,
adds decisions.md#H6 with the measurements, and re-records the
snapshot (20 corpus moves, all a title leaving the family) and the
CLDR agreement (29 fields now agree, 28 closer, none regress).

Closes #701

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added the bug label Oct 17, 2026
@derek73 derek73 self-assigned this Oct 17, 2026
derek73 and others added 2 commits October 17, 2026 14:12
…s-before-family-comma

# Conflicts:
#	docs/release_log.rst
#705 listed bapak, and the CLDR id rendering 'Bapak Adinata, Dwi
Putro bin MP' now peels it before the family comma.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.03%. Comparing base (f2bccf3) to head (49b1eb1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #706   +/-   ##
=======================================
  Coverage   99.03%   99.03%           
=======================================
  Files          46       46           
  Lines        4541     4552   +11     
=======================================
+ Hits         4497     4508   +11     
  Misses         44       44           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

derek73 and others added 5 commits October 17, 2026 14:42
- Add gov to TITLES (Derek): `Lt. Gov. Smith, John` split the
  compound across title and family, the run being vocabulary-only.
  236 US Census surname bearers; recorded in decisions.md#H6.
- Keep `Dr. PhD Smith, John` at family 'PhD Smith' (Derek), and say
  in the comment that the run's first leftover piece is family.
- H6's Accepted clause names the particle stop, not the 1919 surname
  argument, as what keeps Freiherr; Graf peels (example added).
- Wording: H6 "or" and "at least one word", H3 "one word", H1 "name
  word", W3's H6 sentence, AGENTS.md's stop description and its #701
  lesson as its own sentence, usage.rst's bullet, the release log.
- Rows: joined title units, Lt. Gov., Dr. King, a
  FAMILY_FIRST_GIVEN_LAST twin, bare Gov.
- Move the H6 block above the P2 comment it interrupted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The branch's family 'PhD Smith' matches 1.4.0 only for the untitled
'PhD Smith, John'; 1.4.0 gave the titled form family 'Dr. Smith',
suffix 'PhD' (the fix-commit review, checked against the wheel).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The /simplify review found the comment's 'H3's floor' invited swapping
in leading_titles, whose one-word give-back reads 'MD PhD Jr.' with
title 'MD'. Comment-only: frames and the snapshot are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An inline tag test ahead of is_title_piece leaves a family part no
title opens free of frames (Smith Jones, John back to master's 203),
and the family loop no longer re-asks a piece the floor walk already
proved a suffix (Dr. Smith + 20 PhD, John 924 -> 904). No reading
moved on an 88,740-head grid under two orders; the snapshot matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit e38830e into master Oct 18, 2026
12 checks passed
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.

Dr. Smith, John reads family Dr. Smith: a title before a family comma isn't peeled

1 participant