:pig: Go 中的小巧而快速的模糊搜索
Inspired by bevacqua/fuzzysearch, a fuzzy matching library written in JavaScript. But contains some extras like ranking using Levenshtein distance and finding matches in a list of words.
Fuzzy searching allows for flexibly matching a string with partial input, useful for filtering data very quickly based on lightweight user input.
The current implementation uses the algorithm suggested by Mr. Aleph, a russian compiler engineer working at V8.
go get github.com/lithammer/fuzzysearch/fuzzy…You can sort the result of a fuzzy.RankFind() call using the sort
package in the standard library:
matches := fuzzy.RankFind("whl", words) // [{whl cartwheel 6 0} {whl wheel 2 2}]
sort.Sort(matches) // [{whl wheel 2 2} {whl cartwheel 6 0}]See the fuzzy package documentation for more examples.
MIT
暂无开放 Issues,或尚未同步最近议题。