-
Notifications
You must be signed in to change notification settings - Fork 280
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(UI): korean and english fuzzy search #3757
base: main
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.
Or, thinking about it, maybe it could perform fuzzy search when string starts with some special character. As adding toggles to all places expecting text must be pretty difficult. e.g. "can" - regular, "~can" - fuzzy. |
or maybe we could improve the logic to make |
Right, that would also work. In fact, you don't really need to bother with scoring - instead you can rely on simple assumption that strict matches are most accurate. |
makes sense. about designing API, what do you think of this approach?
This approach would let us incrementally implement better fuzzy-searching algorithm. |
That'll break alphabetical sorting. I'd change step 4 to "sort by score, and then alphabetically within same score groups" |
alright. that sounds good. will investigate further. |
And, also, if it does scoring anyway, it might make sense to have multiple scores even for strict search, not just |
setting it to draft until mentioned changes are done. |
Purpose of change
improve ergonomics of filtering items.
Describe the solution
lcmatch
now usesstd::wregex
to fuzzy-search items.e.g
mgzn
->m.*?g.*?z.*?n
this isn't the best fuzzy search algorithm, however it's not too complex and supports complex fuzzy searching in korean (e.g match '감' with either 'ㄱ' or '가')
Describe alternatives you've considered
using
std::locale
on language.cppdiff
filtering entries by regex relevance in
uilist::filterlist
this would be a big change, thus deserves its own PR.
Testing
added
string_fuzzy_search_test.cpp
.fuzzy search in english
english.mp4
fuzzy search in korean
korean.mp4
Additional context
reference: https://taegon.kim/archives/9919