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

search: Improve the search matcher #22

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Sep 7, 2021

Introduces fuzzy matcher to improve the theme search.

I observed the following results in the theme search:

$  ~ leftwm-theme search orange
Searching for themes with similar names . . .
$  ~ leftwm-theme search "Orange For"
Searching for themes with similar names . . .
   community/Orange Forest: A LeftWM theme-Installed
$  ~ leftwm-theme search ng
Searching for themes with similar names . . .
   community/TNG: A LeftWM theme
$  ~ leftwm-theme search xp
Searching for themes with similar names . . .
   community/TNG: A LeftWM theme
$  ~ leftwm-theme search Windows
Searching for themes with similar names . . .
   community/Windows XP: A LeftWM theme

Edit distance string metric of 3 seems to be not helping much here.
I tried to replace that with a fuzzy matcher and got some comparatively good results.

NOTE: I've added test cases comparing the two methods. If we agree to go with fuzzy matcher, I'll remove the edit_distance method and related tests.

Introduces fuzzy matcher to improve the theme search.
@darkowlzz darkowlzz force-pushed the search-fuzzy-matcher branch from 7379966 to 85bb691 Compare September 7, 2021 13:42
@mautamu
Copy link
Member

mautamu commented Sep 7, 2021

This looks great! It might be helpful to accompany this PR with the PR than finally makes theme names follow arch naming standards #9 . @darkowlzz If you want to take that on, that'd be great; otherwise will merge when I can test later today.

Best,
Mau

@lex148
Copy link
Member

lex148 commented Sep 7, 2021

I had a moment to review and test. This is awesome! good work.

@lex148 lex148 merged commit e547734 into leftwm:master Sep 7, 2021
@darkowlzz darkowlzz deleted the search-fuzzy-matcher branch September 7, 2021 19:48
@darkowlzz
Copy link
Contributor Author

darkowlzz commented Sep 7, 2021

@lex148 thanks.

@mautamu I've encountered the issue in #9 myself and wanted to fix it. Was just trying to get some more rust experience before working on it. I'll give it a try. Thanks.

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.

3 participants