Repository navigation
Count a credential word opening a comma name as a name word (rules/C3) - #1017
Merged
Merged
Conversation
…(rules/C3)
Both counts of the part before a comma passed over a listed suffix
word wherever it stood, so a two-word name that a credential word
opens read as the listing form's one-word surname: 'JP Clancy, MD'
read family 'JP Clancy' (2.4.0 through 2.8.0), as did initials that
spell a credential ('A.M.'), given names a credential spells ('Cem')
and the given name 'Md'. The word opening the part is in the given
name's place, so it counts as the given name it reads as with no
comma; behind titles in the ambiguous class's count, and never a
split credential's member (rules/S12).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The code review found the two counts disagreeing where a title follows
the opening word ('Md Prof., PhD' moved in `_whole_name` but not in
`name_word_count`); a title behind it is no name word now in both. The
design-docs review found the decisions entry's release history spot-
checked on one shape (now measured over all 89 moves against the
wheels), the Declined figures unreproducible (recomputed), the rule's
wording true under the default order only, a fence row that did not
witness the change, the grid figures without a recipe (replaced by
test_a_head_before_a_credential_reads_as_it_does_alone, with its
negative control), and nameparser/AGENTS.md misstating Md's history.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codecov/patch found the two `members.add` lines unreached: no test put a split credential's member at the head of a part whose count is the ambiguous class's or the one-letter numeral's. 'MB ChB, Ing' fails with the member counted (suffix 'Ing'); the numeral's path ends at a later check either way, so `_members` and `name_word_count`'s parameter are tested directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
rules/C3 (counting the words before the comma) passed over a listed suffix word wherever it stood. So a two-word name whose first word is also a credential read as the listing form's one-word surname, and lost its given name:
JP Clancy, MDJP ClancyJP, familyClancyA.M. Barrett, MDA.M. BarrettA.M., familyBarrettCem Akin, M.D., Ph.D.Cem AkinCem, familyAkinMd Rahman, PhDMd RahmanMd, familyRahmanDr. Md Rahman, IngIng, familyMd RahmanMd, suffixIngCem Gabay, Prof.Prof., familyCem GabayCem, familyGabayWith no comma, position decides what a word opening a name is (rules/S2):
Md Rahmangives givenMd, andPhD Smithgives givenPhD. The comma count was the one place that asked the vocabulary there. The fix: a suffix word opening the part is a name word to the count where a name word follows it, so the part reads as it does alone, under every order. Both counts change:_comma._whole_name, the unambiguous credential's count;_vocab.name_word_count, the ambiguous class's count of names (C4), where the opening word is the first one behind any titles.Edges:
Sr. van der Berg, PhDreads asDr. van der Berg, PhDdoes.Md Prof., PhDkeeps familyMd Prof..MB ChB, PhDkeeps Phase 2: derive ambiguity from clashing readings and extend the gate to every reading kind #752's reading.Smith Jr., PhD→ familySmith.Md, PhD→ familyMd.Found by running the spec of hoenth/name_splitter, a Ruby gem, through
parse(). ItsSame Barker, Ph.D.read familySame Barker, becausesameis a listed credential.Measured (2026-11-02, against origin/master c1ceb3b)
Local corpora. Every entry holding a comma across the 13 local corpora: 2,216,662 entries, default policy, seven fields plus ambiguity kinds compared.
Md.heads that H2 now reads as a title, and one entry holding two names. FEC's 3 moves are organizations.Against the releases, over all 89 new readings:
JP Clancy, MDandCem Akin, MDgave givenJPandCemin 1.4.0 through 2.3.0.Cem Gabay, Prof.). That accounts for 17 of the 29 entries 2.3.0 read differently.Md Rahman, PhDnever had a given name in any release.Committed corpora. No existing entry moves.
snapshot.jsonlandcorpus_rules.jsonlonly gain the 12 new rule examples, and the CLDR and GND agreement records are unchanged.Invariant. The new
test_a_head_before_a_credential_reads_as_it_does_alonecovers 19 opening words × 6 bodies × 6 credential parts × 3 orders = 2,052 rows. Each row, suffix aside, must read as its head alone. All 2,052 hold; 1,062 fail on master (the recorded negative control).Frame cost (
sys.setprofilecall events): unchanged onSmith, John,John Smith, PhD,John Smith, MA,JOHN SMITH, MDandJane Doe, MD, FACS. Only the heads that now move cost more, since they take the whole-name path.Declined: giving
mda name readingGiving
mdan abbreviated-given-name reading (same_as="muhammad") would fix theMdheads by vocabulary, but it makesmdpart of the ambiguous credential class:MDopens with more words behind it:Amie Cullimore, MD BSc BEd→ givenMD. Another 60 are names in capitals.ABELIN MD, GRACIELA→ familyABELIN MD.Md.:same_aswould also undo Should a title word written after another title be the given name (Mr Sultan Khan,Mr Md Karim Uddin)? #853's 2026-10-27 decision thatMd.stays a title.The count fix reaches the
Mdheads without any of that, and also reaches the initials andCem.Not decided here: a
Mdinside a name starts a suffix (Badrul Akmal Hisham Md Yusoff→ suffixMd Yusoff). That's a separate gap.Review
A code review and a design-docs review ran on the first commit.
Md's history;#PRNUMplaceholders, filled in after this PR was opened.frontleaves out. That's pre-existing, and no input changes because of it.Docs
Tests
🤖 Generated with Claude Code