Skip to content
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

Option to check similarity with unused/extraneous characters #10

Open
whamer100 opened this issue Oct 1, 2020 · 1 comment
Open

Option to check similarity with unused/extraneous characters #10

whamer100 opened this issue Oct 1, 2020 · 1 comment

Comments

@whamer100
Copy link

When doing searches on a QuickScore class, if a query contains extra characters than the options, it will simply fail, even if its just one character off.

Example: Wanted word in list is "Apple" and the query is "Xpple", even though its one character away from being a 1.0, it will fail to have it in results.

@fwextensions
Copy link
Owner

fwextensions commented Oct 5, 2020

Thanks for the feedback. The original Quicksilver algorithm that QuickScore is based on always required an exact, in-order match, even if the matches were widely spaced. While allowing for typos may have some benefit in theory, in practice I've found it usually returns too many nonsensical results when searching across many long strings. URLs, in particular, often have long tokens that contain almost the entire alphabet, so allowing for typos can mean that almost any URL matches.

Fuse.js is a string scoring library that allows for typos or out-of-order matches, and you can compare it against QuickScore on the demo page. To my mind, the ordering and number of its results aren't as useful.

It may be possible to adjust the Quicksilver algorithm to ignore characters in a query that aren't in a target string while giving it a lower score, but I don't see how to allow for out-of-order characters. So xpple might get a non-zero score against apple, but paple wouldn't. But I'm not sure how useful that would be in practice.

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

No branches or pull requests

2 participants