New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make shorter matches win when scores tie #902

Merged
merged 1 commit into from Oct 6, 2017

Conversation

Projects
None yet
1 participant
@leroix
Contributor

leroix commented Oct 6, 2017

Description of the Change

Recently, we added a change in https://github.com/atom/superstring/pull/37/files to remove a sorting ambiguity that occurred when scores tied. This has the added benefit of returning the shorter word first when scores tie. The change in this PR applies the same sorting scheme after the results from all buffers are merged together. This should fix item#1 in atom/superstring#36.

Alternate Designs

n/a

Benefits

It's more intuitive for shorter words to appear first in the suggestion list if they tie in score with neighboring matches.

Possible Drawbacks

Maybe, this should be handled in the .findWordsWithSubsequence algorithm in superstring by penalizing longer words with the same number of matching characters.

Applicable Issues

atom/superstring#36

@leroix leroix changed the title from make shorter matches win when scores tie to Make shorter matches win when scores tie Oct 6, 2017

@leroix leroix merged commit 342b607 into atom:master Oct 6, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@leroix leroix deleted the leroix:jr-matching-enhancement branch Oct 6, 2017

@leroix leroix referenced this pull request Oct 13, 2017

Closed

Fuzzy matching improvements #36

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment