Repository navigation
Split a capitalised word after a capital followed by ß or a ligature [patch] - #141
Merged
Merged
Conversation
…[patch]
A lowercase letter with no uppercase form, such as ß or ff, takes the
case of the nearest cased letter before it. That inheritance was applied
to the capitalised-word rule but not to the acronym-tail rule, so after
"Off", "Xß" or "GROß" a capitalised word was never split off. PascalCase
output then changed when converted again ("OffSwitch" became
"Offswitch"), and "GROßBar".ToSnakeCase() gave "großbar".
The acronym-tail rule now treats such a letter as uppercase when the
nearest cased letter before it is uppercase. With no cased letter
before it, as in "fiDoc", nothing changes.
Fixes #140
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5wGJLhri3KXBeZJwH
This was referenced Oct 30, 2026
Resolves the conflict in IsWordBoundary with #139 and #143. The inherited uppercase of a letter with no uppercase form is now looked up only before a capital, the same way #139 made the cased-next scan lazy. Looked up at every code point, it walked back over a long run of such letters each time and failed LongRunOfLowercaseWithNoUppercaseConvertsInLinearTime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5wGJLhri3KXBeZJwH
|
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.



Fixes #140
What changed
ßand the ligatures likeff. The An all-caps word containing ß is split into bogus words, so ToMacroCase isn't idempotent: "straße" → "STRAßE" → "STR_Aß_E" #87 fix made each one take the case of the nearest cased letter before it, but only the capitalised-word rule used that. The acronym-tail rule (XMLDoc→XML Doc) inIsWordBoundarystill used a plainchar.IsUppercheck, so afterOff,XßorGROßa capitalised word never started a new word.InheritsUppercasehelper that mirrorsEndsWordThatIsNotUppercase.EndsWordThatIsNotUppercasereturned false. That would also have split a ligature that has no cased letter before it, such asfiDoc→fi Doc. That case is unchanged here, and a test pins it."off switch".ToPascalCase().ToPascalCase()OffswitchOffSwitch"the off state".ToPascalCase().ToSnakeCase()the_offstatethe_off_state"aßBar".ToPascalCase()AßbarAßBar"GROßBar".ToSnakeCase()großbargroß_barTests
ToPascalCaseShouldBeIdempotentAfterACapitalFollowedByLettersWithNoUppercaseForm: runs the rows from the issue, covering bothßandff, through PascalCase and camelCase twice.ACapitalisedWordAfterAnUppercaseRunEndingInSharpSOrALigatureShouldSplit: checks the expected outputs from the acceptance criteria.ALigatureWithNoCasedLetterBeforeItShouldNotSplitFromTheCapitalAfterIt: guards thefiDoccase.Without the source change, four of the new cases fail. With it, the full suite passes locally (216 tests, 0 failures).
Note: open PR #139 also edits
CaseConverter.cs, so whichever of the two merges second may need a rebase.Generated by Claude Code