Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 528 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 528 Bytes

Fuzzy search library for nim

There are two important methods fuzzyMatch and fuzzyMatchSmart.

the usage is really straight forward:

var s1 = "foo bar baz"
var s2 = "bAz"
var s3 = "fobz"
var s4 = "bra"

echo fuzzyMatchSmart(s1, s2)  # => 1.0
echo fuzzyMatchSmart(s1, s3)  # => 0.5
echo fuzzyMatchSmart(s1, s4)  # => 0.6

`fuzzyMatchSmart` tries to be smart about the strings so it does:
- lowercase whole string
- sorts substrings splitted by `" "`
- best matching substring of the length of the shorter one