Skip to content

Give supplementary-plane capitals the camelCase bonus [patch] - #119

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/110-supplementary-camel-case
Oct 14, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/110-supplementary-camel-case

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #110

Summary

Scoring read a codepoint's case from its leading code unit. For a surrogate pair that unit is caseless, so supplementary-plane capitals (Deseret, Osage, Adlam, …) never earned camelCaseMatchBonus, and a supplementary lowercase letter never set prevLower. Matching was already case-insensitive after #90; only the bonus was missing.

  • New Fuzzy.GetLetterCase reads is-upper and is-lower from the whole codepoint: Rune on .NET Core 3.0+, and the invariant string casing on netstandard2.0/2.1, the same fallback SurrogatePairsEqualIgnoringCase uses.
  • ApplyBonuses now takes bool isUpper instead of the char, lower and upper forms. Its five unit tests are updated to match.
  • Replaced the outdated "a surrogate is caseless" comment.

Testing

  • New data-driven test Contains_WithScore_SupplementaryPlaneCamelCaseBoundary_ScoresLikeTheBasicPlaneBoundary covers ab𐐀/𐐨, ab𐐀/𐐀, ab𐒰/𐒰, 𐐩𐐩𐐀/𐐀, and a Deseret lowercase letter followed by a basic-plane capital. All five rows failed before the change and pass after it.
  • New Contains_WithScore_InsideASupplementaryPlaneCapitalRun_EarnsNoCamelCaseBonus checks that no bonus is given inside an all-caps run.
  • dotnet build passes for every target (netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0). dotnet test: 112/112.
  • The test project targets only net10.0, so the netstandard fallback branch compiles but is not run by these tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_016S7rZyqVHjk6PMohZvdB4y


Generated by Claude Code

The camelCase bonus read case from the lead surrogate alone, which is
caseless, so a Deseret, Osage or Adlam capital never earned the bonus and a
lowercase letter from those scripts never opened a boundary. Case is now
read from the whole codepoint, through Rune where it exists and the
invariant string casing on netstandard2.0, and ApplyBonuses takes whether
the codepoint is uppercase instead of its char forms.

Fixes #110

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016S7rZyqVHjk6PMohZvdB4y
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 94b3e8b into main Oct 14, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/110-supplementary-camel-case branch October 14, 2026 01:13
matt-edmondson added a commit that referenced this pull request Nov 4, 2026
…mp [patch] (#129)

Polyfill 11.4.5 changed which shim members are emitted per target
framework, so pack failed package validation on main with 151 errors
(80 CP0016, 56 CP0001, 6 CP0014, 4 CP0015, 3 CP0002, 2 CP0008), all on
polyfilled BCL types. That is why 1.4.1 is still the latest release and
the #117, #118 and #119 fixes never shipped.

Regenerated with -p:ApiCompatGenerateSuppressionFile=true, which leaves
11 entries (10 CP0014, 1 CP0015) instead of 153. All of them are on Polyfill
shim types and none on FuzzySearch's own API.

Fixes #128


Claude-Session: https://claude.ai/code/session_017vfJW6Hi85XX4Q7wr44mWe

Co-authored-by: Claude <noreply@anthropic.com>
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.

Uppercase letters outside the BMP never earn the camelCase bonus: Score("abC","c") = 8 but Score("ab𐐀","𐐨") = −2

2 participants