-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: using fuzzy to match query #7
base: master
Are you sure you want to change the base?
Conversation
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.
Nice change, would you be able to add a new testcase that checks this matching?
@artemy unit tests added. |
@artemy Hello, any progress? or should I do anything else? |
@artemy Hi, I think the test cases are added, and I cannot found the one comment in the file changes. Could your point the comment to me? thanks. |
I've tagged you in the pending comment |
@artemy I'm confused, I cannot find any comment in the files changes. |
@@ -31,6 +31,15 @@ def create_json(projects): | |||
AlfredOutput([AlfredItem(project.name, project.path, project.path) for project in projects])) | |||
|
|||
|
|||
def match_fuzzy(chars, string): | |||
index = 0 | |||
for char in chars: |
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.
after having a second look at this, I believe this algorithm is too permissive. For example, it would find my-awesome-project
by querying with ywp
. I'd like to keep matching by first letters of each word in the name
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.
@alswl this comment is still not addressed I believe
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.
@alswl tagging you in the pending comment
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.
Yes, the search algorithm is by design. Maybe I can make it more strict: only match the left letters of eatch word. For eg: my-awesome-projct
will matching the patterns:
- map -> yes
- myawp -> yes
- mawpr -> yes
- awp -> yes
- mwr -> no
- ywp -> no
What's your opinion?
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.
that's what I had in mind, yes! Please make sure to extend the unit tests to cover these new cases
ok sorry, my bad. Forgot to press "submit" on the review :O |
related to #6
Now we cant match any partial words in query.
The new partial search pattern is works like Jetbrains matching in UI.