c-bata / go-prompt

Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
https://godoc.org/github.com/c-bata/go-prompt
MIT License
5.27k stars 346 forks source link

Consider better fuzzy match algorithm. #105

Open c-bata opened 5 years ago

c-bata commented 5 years ago

Suggestions

Fuzzy match filter is added at https://github.com/c-bata/go-prompt/pull/92. This is quite simple but some people might think this is not convenient in some situations.

For example, when you wanna input Cyrillic, matching results are below:

I think there are better fuzzy match algorithm for most of users, but I don't implement complex algorithm for maintainability. If there are some simple and elegant solutions, I wanna replace current implementation to it.

kalafut commented 5 years ago

The documentation in fyz has discussion and links that might generate some ideas: https://github.com/jhawthorn/fzy/blob/master/ALGORITHM.md