Repository navigation
Keep a titlecase digraph after an apostrophe in its word [patch] - #168
Merged
Merged
Conversation
"a'Džemal" snaked to "a_džemal" while the two-letter spelling "a'Džemal" gives "adžemal". IsCapitalAfterApostropheInLowercaseContext tested char.IsUpper on the letter after the apostrophe, which is false for a titlecase digraph (category Lt), so the O'Neil rule never lowered it. SplitOnCaseChange then saw a lowercase-to-titlecase change and broke the word. The test now uses IsUpperOrTitlecase, as SplitOnCaseChange has since #158, so "a'Džemal" and "l'Ljubljana" give the same words as their two-letter spellings in every converter. Fixes #167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2QxLJ6PwV5nQrv4Us
This was referenced Nov 5, 2026
Resolve the test-file conflict with #169: both added a test method at the end of the class, so keep both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2QxLJ6PwV5nQrv4Us
#169 widened the condition that uppercases a suffix onto the capital before an in-word apostrophe, which took ReplaceNonAlphaNumericWithSpace to a cognitive complexity of 17 (Sonar S3776, limit 15) and fails the quality gate. The condition now lives in IsSuffixUppercasedOntoCapital; behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2QxLJ6PwV5nQrv4Us
#163 already moved the apostrophe-suffix condition into UppercasesSuffix, which resolves the same S3776 complexity finding, so take main's line and drop the now-unused IsSuffixUppercasedOntoCapital helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2QxLJ6PwV5nQrv4Us
|
matt-edmondson
deleted the
fix/titlecase-digraph-after-apostrophe-167
branch
November 11, 2026 02:29
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 #167
What was wrong
"a'Džemal"(U+01C5) snaked toa_džemaland macro-cased toA_DŽEMAL. The two-letter spelling"a'Džemal"givesadžemal.l'Ljubljanahad the same problem.IsCapitalAfterApostropheInLowercaseContextcalledchar.IsUpperon the letter after the apostrophe. That returns false for a titlecase digraph (category Lt), so the O'Neil rule never lowered the letter.SplitOnCaseChangethen saw a change from lowercase to titlecase and broke the word there.Change
The check now uses
IsUpperOrTitlecase, the same helperSplitOnCaseChangehas used since #158.LowercaseIfalready maps Dž→dž, so nothing else needed to change.a'DžemalAdžemaladžemalADŽEMALl'Ljubljana/l’LjubljanaLljubljanalljubljanaLLJUBLJANAThe issue also asked about the
char.IsUpper(input, previousLetterStart)test that setsuppercaseSuffix. I checkedDž'sagainstDž's, andADŽ'sagainstADŽ's. Both pairs already give matching words, so I left that test alone.Tests
ATitlecaseDigraphAfterAnApostropheShouldStayInTheWord. Each row checks Pascal, camel, snake, kebab and MACRO, plus Pascal→snake round-trip.a'Džemal,l'Ljubljana, andl’Ljubljana(U+2019).a'Džemal.dotnet build CaseConverter.slngives 0 warnings and 0 errors.The open PRs #160, #162 and #163 also edit the apostrophe path in
CaseConverter.cs, but not this line. Whichever lands last may need a trivial rebase.Generated by Claude Code