Skip to content

Read a word with interior periods as a credential only where every chunk counts (#1131) - #1144

Merged
derek73 merged 3 commits into
masterfrom
fix/issue-1131-every-chunk
Nov 8, 2026
Merged

derek73 merged 3 commits into
masterfrom
fix/issue-1131-every-chunk

Conversation

@derek73

@derek73 derek73 commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Closes #1131

A word with interior periods read as a suffix where ANY of its chunks was suffix vocabulary (v1's rule for Lt.Gov.), while brackets (rules/S1) and the end of a name without a final period (rules/H5) read it more strictly, so the slots disagreed. Every chunk now counts, the test the slash and hyphen joins already ask (#1103, #1138).

Input master, 1.4.0 through 2.8.2 This PR
John Smith (Msc.Ed) nickname suffix Msc.Ed
John Smith (PhD, Msc.Ed) nickname suffix
John (Msc.Ed) Smith nickname nickname, now reported, as John (MA/PhD) Smith is
John Smith Lt.Gov family Lt.Gov title Lt.Gov
John Smith Bob.PhD suffix suffix, now reported suffix-or-name
Whinnett, BM.BS suffix (2.6.0 through 2.8.2; given through 2.5.0) given, reported
John Smith Msc.Ed, JD.CPA, Lt.Gov., J.씨, MD.&PhD unchanged
John Smith Dr.PhD, St.John Smith, Dr.philol. …, Lt.Gen. … unchanged

The rule

  • rules/S3 (credentials written in joined chunks): a word with interior periods reads as a suffix when every chunk counts as a suffix as written, a member of the ambiguous class another chunk settles included (_vocab.period_joined_credential, sharing the joined reading's _member and _settles). Punctuation beside an interior period is no part of a chunk (MD.&PhD); at the word's outer edges only its periods, a glued semicolon and an ampersand are, so Msc.Ed! reads as the name word MD! and MD/PhD] already are. A word the test refuses is read by position, as the shape is.
  • rules/S1 (a bracketed credential is not a nickname): the same test sets a period-joined word apart, its initials test asks the word's chunks as it asks a slash's (Justin (JP.MD) Stearns stays the nickname), and one holding a member is a member, settled by rules/S13's position.
  • rules/H5 (the trailing title run): a word every chunk of which is a title chains without a final period. The title verdict in front of a name stays any-chunk: asking every chunk there read Dr.philol., Lt.Gen., Dipl.-Kfm., st.repr. and Dut.ra Prof.ra as given names (declined, decisions/S3).
  • History in decisions/S3's and decisions/H5's 2026-11-07 Should a word that is a title or credential only by one of its chunks count as one in brackets and at the end of a name: (Msc.Ed), John Smith Lt.Gov? #1131 entries.

Vocabulary

  • listed: mch (Master of Surgery, mask MCh) and bscmed. 92 ctgov-officials names written with MCh move, those that read reversed with MCh the given name (Abdul R Bhat, MCh) now reading it as the suffix.
  • refused, each with its reason on the word: med (its mask would write Dr. MEd. into the German Dr. med.), chb and bch (listed alone they stop rules/S12's MB ChB merging).

Accepted

  • A dotted degree whose chunks are not listed (M.B., Ch.B., M.Ed., B.Ch) loses the chunk reading. Where it was already the suffix only the forced case view moves (M.Ed. → M.ED. under capitalized(force=True)), and after a family comma alone it is the given name, reported.
  • A credential glued to a digit by a period (John Smith MD.3) is a name word, silently, as John Smith 1.4 is.

Measured (2026-11-07, against f86963a, snapshot.py --local <source> --base <checkout>)

  • snapshot.jsonl: only the new rule examples and John Smith Lt.Gov.
  • ctgov-officials: 264 of 536,981: 162 in the forced case view alone, 92 the MCh names, the rest the rule's own moves (Reva PROF.DR → title, e-mail addresses glued into a name no longer the suffix, Sutriyo M.Si, Dr → family, reported).
  • nepal-candidates: 5, the Nepali surname जी.सी (G.C.) no longer a suffix in three.
  • fec-individuals: 9; tse-donors: 1.
  • Unchanged: govuk-people, ukec-individuals, dof-signatures, jrc-names; psc-individuals, orcid-researchers and cz-candidates agreement; CLDR, GND and the Wikidata views.

Review

Three rounds: a code review and a design-docs review of the first commit, then a review of the fix commit, which found that the first fix's edge strip read Msc.Ed.] and Msc.Ed] differently and Justin (J.씨) Stearns as the suffix; both fixed in the third commit. Suite passes on 3.11 and 3.15, serial tests included.

🤖 Generated with Claude Code

derek73 and others added 3 commits November 7, 2026 17:33
…unk counts (#1131)

A word with interior periods was a suffix where ANY chunk was suffix
vocabulary, while brackets (rules/S1) and the period-less end of a name
(rules/H5) read it more strictly, so the slots disagreed. Every chunk
now counts, as the slash and hyphen joins already ask: a chunk counts
as a suffix as written or is a member another chunk settles. A word the
test refuses is read by position, as the shape is.

- rules/S3: the every-chunk test (`period_joined_credential`); ASCII
  punctuation at a chunk's edge is no part of it; a glued honorific
  keeps its claim (J.씨); a suffix word that is also a name keeps none.
- rules/S1: the same test sets a period-joined word apart in brackets,
  and one holding a member is a member, settled by S13's position.
- rules/H5: a word every chunk of which is a title chains without a
  final period (John Smith Lt.Gov -> title). The title verdict in front
  of a name stays any-chunk (Dr.philol., Lt.Gen.).
- en.toml: mch and bscmed listed; med, chb and bch refused with reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks once (#1131 review)

- reads_as_initials asks the chunks of a word the periods join, as it
  asks a slash's: Justin (JP.MD) Stearns stays the nickname.
- _period_chunks strips punctuation only beside a period, keeping the
  word's outer edges (John Smith [Msc.Ed] stays family), and the member
  test reads the same chunks.
- Docs: the Lt.Gov limit moves into the trailing-title release bullet;
  rules/N3's Accepted, rules/S1's initials Except, decisions/H5's and
  decisions/S3's Standing lines, period_joined_vocab's docstring and a
  case note describe every chunk; the MD.3 move is recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…second review)

The first fix kept a word's outer punctuation only before its final
period, so John Smith Msc.Ed.] read suffix and Msc.Ed] a name word.
The outer edges now admit only the word's periods, a glued semicolon
(rules/C10) and an ampersand joining the next credential, so
Msc.Ed!, MD.PhD] and [Msc.Ed.] read as the name word MD! and MD/PhD]
already are. A single letter before a glued honorific is the initial in
S1's initials test, so Justin (J.씨) Stearns stays the nickname.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added bug design vocabulary Per-word vocabulary model and language packs labels Nov 8, 2026
@derek73 derek73 self-assigned this Nov 8, 2026
@derek73
derek73 merged commit e793b1b into master Nov 8, 2026
13 checks passed
@derek73
derek73 deleted the fix/issue-1131-every-chunk branch November 8, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug design vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should a word that is a title or credential only by one of its chunks count as one in brackets and at the end of a name: (Msc.Ed), John Smith Lt.Gov?

1 participant