Repository navigation
Ignore case for letters outside the Basic Multilingual Plane [patch] - #107
Merged
Merged
Conversation
CodepointsEqual compared a surrogate pair code unit by code unit, so supplementary-plane letters such as Deseret, Osage and Adlam only matched in the exact case, although case is always meant to be ignored. A surrogate pair is now compared as one codepoint, on its lowercase or uppercase form like CharsEqualIgnoringCase: through Rune where it exists, and through the invariant string casing on netstandard. Fixes #90 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnUaFtfBEaU4WcCPkkdpvM
|
3 tasks
This was referenced Oct 7, 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 #90
What was wrong
Fuzzy.CodepointsEqualcompared a surrogate pair one code unit at a time. Letters outside the Basic Multilingual Plane, such as Deseret, Osage and Adlam, therefore matched only in the exact case, although the README says case is always ignored.Change
SurrogatePairsEqualIgnoringCase. LikeCharsEqualIgnoringCase(Case-insensitive matching fails for Greek final sigma and micro sign: Contains("ΟΔΟΣ", "οδος") is false #88), it matches on either the lowercase or the uppercase form.Rune.ToLowerInvariant/Rune.ToUpperInvariant.Runedoesn't exist, it falls back to invariant string casing of the two-character pair.CodepointsEqualnow gives the real reason a pair has to be compared whole. It no longer says supplementary codepoints are compared exactly.Not in this PR
The camelCase bonus still reads case from the lead surrogate, so a supplementary-plane uppercase letter does not earn it. The issue lists this as optional. Fixing it changes the internal
ApplyBonuses(…, char strChar, char strLower, char strUpper, …)signature that the existing tests call directly, so it is better as its own change. It does not affect the acceptance criteria: the other-case match now scores the same as the exact-case one.Tests
New tests in the Surrogate Pair region:
Results:
🤖 Generated with Claude Code
https://claude.ai/code/session_01QnUaFtfBEaU4WcCPkkdpvM
Generated by Claude Code