Skip to content

Write saint and rank particles with their capital in case repair (#1069) - #1075

Merged
derek73 merged 3 commits into
masterfrom
fix/issue-1069-particle-case-repair
Nov 5, 2026
Merged

derek73 merged 3 commits into
masterfrom
fix/issue-1069-particle-case-repair

Conversation

@derek73

@derek73 derek73 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Closes #1069

Case repair lowercased every particle that had no case mask. That gave JOHN ST CLAIR → John st Clair and JOSE SAN MARTIN → Jose san Martin, and #1064 extended it to the German ranks it made particles: OTTO GRAF LAMBSDORFF repairs to Otto Graf Lambsdorff under the 2.8.0 wheel but to Otto graf Lambsdorff on master dadf39b.

The change. The saint and rank vocabulary kinds compile into a new internal set, CAPITALIZED_PARTICLES, and case repair (_render._lowers_as_particle) no longer lowercases a word in it. The set is built from the kind rather than from a mask on each word. So a new saint or rank word, whether a vocabulary file's or a caller's Lexicon.add(w, kind="saint"), cannot miss it. The cased masks #725 gave sta and sto for the same purpose are dropped, leaving one mechanism. A recorded mask still outranks the capital (rules/R4's #604 clause).

Measured.

  • Committed snapshot (snapshot.py, against dadf39b): 15 entries move, all in the forced case view. 14 now give the input's own spelling: Jean St Clair, Jill St. John, Ste Marie, Diego Fernández de San Pedro, Domingo Santa María González, Freiherr von Berg, Ed, Graf Lambsdorff, Otto, San San Chiou, … The 15th is the accepted cost below.

  • Local corpora (snapshot.py --local SOURCE --base <dadf39b7 checkout>), entries that differ:

    corpus entries case view
    fec-individuals 896 capitalized
    ctgov-officials 143 139 capitalized_force, 4 capitalized
    tse-donors 323 capitalized

    In FEC the new capital is on St 754 times, San 88, Santa 40, Ste 8 and Graf 9. Examples: Janet st Jean → Janet St Jean, Lane santa Cruz → Lane Santa Cruz. No role moved.

  • Against the 2.8.0 wheel (PYTHONSAFEPATH=1, paths asserted): OTTO GRAF LAMBSDORFF, MARION GRÄFIN DÖNHOFF, JOHANNES FÜRST VON THURN UND TAXIS and GEORG FRIEDRICH PRINZ VON PREUSSEN now repair exactly as under 2.8.0. JOHN ST CLAIR repaired to John st Clair on 1.4.0 and on every 2.x wheel through 2.8.1.

Accepted cost. Under a family-first order with force=True, Suzuki-san → Suzuki-San. The romanized honorific had been lowercase only because san is a saint particle. The spaced Suzuki san already repaired to Suzuki San. The vocabulary records no romanized honorific. Keeping the lowercase only where a saint word ends a hyphenated word was considered and declined.

Docs.

Checks.

  • Suite: 37,265 passed on 3.11 and on 3.15. The serial benchmarks, mypy, ruff and the Sphinx doctests pass too.
  • The new tests sweep every word in the set, and test a caller's word of each kind with a plain particle control. Each fails with the skip removed.
  • A code review and a design-docs review ran. The design-docs review's three findings are fixed in the second commit.

🤖 Generated with Claude Code

derek73 and others added 2 commits November 4, 2026 23:09
Case repair's particle arm lowercased every particle without a mask, so
JOHN ST CLAIR repaired to 'John st Clair' and, once #1064 made the German
ranks particles, OTTO GRAF LAMBSDORFF to 'Otto graf Lambsdorff' where
2.8.0 gave 'Otto Graf Lambsdorff'. The saint and rank kinds now compile
into CAPITALIZED_PARTICLES, which the arm skips, so a word a file or a
caller adds of either kind is written with its capital too; sta's and
sto's masks, which #725 added for this, are dropped for the one
mechanism. Suzuki-san under a family-first order with force repairs to
'Suzuki-San', the accepted cost (rules/R4, decisions/R4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r case masks (#1069)

Review fixes: decisions/H6's #725 entry still described the masks this
change drops, the release bullet's Suzuki-San cost left out force=True,
and AGENTS.md listed the set among the given-name sets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.0 milestone Nov 5, 2026
@derek73 derek73 added bug vocabulary Per-word vocabulary model and language packs labels Nov 5, 2026
@derek73 derek73 self-assigned this Nov 5, 2026
…sion in _lowers_as_particle (#1069)

Code-review fixes: the helper's docstring still said every working
particle is lowercased, and the guard sweep had no recorded control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit b125511 into master Nov 5, 2026
13 checks passed
@derek73
derek73 deleted the fix/issue-1069-particle-case-repair branch November 5, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should case repair write St Clair and San Martín with their capital? JOHN ST CLAIR repairs to John st Clair

1 participant