Repository navigation
Read a joined credential in brackets as its words written apart (#1088) - #1100
Merged
Merged
Conversation
…1088) rules/S1's set-apart word now asks `suffix_as_written`, the question a bare word is asked, so `John Smith (MD/PhD)`, `John (MD-PhD) Smith` and `Smith (MD/PhD), John` read suffix where they read nickname, as `(MD, PhD)` already did. A member of the ambiguous class written with a period inside it is asked first and answered "member", so rules/S13 keeps its position test; post_rules' two copies of that dotted test go, and the report on a member left the nickname leaves off a comma the clause keeps (`Jean (M.A,) Smith` reports suffix-or-nickname). Snapshot 0 of 6,939 moves; grid 447 of 1,260; local corpora: ctgov 3, FEC 1, PSC and ORCID none (decisions/S1, 2026-11-05). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) Parity, as decided: rules/S1's initials Except asks each chunk of a credential joined by a slash or a hyphen (`_vocab.reads_as_initials`), so `John (MD-PhD) Smith` and `Justin (JP/MD) Stearns` stay the nickname before a name word, as `(MD, PhD)` and `(JP, MD)` do, while `John (Jr/Sr) Smith` reads suffix as `(Jr, Sr)` does. A two-spelling guard holds the pair alike over 2,310 rows (540 apart with the chunk loop off). Review fixes: `_vocab.dotted_member` is S13's one dotted test, asked by the settling and the report, so a caller listing `m.a` as a title keeps the report; `SetApartKind` names the kind set; new case rows for every comma shape, a family-first order, the lost `(MD/PhD, MBA)` report, the kept-comma members and the period escape extract keeps for a dotted member; the guard pins S3's refusals apart from its oracle; caller-lexicon tests for the title-and-member paths. decisions/S1 re-counts the snapshot (6,945 entries, 6,736 distinct; 181 with a delimiter pair) with its recipe; corpus_rules.jsonl and snapshot.jsonl gain the nine new rule examples, no existing entry moving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the /simplify pass: `set_apart_kind` asks the suffix sets and the joiners inline ahead of `suffix_as_written`, the predicate's necessary half, so a nickname word pays no frame; the initials test is skipped for a clause after the last name word (a name word after it stands behind that word) and for a title word; `reads_as_initials`' one-level recursion is flat, `_shaped_as_initials` taking a member as the credential it is settled as; post_rules folds a member straight to the suffix. No reading moves (the 1,260-name grid and the snapshot are identical); `John Smith (Andy)` costs 214 frames as on master, the reference row 306.80. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nces (#1088) The second-round code review found the parity fix splitting a credential the vocabulary lists whole: `John (NP-C) Smith` and `John (SHRM-CP) Smith` read the nickname, CP and C taken for initials, where master reads the suffix. `reads_as_initials` now splits only a word S3 joins; the 70 listed words holding a joiner read as master does in four positions (560 names), and two case rows pin it. The second-round design-docs review: rules/S1 gains an Accepted bullet for the two classes where a joined word reads otherwise than its words written apart (a member S13 does not settle, a title-too word at either title site) and the listed-whole qualifier with an `NP-C` boundary; decisions/S1 corrects the period-final move (a nickname no release read), the `(MD/PhD, MBA)` comparison (master reported it, 2.8.2 did not) and writes the grid's exact templates. The snapshot gains the five new examples; no existing entry moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ket-joined-credential # Conflicts: # tests/v2/test_cases.py
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.
Closes #1088.
A credential joined by a slash or a hyphen now reads, inside brackets or quotes, as its words written apart with a comma do. Before this change,
John Smith (MD, PhD)read suffixMD, PhD, butJohn Smith (MD/PhD)read nicknameMD/PhD, even though rules/S3 reads the bareJohn Smith MD/PhDas the suffix.John Smith (MD/PhD)MD/PhDMD/PhDMD, PhDSmith (MD/PhD), JohnJohn Smith (Jr/Sr)John (MD-PhD) SmithJustin (JP/MD) StearnsJohn (NP-C) SmithJohn Smith (MD/Bob)Jean (M.A,) Smithsuffix-or-nicknameJean (M.A) SmithRule changes
suffix_as_written, the question a bare word is asked, so a joined credential S3 reads is a word of such a clause.NP-C,SHRM-CP) is one word and is never split.(M.A./PhD)suffix vs(M.A., PhD)nickname), and a word that is a title too ((PhD/Sr) John Smithsuffix vs(PhD, Sr) John SmithtitleSr)._vocab.dotted_member. Before, post_rules held two hand copies.What it moves
All measured 2026-11-05 against master 4109b02, each tree's
nameparser.__file__asserted.John (M.D./Ph.D.) Smithread middle in 1.4.0 through 2.8);snapshot.py --local <source> --base <4109b026>):Franck Pages, Professor (MD-PHD)and two like it, now suffix where they read nickname.FRANTZ (CAPT USN-RET), JOSEPHnow reads titleCAPT, suffixUSN-RET.John Smith (MD/PhD, MBA)now reads suffix with no report. Master reportedsuffix-or-nicknamethere, becausembawas marked ambiguous on 2026-11-03; 2.8.2 did not.Frames
The reference row is unchanged at 306.80 calls/parse on py3.11, so
_CALL_BASELINEdoes not move and #1089 can lower it from the same figure. On the clause shapes, master → this PR:John Smith (Andy)Smith, John (MA)John Smith (PhD, MBA)Jean (M.A) SmithJohn Smith (MD/PhD)Tests
tests/v2/cases.py:tests/v2/pipeline/test_post_rules.py, each with a recorded negative control:Smith y V, Johnkeep the V in the family name, asSmith Jones y V, Johndoes? #1093 and this PR each added nine claims),test_layering's_UNGUARDED_READS(128 → 123 → 128 across the commits, net unchanged) andrules_budget.json(S1 and S13 grow; each new clause reads a signal its rule already reads, S3's joined chunks or N1's comma).Merged with master at 510d1aa (#1093, #1094, #1096, #1099). On the merged tree, corpus_rules.jsonl rebuilds byte-identical, the snapshot matches, rules_budget.json re-records unchanged, and both negative controls re-take at their recorded values (540 of 2,310 rows; 7 words).
Checks run:
uv run pytest,uv run pytest -n0 -m serial,uv run mypy,uv run ruff check, and py3.15 (uv run --python 3.15 pytest -q, in an environment of its own). All pass.Reviews
Each ran as a subagent on the diff; every finding was fixed or is listed here.
m.aas a title lost the S13 report. Fixed withdotted_member, plus a test."member"kind is the right shape, and mypy enforces that it never reachesset_apart. Took its optionalSetApartKindalias.NP-C,SHRM-CP), the "widened check narrows" shape. Fixed; a sweep of all 70 listed words with a joiner (560 names) matches master.CP-C,MT-BC,NP-CandSHRM-CPbefore a name word, back to master's suffix; every rule example and decisions claim checked against master, 2.8.2 and 1.4.0. It noted, out of scope: a joined word holding a listed hyphenated credential (PhD/NP-C) is refused by S3 bare, as on master.Known gaps, left out
John Smith (Msc.Ed)) still reads as a nickname, though bare it reads suffix. It goes through a different predicate (S3's any-chunk period test). An issue is drafted; the decisions entry's pointer gets its number once it is filed.John (M.A/PhD) Smithreports nosuffix-or-nickname, whereJohn (M.A, PhD) Smithdoes. This predates the change.🤖 Generated with Claude Code