Repository navigation
Title-case a word that starts with a ligature or "ʼn" [patch] - #137
Merged
Merged
Conversation
TextInfo.ToTitleCase uses the simple case mapping, which leaves the Latin ligatures U+FB00-U+FB06 and "ʼn" lowercase. A word starting with one stayed lowercase, so PascalCase and camelCase lost the boundary before it: "the first" and "thefirst" both became "Thefirst", and "my file" camel-cased the same as "myfile". ToTitleCase now applies the full title case from SpecialCasing.txt to such a word-initial letter, so "the first" becomes "The First" and "TheFirst". A ligature inside a word is left as it is. Fixes #133 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5r5WL5w6Xw9zvRF9a
|
This was referenced Oct 30, 2026
This was referenced Nov 11, 2026
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 #133
What changed
TextInfo.ToTitleCaseuses the simple case mapping. That mapping leaves the Latin ligatures U+FB00–U+FB06 (ff fi fl ffi ffl ſt st) andʼn(U+0149) lowercase. A word that started with one of them stayed lowercase, so PascalCase and camelCase lost the boundary before it. For example,"the first"and"thefirst"both became"Thefirst".ToTitleCasenow calls a newTitleCaseWordStartsWithNoSimpleTitlecasestep right afterTitleCaseKeepingTypographicApostrophes. The step applies the full title case from SpecialCasing.txt to those letters when they start a word:fi→Fi,fl→Fl,ffi→Ffi,st→St,ʼn→ʼN, and so on. It runs as its own pass because the mapping changes the string's length. This is the full-titlecase option the triage preferred over expanding ligatures up front, so a ligature inside a word ("office") is left as it is. A letter after a digit is not treated as a word start, which matchesLowercaseLettersAfterDigits.Results:
"the first": TitleThe First, PascalTheFirst, and Pascal→snakethe_first(two words, asToSnakeCasegives)."my file".ToCamelCase()ismyFile."myfile".ToCamelCase()staysmyfile."The First".ToTitleCase()converts back to itself.One thing to look at:
"die ʼn boek"now title-cases toDie ʼN Boek, and Pascal→snake gives three words, as it should. The splitter still attaches the caselessʼto the word before it (dieʼ_n_boek). That is the existing caseless-letter rule, so the test only pins the word count. TheDž/Ljdigraph case in #106 is not touched.Tests
AWordStartingWithALigatureShouldBeTitleCased(7 rows, including a mid-word ligature guard),AWordStartingWithALigatureShouldKeepItsBoundaryInCamelCaseandAWordStartingWithNApostropheShouldBeTitleCased.dotnet build CaseConverter.slnsucceeds for every target framework, netstandard2.0 included, with no warnings.Generated by Claude Code