Repository navigation
Read credentials joined by a hyphen or a slash (#752, phases 2c and 2d) - #887
Merged
Merged
Conversation
…unk is listed (#752) Phase 2c. rules/S3 (credentials written in joined chunks, renamed from "credentials written with interior periods") extends its chunk reading to '-' and '/', with a stricter test than the periods' any: every chunk counts as a suffix as written, so a bare member of the ambiguous class ('MA/PhD') and a hyphenated name ('Smith-Jones') are left as they were. The test lives in suffix_as_written, so classify's tag, the comma's decision and every predicate that tests a word's text read a joined word alike. 'John Smith, MD/PhD' reads suffix 'MD/PhD' where 1.4.0 through 2.6.0 read given 'MD/PhD', family 'John Smith'. Measured against 2af8da8: ctgov-officials 1,333 entries, fec-individuals 1, tse-donors, psc-individuals, the committed corpora and the agreement records none (decisions/S3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#752) Phase 2d, #797's half A. An unlisted word of capitals whose letter chunks are joined by '-' or '/', one of two or more letters, is the caps shape (rules/S9): 'John Smith, PU-PH' reads suffix 'PU-PH', reported, where 1.4.0 through 2.6.0 read given 'PU-PH', family 'John Smith'. It joins the class where and as the unjoined word does, so C4's count and C6's case contrast gate it after a comma by default ('JOHN SMITH, PU-PH' and 'Smith, PU-PH' keep the given name), and EVERYWHERE takes it at every suffix position. The three call sites' C-level pre-filters (the comma's candidates, C12's case-repair marks, classify under EVERYWHERE) asked isalpha() ahead of the predicate and widen with it; without that nothing moves (mechanisms.md's field notes). Measured against the 2c commit: ctgov-officials 529 entries; fec, tse, psc-individuals, the committed corpora and the agreement records none (decisions/S9). A capitals word between MD and the comma is taken into the suffix as the comma-less name already reads it (rules/S8's run), recorded there rather than changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e Korean cost (#752) Review of phases 2c and 2d. A joined word whose every chunk is a single ASCII character ('Jack I-V') read as a suffix with no family; rules/S3's exception binds it now, as it binds 'Jack X.Y.I.'. S3's Then states the joined reading, and its bullet names what joins nothing (other dashes, 'MD/Ph. D.'). Accepted: a Korean given name hyphenated between two listed credentials ('Kim, Ae-Ra') reads as the credential, as the spaced spelling already did on the base (decisions/S3). The release bullet names C4's two name words. ctgov-officials still moves 1,862 entries over both phases, fec 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second review of the fix: 'Jack I.-V.' still read suffix with no family, the length test counting the chunk's period where a word split at its periods never does. AGENTS.md's spelling sweep records the miss. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ned-credentials-a4d3c9
Codecov's patch check found it uncovered: suffix_as_written calls _joined_credential only for a word holding a joiner, so the split always gives two chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derek's decision on the Korean given names the code review found. A
word joined by a hyphen whose first chunk is in Title case and whose
other chunks are in Title case or lower case is a name word, whatever
its chunks are listed as: 'Kim, Ae-Ra' and 'Shin Ae-ra' keep their
1.4.0 readings. A chunk with an inner capital ('PhD-Md'), capitals
('MD-PhD'), a lower-case opening ('md-phd') and a slash keep the
joined reading. Accepted in its place: 'KIM, AE-RA' reads suffix.
No local corpus holds a Title-case joined credential, so phase 2c's
1,333 ctgov moves all stand (decisions/S3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…752) Review of the cue: a word holding a slash took it ('Kim, Ae-Ra/Md'), which the rule says a slash does not; a one-letter lower-case tail ('Md-v') did not, which the rule says it does. S3 now says a word with an interior period is read by its periods first, and records a credential typed in Title case throughout ('Phd-Md') as the cue's cost; no local corpus writes one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ned-credentials-a4d3c9 # Conflicts: # docs/design/decisions/vocabulary-model.md # docs/release_log.rst # tests/v2/rules_budget.json # tests/v2/test_cases.py # tools/differential/corpus_rules.jsonl
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.
Phase 2c and 2d of #752, one commit each: the first two Phase 2 changes that move readings. Both carry out item 5 of decisions/vocabulary-model's 2026-10-23 #752 entry, which Derek agreed on 2026-10-23.
2c: a credential joined by a hyphen or a slash, every chunk listed
S3 (credentials written in joined chunks; the rule was "credentials written with interior periods" and is renamed for its wider When) already reads a word with interior periods by its chunks. It now reads chunks joined by
-or/too, with a stricter test: the periods need any chunk to be listed, but a joined word needs every chunk to count as a suffix as written, which a bare member of the ambiguous class (MA,Ed) does not. The reason is that a hyphen also joins names (Smith-Jones).The test lives in
suffix_as_written. That way classify's tag, the comma's decision and every predicate that tests a word's text all read a joined word the same way.John Smith, MD/PhDMD/PhD, familyJohn SmithJohn, familySmith, suffixMD/PhDJohn Smith MD-PhDSmith, familyMD-PhDSmith, suffixMD-PhDJohn Smith, M.D./Ph.D.M.D./Ph.D.John Smith-Jones·John Smith MD-Jones·John Smith, MA/PhD·Jack I-V·Kim, Ae-RaS3's single-character exception covers a joined word too, so a word made only of single-character chunks (
I-V) is not a credential.A hyphenated word written as a name stays a name word (Derek's call). A hyphen-joined word stays a name word when its first chunk is in Title case and every other chunk is in Title case or lower case. That holds even when every chunk is a listed credential. The case that needed it:
aeandraare listed as unambiguous credentials, so without the cueKim, Ae-Ralost its given name.Kim, Ae-RaandShin Ae-rakeep their 1.4.0 readings. Revised Romanization writes the second syllable in lower case, which is why the cue also accepts lower-case later chunks.PhD-Md,MD-PhD,md-phdand slash joins keep the joined reading. A slash joins no names.KIM, AE-RAstill reads suffixAE-RA. A credential typed in Title case throughout (John Smith, Phd-Md) now reads as a name word, because the writing is the cue; none of the 34 distinct hyphen-joined credentials in the local corpora is written that way.Kim, Ae Raalready lost its given name on master; that is theae/ravocabulary question and is left as it was.2d: an unlisted word of joined capitals after a comma (#797's half A)
An unlisted word of capitals whose letter chunks are joined by
-or/, with one chunk of two or more letters, is now S9's caps shape. It joins the ambiguous class exactly where and as the unjoined word does: after a comma, gated by C4's name-word count and C6's case contrast.John Smith, PU-PHPU-PH, familyJohn SmithSmith, suffixPU-PH, reportedJOHN SMITH, PU-PH·Smith, PU-PH·John Smith, A-B·John Smith, Pu-PhReachability. All three call sites of
caps_shape_candidate(the comma's candidate list, C12's case-repair marks, and classify underEVERYWHERE) askisalpha()in C before calling it. The joined spelling fails that test, so each pre-filter widens with the predicate. This trap is now a field note in mechanisms.md.Under
CapsSuffixes.EVERYWHEREthe joined word reads as the unjoined one does in every slot (Jean Pierre DUPONT-MORETTIasJean Pierre DUPONT), which is that setting's documented cost. Limiting it to the comma would have made one shape into two by position, so I didn't.The oddity the spike found. In
Jean Claude MD DUPONT, PU-PH, the capitals word betweenMDand the comma goes into the suffix. That is not 2d's doing.Jean Claude MD DUPONTwith no comma already reads suffixMD DUPONT(S8's run, reported). 2d makes the comma a suffix comma, and the part before it then reads as the comma-less name does (C1). TheXYZandPhDtwins read the same way. One ctgov entry takes this shape. I recorded it in decisions/S9 as S8's question and changed nothing.Measured
Each commit was measured against its parent, with the local snapshots recorded from the parent using
--tree.snapshot.py)local_agreement.py)2c in ctgov:
MD-PhD494,MD/PhD473,PhD/MD65,MS-PT53.M.D./Ph.D.). The spike's letters-only test did not read those, which is why its count was 1,254.2d in ctgov:
capitalized(force=True).PU-PH258,MS-OMPT32,MCU-PH30. None is a name.Re-measured after merging #886 (phase 2f) against master 1f0b07c, with each baseline recorded right before its check. ctgov still moves 1,862 entries, every one holding a joiner; fec moves 1; tse and psc-individuals move none. Names with both a numeral and a joined credential (
John Smith VI MD/PhD,John Smith V, MD-PhD,Smith, John VI, PU-PH,Smith, John V MD/PhD) read as their spaced orXYZtwins.Sweeps: a grid of four comma shapes (including an empty head and a nickname-only head) × three orders × joiner spellings (glued, spaced, glued to one side) × hyphenated surnames before and after the comma, compared base against tree. Every 2d move in that grid reads the same as its unjoined
XYZtwin under all three orders.Frame cost: a word with no joiner pays nothing (
John Smith150,Smith, John158, unchanged). A hyphenated word pays 3 frames at each site that asks for its suffix reading (Mary Smith-Jones156 → 159). A joined capitals word pays what an unjoined capitals word already pays.Docs in this PR
John Smith, MA/PhD) and a Precedence bullet (in capitals, S9 reads the word). rules/S9 gets the joined spelling, and rules/C6 gets examples.Leads, not done: 63 ctgov entries join two listed credentials with
&.MD/ PhD, with the joiner glued to one side, keepsMD/as a name word (10 entries).Refs #752. Refs #797, but does not close it: this answers its half A only.
🤖 Generated with Claude Code