Skip to content

C12: read a joined title in the part after the comma as a title - #738

Merged
derek73 merged 2 commits into
masterfrom
fix/c12-title-test
Oct 19, 2026
Merged

derek73 merged 2 commits into
masterfrom
fix/c12-title-test

Conversation

@derek73

@derek73 derek73 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #735's altitude review.

C12 (a suffix word ending the name before the comma) decided which words in the part after the comma are titles with a hand copy of C8's test (the suffix-comma credential run) that asked only a one-word piece's vocab:title tag. A title joined by P3 (the connective join) carries the piece tag title instead, so it fell to the suffix side:

Input Before After
John Smith Jr., Mr. and Mrs. AD suffix Jr., Mr. and Mrs. AD title Mr. and Mrs., suffix Jr., AD
Dr. Smith Jr., Secretary of State AD title Dr., suffix Jr., Secretary of State AD title Dr. Secretary of State, suffix Jr., AD

Already reading title Mr. and Mrs. before this change: John Smith, PhD Mr. and Mrs. AD (C8) and John Smith Jr., Mr. and Mrs. (no credential). _behind_a_generation now asks C8's predicates in C8's order, not is_suffix_piece then is_title_piece. Those agree with the old copy on every one-word piece, so a title and suffix dual still reads as a suffix, as C12 states.

A dual inside a joined title now reads as part of the title (John Smith Jr., AD Sr. and Mr. → title Sr. and Mr.), as C8 reads it (John Smith, PhD Sr. and Mr.). A dual standing alone still reads as a suffix (John Smith Jr., Sr. AD → suffix Jr., Sr. AD).

Measured (2026-10-19) against the parent a454917, extracted with git archive and __file__ asserted on both sides. The grid: 8 names ending in a suffix word × 32 parts × the three orders = 768 parses. The full grid is listed in decisions/C12.

  • 192 readings move: exactly the eight parts where a joined title stands beside an unlisted credential, under every name and order. Each moves from suffix to title. The eight parts are Mr. and Mrs. AD, AD Mr. and Mrs., Mr. & Mrs. AD, Dame and Sir AD, Secretary of State AD, AD Sr. and Mr., Mr. and MD AD and Dr. and Ms AD.
  • Already titles, unchanged: a joined title beside a listed credential (Prof. and Dr. MD) or with no credential (Secretary of State) already read as a title, because C12 isn't reached.
  • No ambiguity kind or initials() changes. No corpus name moves; the snapshot only gains C12's new examples.

Not touched: John Smith Jr., Lt. Gov. AD still reads title Gov., suffix Jr., Lt. AD. Lt is a dual, and C12 reads duals as suffixes.

Changes:

  • nameparser/_pipeline/_comma.py: the swap, with pt1 passed into the helper
  • rules/C12: the statement names joined titles (P3, C7), including a dual inside one, adds Mr. and Mrs. and Sr. and Mr. examples, and lists P3 and C7 under interacts; C7 lists C12 back
  • decisions/C12: a dated entry with the measurement
  • AGENTS.md: the spellings paragraph records a joined title as a third spelling path for a title, and says to ask both of C8's predicates in order
  • corpus_rules.jsonl and snapshot.jsonl regenerated

Suite: 21,589 passed; mypy and ruff clean.

🤖 Generated with Claude Code

C12 (a suffix word ending the name before the comma) decided which
words in the part after the comma are titles with a hand copy of C8's
test that asked only a one-word piece's vocabulary tag, so a title P3
joins fell to the suffix side: 'John Smith Jr., Mr. and Mrs. AD' read
suffix 'Jr., Mr. and Mrs. AD', where C8 and the credential-free
'John Smith Jr., Mr. and Mrs.' both read title 'Mr. and Mrs.'.
`_behind_a_generation` now asks `not is_suffix_piece` then
`is_title_piece`, as C8's opened-run branch does.

Measured over 8 suffix-word names x 29 parts x 3 orders: 120 of 696
readings move, all five joined-title parts, each from suffix to title;
duals and single titles unchanged, no ambiguity or initials move, no
corpus name moves. The snapshot gains only the new C12 example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 self-assigned this Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.05%. Comparing base (a454917) to head (d4e9ca5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #738   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files          46       46           
  Lines        4647     4647           
=======================================
  Hits         4603     4603           
  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.

- rules/C12: a dual inside a joined title reads as part of the title,
  as C8 reads it; the title join is C7's, so name it and add C7 to
  interacts (C7 names C12 back); example 'AD Sr. and Mr.'
- decisions/C12: name the comparator and list the grid; re-measured
  with three dual-holding joined titles added: 192 of 768 move, the
  eight joined-title parts beside an unlisted credential
- AGENTS.md: the lesson asks both of C8's predicates in order, since
  is_title_piece alone reads MD and Sr. as titles
- _comma.py: docstring and the `taken` comment cover joined titles

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 2.5 milestone Oct 19, 2026
@derek73
derek73 merged commit 550720c into master Oct 19, 2026
12 checks passed
derek73 added a commit that referenced this pull request Oct 19, 2026
* Ask is_title_piece in C5's speaker scan and pair_only

Both hand-copied the one-word `vocab:title` test that PR #738 found
reading a joined title ('Mr. and Mrs.') as a credential in C12. Here
the swap moves no reading: 0 of 3,465 measured parses (readings,
ambiguity details, initials) move. The speaker test never disagrees
with the copy on the grid, since a joined title holding a suffix fails
C4's every-word test first; pair_only disagrees on 6 inputs, all behind
a generation, where C12's report is chosen first. The swap is for
drift. Recorded in decisions/C5.

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

* Address review: the shared reason, a configured move, C11's pointer

- decisions/C5: both sites sit behind C4's run, which a joined title's
  free connective fails, so the default vocabulary cannot move; the
  G.J. A.B. clause corrected
- decisions/C5: a configured connective split into suffix words by a
  configured delimiter passes the run, and there two readings move
  (found by the code review); accepted
- decisions/C11: pointer for pair_only, the report's exception

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 deleted the fix/c12-title-test branch October 19, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant