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

(FR) Implement Fuzzy search #54

Open
lbesnard opened this issue Jun 27, 2022 · 3 comments
Open

(FR) Implement Fuzzy search #54

lbesnard opened this issue Jun 27, 2022 · 3 comments

Comments

@lbesnard
Copy link

Implementing Fuzzy search would (I believe) improve greatly the user experience. Once used in other cli tools, it's hard to go back.

Python package:
https://pypi.org/project/fuzzysearch/

I'm happy to look at trying to implement it and create a PR if interested

thanks for a great tool. Perfect with i3/dmenu

@Evidlo
Copy link
Owner

Evidlo commented Jun 27, 2022

Which command are you talking about? Can you give examples for what you mean?

@lbesnard
Copy link
Author

I meant to replace maybe the grep function with the python package mentioned above:
https://github.com/Evidlo/passhole/blob/master/passhole/passhole.py#L758

As an example, this is a way of how this works with the commandline
https://github.com/junegunn/fzf

This means that if you're looking for example for an entry named "password_spotify_all_familly", you could only type "psspotifam" and even with some typo.

@Evidlo
Copy link
Owner

Evidlo commented Jan 31, 2024

I'm open to this idea, but it needs to be implemented through regular expressions as that's what's used under the hood for searching.

Something like this would be ideal, but I don't think that XML regex supports lookaheds.

An option might be to substitute spaces with '.*' so that ps spoti fam would give the regex ps.*spoti.*fam and that would match your example.

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