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

feat: using fuzzy to match query #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alswl
Copy link

@alswl alswl commented Jun 29, 2023

related to #6

Now we cant match any partial words in query.
The new partial search pattern is works like Jetbrains matching in UI.

Copy link
Owner

@artemy artemy left a 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?

@alswl
Copy link
Author

alswl commented Jun 29, 2023

@artemy unit tests added.

@alswl
Copy link
Author

alswl commented Jul 15, 2023

@artemy Hello, any progress? or should I do anything else?

@artemy
Copy link
Owner

artemy commented Aug 9, 2023

@artemy Hello, any progress? or should I do anything else?

@alswl
Sorry for late reply.
There is still one comment I posted that is not yet addressed in your changes

@alswl
Copy link
Author

alswl commented Sep 24, 2023

@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.

@artemy
Copy link
Owner

artemy commented Sep 25, 2023

@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

@alswl
Copy link
Author

alswl commented Sep 25, 2023

@artemy I'm confused, I cannot find any comment in the files changes.

image

image

@@ -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:
Copy link
Owner

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

Copy link
Owner

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

Copy link
Owner

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

Copy link
Author

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?

Copy link
Owner

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

@artemy
Copy link
Owner

artemy commented Sep 25, 2023

@artemy I'm confused, I cannot find any comment in the files changes.

image

image

ok sorry, my bad. Forgot to press "submit" on the review :O

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

Successfully merging this pull request may close these issues.

None yet

2 participants