Repository navigation
Lowercase a word-final capital sigma to final sigma [patch] - #130
Merged
Merged
Conversation
Every lowercasing path used the invariant (simple) mapping, which turns "Σ" into the medial "σ" even at the end of a word. Apply Unicode's Final_Sigma condition in ToLowerInvariantFull and in LowercaseAllCapsWords, so "ΛΟΓΟΣ" converts to "λογος" in every format and Greek converts the same from its MACRO_CASE spelling as from its lowercase one. Fixes #127 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TcwiBxstFgqEyzPbhdZoTT
|
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 #127
Before: every lowercasing path used the invariant (simple) mapping, so a capital
Σalways came out as the medialσ, even at the end of a word."ΛΟΓΟΣ".ToSnakeCase()gaveλογοσ, and"λόγος".ToMacroCase().ToSnakeCase()gaveλόγοσeven though"λόγος".ToSnakeCase()isλόγος.After: a word-final
Σlowercases toςin snake, kebab, Pascal, camel and Title Case. A loneΣand a word-initialΣstill giveσ("ΣΑΣ"→σας).How: a new
ToLowerInvariantWithFinalSigmaapplies Unicode'sFinal_Sigmacondition: a cased letter comes before theΣand none comes after it, skipping case-ignorable characters such as combining marks and apostrophes.ToLowerInvariantFullnow builds on it, andLowercaseAllCapsWordsuses it in place of plainToLowerInvariant(). That keeps the existing rule thatİis left for title-casing there. The invariant mapping maps one char to one char, so indexes in the input and output line up.Tests: I added
AWordFinalCapitalSigmaShouldLowercaseToFinalSigma, which covers every example from the issue in five formats, andGreekWithFinalSigmaShouldConvertTheSameFromItsMacroCaseSpelling. With the library change reverted, 6 of them fail. With it, all 174 tests pass. The library builds cleanly for net10.0, net9.0, net8.0, netstandard2.0 and netstandard2.1.Generated by Claude Code