Repository navigation
Write saint and rank particles with their capital in case repair (#1069) - #1075
Merged
Merged
Conversation
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>
…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>
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.
Closes #1069
Case repair lowercased every particle that had no case mask. That gave
JOHN ST CLAIR→John st ClairandJOSE SAN MARTIN→Jose san Martin, and #1064 extended it to the German ranks it made particles:OTTO GRAF LAMBSDORFFrepairs toOtto Graf Lambsdorffunder the 2.8.0 wheel but toOtto graf Lambsdorffon master dadf39b.The change. The
saintandrankvocabulary 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'sLexicon.add(w, kind="saint"), cannot miss it. Thecasedmasks #725 gavestaandstofor 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:capitalizedcapitalized_force, 4capitalizedcapitalizedIn 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 TAXISandGEORG FRIEDRICH PRINZ VON PREUSSENnow repair exactly as under 2.8.0.JOHN ST CLAIRrepaired toJohn st Clairon 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 becausesanis a saint particle. The spacedSuzuki sanalready repaired toSuzuki San. The vocabulary records no romanized honorific. Keeping the lowercase only where a saint word ends a hyphenated word was considered and declined.Docs.
Suzuki-san.St ClairandSan Martínwith their capital?JOHN ST CLAIRrepairs toJohn st Clair#1069 entry.Juan Sta. Mariaread familySta. Maria? Today it reads middleSta., familyMaria#725's entry gets a head note marking its masks superseded.customize.rstdoctest, AGENTS.md, the vocab README kind table, and the re-recordedsnapshot.jsonl,corpus_rules.jsonlandrules_budget.json.Checks.
particlecontrol. Each fails with the skip removed.🤖 Generated with Claude Code