Repository navigation
Keep a plural's "s" in the word after a digit and an apostrophe [patch] - #155
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
An apostrophe counted as in-word only between two letters, so "the 1990's" split into "the_1990_s" and Title case gave "The 1990'S". A digit before the apostrophe now counts too, and Title case lowers the letter after a digit and an apostrophe the same way it lowers one directly after a digit. Fixes #154 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW6ERvyATBYDH9pPgb7
|
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 #154
What changes
IsApostropheWithinWordnow treats an apostrophe as in-word when a letter or a digit comes before it, as long as a letter still follows."the 1990's"now gives snakethe_1990sand PascalThe1990s, where it used to givethe_1990_sandThe1990S.LowercaseLettersAfterDigitsalso lowercases a letter that follows a digit and an apostrophe. This undoesTextInfo.ToTitleCasetreating that letter as a word start, so Title case givesThe 1990'srather thanThe 1990'S. It works for both'and U+2019.Behaviour change to an existing test
ApostropheNotBetweenLettersShouldStillSeparateWordsasserted"80's music"→"80_s_music", which is exactly the split the issue calls a bug. That row now lives in the new test with the expected value80s_music. The other rows in that test ('quoted' word,rock 'n' roll) are unchanged and still pass.Tests
ApostropheAfterADigitShouldNotSplitTheWordcoversthe 1990's,the 90’s(U+2019),4's and 5's,1990'sand80's music. Each case checks Title, Pascal, camel, snake and MACRO, plus a snake round trip through Pascal and through Title.it's,API's,o'NEIL, and so on) still pass.Note
Several open CaseConverter PRs also edit
CaseConverter.cs(#139 to #153). This branch starts from currentmainand doesn't depend on any of them. Whichever merges later may need a trivial rebase.Generated by Claude Code