Skip to content

Add generation and credentials views over suffix (3.0, 4b) - #947

Merged
derek73 merged 7 commits into
masterfrom
claude/feat-4b-suffix-views-d134c9
Oct 30, 2026
Merged

derek73 merged 7 commits into
masterfrom
claude/feat-4b-suffix-views-d134c9

Conversation

@derek73

@derek73 derek73 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

3.0 sub-phase 4b of #754: the generation and credentials views over the suffix role (#326). The seven roles stay the same and no role field of any parse moves.

What changes

  • ParsedName.generation / ParsedName.credentials split suffix into two parts by the Token.reading each word took. A generation or agnomen goes in generation; everything else goes in credentials: credentials, the honorifics, Esq. (CLDR's catch-all). For example, parse("Smith, John, Jr., MD, Esq.") gives 'Jr.' and 'MD, Esq.', and suffix is unchanged.
    • Each view keeps the suffix's separators: a comma where the suffix holds one between two of its words, otherwise a space. So MD Jr. PhD gives credentials 'MD PhD'.
    • A connective goes with the word before it.
    • The views are computed when read, from the tokens, so a parse that doesn't read them pays nothing for them.
    • Like family_base, they are render() keys and rule-example fields. They are not in as_dict(), --json or the repr.
    • Empty path: parse("John Smith") gives '' for both.
  • Closes 4a's Jr/Sr seam. Classify looks up a listed suffix word's kind in the reading index (new _reading_index.suffix_kind_of, memoized), using the same key it reads the word's other tags by. That key has any glued delimiter removed (Jr.;, rules/C10). Classify records the kind as an internal tag, vocab:generation-word or vocab:credential-word. _vocab.suffix_kind reads the tag, so Token.reading and Ambiguity.alternative still go through one function. Assemble strips the tag from published tokens, so a 2.x pickle still equals a fresh parse.
    • Jr/Sr now read generation.
    • The four credentials written as a word (博士…) read credential.
    • Courtesy, honorific and status words stay post-nominal.
    • The two strict xfails are now passing tests.
    • One test walks all 826 suffix-set words and checks that the reading taken, the alternative and the index kind agree.
    • User-visible: a lone Jr's Ambiguity.alternative names a generation where 2.7.0 and 2.8.0 named a post-nominal. The release-log bullet says so.
  • _vocab may now import _reading_index (layering table and AGENTS.md updated).

Docs (same-PR amendment)

New rules/R8 (the generation and credentials views) and decisions/R8, which records what the implementation decided and the measurements with their recipes. Also updated: the S background, R1's separator bullet, an in-part supersession marker in A1, decisions/suffix-field-composition, the vocabulary-model log, the RFC's Phase 4 status and table, usage.rst, and the release_log Unreleased bullet.

Measured (2026-10-29, recipes in decisions/R8)

  • Snapshot: 6,570 readings; 1,077 have a suffix, 488 of them a generation, and 142 have both a generation and credentials.
  • CLDR: 576 distinct (text, order) renderings carry generation/credentials. Of the 65 whose parsed suffix holds exactly CLDR's words, all 65 split into CLDR's two fields.
  • Snapshot moves: re-recorded after reading every move. Beyond the new keys and R8's example rows, only the views of Smith, Ph. D. Jr. MD (separator) and John Smith, V; MD (glued delimiter) changed. No role, ambiguity or alternative moved.

Checks

  • uv run pytest and uv run pytest -n0 -m serial pass; the frames band is unchanged.
  • The suite also passes on Python 3.15.
  • mypy, ruff and the sphinx doctest build pass.
  • Patch coverage is 100% locally.
  • The design-docs reviewer ran on the change and on each fix commit. Every finding was fixed, or recorded as an R8 Accepted cost: before the first comma, C10 treats a glued ; as part of the word, so John Smith Jr.; MD stays all credentials.

🤖 Generated with Claude Code

derek73 and others added 3 commits October 29, 2026 17:34
…kind (3.0, 4b)

A listed suffix word's kind is read from the reading index, so Jr and Sr
read as a generation in Token.reading and Ambiguity.alternative alike
through _vocab.suffix_kind. rules/R8, decisions/R8. Closes the 4a seam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two words of one view are separated by a comma only where one was typed
between them (rules/R1). R8's examples, Accepted bullets and decisions
pointers follow the design-docs review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.0 milestone Oct 30, 2026
@derek73 derek73 added enhancement vocabulary Per-word vocabulary model and language packs labels Oct 30, 2026
@derek73 derek73 self-assigned this Oct 30, 2026
derek73 and others added 4 commits October 29, 2026 17:53
…ix-views-d134c9

# Conflicts:
#	docs/design/decisions/vocabulary-model.md
#	docs/release_log.rst
…eview)

A delimiter glued to a generation word ('Jr.;', 'III;', 'V;') put it in
credentials: the kind was looked up from the token text. Classify now
writes a kind tag from the stem it reads every word by, assemble drops
it from the published token, and one test walks every suffix-set word.
R8 records names unpickled from 2.x and name words in the suffix.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit a9884bf into master Oct 30, 2026
12 checks passed
@derek73
derek73 deleted the claude/feat-4b-suffix-views-d134c9 branch October 30, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant