Repository navigation
Treat a losing rematch as unmatched for the next letter [patch] - #131
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
A copy of the best letter that loses the rematch was already charged as a skipped letter, but it still set prevMatched. The next codepoint then got the adjacency bonus and counted as continuing a run, which stopped a later camelCase or separator copy from displacing it. Scores could exceed any alignment the documented rules allow, and changed when an unmatched letter changed: "EditItemManager"/"em" scored 2 against 12 for "EditItxmManager". Fixes #130 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5jAJ5C3wivQLYNkMm
|
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 #130
What changed
In
Fuzzy.Contains, a copy of the best letter that loses the rematch was charged as a skipped letter, but control then fell through toprevMatched = true. The codepoint after it got the +5 adjacency bonus and counted as continuing a run, which stopped a later camelCase or separator copy from displacing it.The losing-rematch branch now records that the codepoint stayed unmatched, so
prevMatchedisfalsefor the next codepoint. The bookkeeping forprevLower/prevSeparatorand the indices is unchanged.EditItemManager/emEditItxmManager)axaB/abaxB(19)Baxab/babBaxxbTests
Score_LosingRematch_DoesNotGrantNextLetterAdjacency(3 cases) andScore_LosingRematch_DoesNotRaiseScore.dotnet test).Note: per the issue's triage, open PR #129 (CompatibilitySuppressions) may need to land first for
packto pass on CI.Generated by Claude Code