Repository navigation
Split an acronym from a following decomposed accented word [patch] - #121
Merged
Merged
Conversation
The acronym-tail rule ("XMLDoc" breaks before the "D") checked the code
point straight after a capital for a lowercase letter. In NFD an accented
capital is "E" + U+0301, so that code point was the combining mark, no
break was inserted, and the acronym merged into the next word: NFD
"getIDÉtat" gave "get_idétat" and "XMLÉtude" gave "Xmlétude", where the
NFC spellings gave "get_id_état" and "XmlÉtude".
IsWordBoundary now skips forward over combining marks before looking for
that lowercase letter. IsPluralSuffix no longer takes an "s" carrying a
combining mark for a plural "s", matching the composed "ś", so NFD "IDś"
converts the same as NFC.
Fixes #113
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Te9V62v8CvS3Mj4gFs7ty3
|
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.



The acronym-tail rule (
"XMLDoc"breaks before theD) checked the code point straight after a capital to see whether a lowercase letter followed. In NFD an accented capital isE+ U+0301, so that code point is the combining mark. No break was inserted and the acronym merged into the next word:getIDÉtatToSnakeCase()get_idétatget_id_étatXMLÉtudeToSnakeCase()xmlétudexml_étudeXMLÉtudeToPascalCase()XmlétudeXmlÉtudeChanges
SkipOverCombiningMarkshelper, the forward counterpart toSkipBackOverCombiningMarks.IsWordBoundaryuses it beforeSkipLowercaseWithNoUppercaseso thatcasedNextStartlands on the next base letter.IsPluralSuffixno longer counts ansfollowed by a combining mark as a plurals. The composedśisn't one either, so NFDIDśnow converts the same as NFC. The issue suggested skipping the mark here as well, but skipping would have kept NFDIDśwhole while NFCIDśsplits, so this matches NFC instead.Tests
AnAccentedCapitalAfterAnAcronymShouldConvertLikeItsComposedSpellingchecksgetIDÉtat,XMLÉtudeandIDśin NFD against their NFC spellings in every case style.AnAcronymBeforeADecomposedAccentedWordShouldSplitFromItpins the exact snake_case and PascalCase output.string.Normalizedoes nothing, so each test writes out the composed spelling instead of normalizing.dotnet build CaseConverter.slnfinishes with 0 warnings and 0 errors.#112, the apostrophe half of the same NFD problem, is in its own PR (#120). The two branches don't touch the same lines.
Fixes #113
🤖 Generated with Claude Code
https://claude.ai/code/session_01Te9V62v8CvS3Mj4gFs7ty3
Generated by Claude Code