Repository navigation
Lower a capital whose word has no other cased letter after a one-letter word [patch] - #172
Merged
Merged
Conversation
…er word [patch] "vector x y名" became "VectorXY名", which reads back as the all-caps word "XY名" and converted to "VectorXy名" on a second pass. "Y名" is not a one-letter word, so the #95 rule left its capital alone. After a capital one-letter word, a word whose only cased letter is its leading capital is now lowered too, so Pascal and camel output converts back to itself. Fixes #171 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW6Z37eT9vMfVTZhXgK
|
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 #171
What changed
LowercaseOneLetterWordsAfterOneLetterWordslowers a one-letter word that comes after another one-letter word (#95).Y名doesn't count as a one-letter word, so its capital stayed. Joined,"Vector X Y名"becameVectorXY名. That reads back as the all-caps wordXY名, and a second pass turned it intoVectorXy名.There is a new check,
IsCapitalThenUncased, for a word whose only cased letter is its leading capital. When such a word comes after a capital one-letter word, it is now lowered, following the existingIsLetterThenPluralSbranch.vector x y名VectorXY名→VectorXy名vectorXY名→vectorXy名x y名前XY名前→Xy名前xY名前→xy名前a B名AB名→Ab名aB名→ab名The ASCII control
vector x y→VectorXyis unchanged. Digit-suffixed inputs give the same output as before, because digits split into their own word earlier:vector x y2→VectorXy2,get x y_2→GetXy2.Tests
AOneLetterWordBeforeACapitalAndCaselessLettersShouldConvertToOutputThatConvertsBackToItselfcovers the issue's five inputs plus the ASCII control. For each one it checks:ToPascalCase().ToSnakeCase()andToCamelCase().ToSnakeCase()agreeWith the fix reverted, the five issue rows fail and the control passes. With the fix, the full suite passes: 279/279.
Note
The open splitter PRs (#160, #162–#164, #168–#170) change other parts of
CaseConverter.cs. This PR is based directly onmain.Generated by Claude Code