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
Better fuzzy search #379
Better fuzzy search #379
Conversation
Note to self: aliases having a relevance of 10, they always are pushed back irrelevant results. |
Yes I like it. Much better than #361. |
Thanks @saveman71 for this piece of content! |
} | ||
|
||
// If we are at the beginning of a word, add it to matchedWordStarts | ||
if (Character.isUpperCase(pojo.name.charAt(appPos)) || appPos == 0 || Character.isWhitespace(pojo.name.charAt(appPos - 1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OQ: do we want to enforce a capital letter for a first word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OQ: if appPos == 0, it may be worth boosting the app relevance too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OQ: do we want to enforce a capital letter for a first word?
There is no need to, appPos == 0
is there to handle that.
OQ: if appPos == 0, it may be worth boosting the app relevance too?
Well if appPos == 0
is true, we already add 1 to matchedWordStarts
. Imo this is not necessary because it will allow something like Barcode Scanner
to have the same score if we write Bar
or Sca
, and I think is a good thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me.
Done /cc @Neamar I removed the base score alltogether, should not pose any problem and I can't remember why it was there :( I'll see with actual usage data if there is something to adjust. |
Been using it for a few days, seems good to me! |
Hi @saveman71 and @Neamar , The appPos variable in the for loop (AppProvider:38) ends on pojo.nameNormalized.length but inside the loop the counter has access to the pojo.name variable. If pojo.name.length != pojo.nameNormalized.length then you get OutOfBounds |
Okay so this happens only if you have (at least) one app with some special characters in it, which I didn't have. What could be done is to release the quickfix, and maybe sort out what can be done to fix the issue? |
Yes, quickfix seems a good idea ! |
So I was motivated to solve #282 in a better way than #361 (not a Levenshtein distance, but the real thing like in sublime-text, as requested in the issue).
Sorry @nmitsou ^_^'
It looks like this for now:
Comparaison with #361:
clogk -> clock
)This PR also adds support for multi-part highlighting.
Here is how the score is calculated:
Can someone test it and provide some feedback, especially on the ranking of the apps?
/cc @Neamar @nmitsou @emersion