-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fuzzy searching #46
Comments
I think it is not worth. The code added will be harder to maintain and the benefit is near zero. |
@Tomas-M I think this is totally worth it. Lack of fuzzy search is a stopper for me. 99% of work I am doing from console. I use launcher program rarely. When I use it I often barely remember the program name I want to launch. Fuzzy search is a must have for me. |
Well, the problem is not the comparison algorithm in itself, as you say that's only about 100loc. The problem is that the system in place today is a linked list of entries. when a character is typed the list is iterated over and those with no substring match in either program name or command name are marked as hidden. The drawing function then iterates over them and draws all the non-hidden elements. To implement other search heuristics we would need to implement sorting of the list of entries, something which isn't trivial and would likely mean that the data structure for storing entries would have to change (at least for an efficient implementation). |
@Tomas-M would you mind if I merged this into master? The PR is growing further and further away from the master. It works fine and I would say it's pretty easy to use and maintain, with little to no overhead if it is turned off. |
I never tried it. Is it working fine with UTF-8? |
No, this never got merged so fuzzy searching is not in this version of xlunch. It's probably easier to redo this PR though at this point if we want to add it. |
I got asked if xlunch supports or was planned to support fuzzy searching. I think it would be cool but might require a certain rewrite of the internal data structure of entries.
Here is an algorithm (in C#, but should be pretty easy to port):
https://www.codeproject.com/Articles/36869/Fuzzy-Search
The problem is that currently the entries are sorted in a linked list. Using fuzzy search like it's normally used would mean having to sort this list based on their edit distance (Levenshtein distance). Another option would of course be to have a cut-of in "similarity" and keep the entries in their original order, but that's a bit of a hack and not "proper" fuzzy searching.
The text was updated successfully, but these errors were encountered: