Skip to content

Give a capital after a supplementary-plane digit the camelCase bonus [patch] - #135

Merged
matt-edmondson merged 2 commits into
mainfrom
fix/133-supplementary-digit-camelcase
Nov 11, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
fix/133-supplementary-digit-camelcase

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #133

What changed

The #132 rule ("a capital after a digit starts a word") checked char.IsDigit(strChar), which only looks at the leading UTF-16 unit. A supplementary-plane decimal digit such as U+1D7D1 𝟑 starts with a high surrogate, so the capital after it got no bonus: Fuzzy.Contains("Vector\U0001D7D1Distance", "vd") scored -3 instead of 7.

There is a new IsDecimalDigit(span, index, length) helper beside GetLetterCase. It classifies the whole codepoint, using Rune.IsDigit on NETCOREAPP3_0_OR_GREATER and CharUnicodeInfo.GetUnicodeCategory(string, 0) == DecimalDigitNumber on netstandard.

Tests

  • CapitalAfterAnyDecimalDigit_EarnsCamelCaseBonus covers 3, Arabic-Indic ٣ and 𝟑. All three now score 7. With the call-site change reverted, the 𝟑 row fails (verified).
  • IsDecimalDigit_ClassifiesASupplementaryPlaneDigitAsAWhole checks that the helper says yes for U+1D7D1 and no for the supplementary-plane letter U+10400.
  • Full suite: 134/134 pass. The library also builds clean for netstandard2.0/2.1 and net8–10. The test project targets net10.0 only, so the netstandard branch is compiled but not exercised by tests.

Generated by Claude Code

…[patch]

The #132 digit check read only the leading UTF-16 unit, a high surrogate for
a digit such as U+1D7D1, so the capital after it earned no bonus. Classify
the whole codepoint: Rune.IsDigit on .NET Core 3.0+, and the Unicode
category of the pair elsewhere.

Fixes #133

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW48zSwFpGf7uymY8oD
…-digit-camelcase

# Conflicts:
#	FuzzySearch/Fuzzy.cs
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 9476398 into main Nov 11, 2026
15 checks passed
@matt-edmondson
matt-edmondson deleted the fix/133-supplementary-digit-camelcase branch November 11, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A capital after a supplementary-plane digit (e.g. U+1D7D1 𝟑) gets no camelCase bonus: #132 checks only the high surrogate

2 participants