closestmatch
closestmatch copied to clipboard
Uppercases throw off the matcher
Thanks for the useful tool. It seems that the matcher does not deal well with uppercases. For instance:
import (
"fmt"
"github.com/schollz/closestmatch"
)
func main() {
fmt.Println("Hello, playground")
words := []string{
"foo",
"bar",
"faz",
}
bagSize := []int{2}
cm := closestmatch.New(words, bagSize)
fmt.Println(cm.Closest("fooo"))
fmt.Println(cm.Closest("FOO"))
}
https://play.golang.org/p/M9IMnrqRUsG does not find anything for FOO.
@JazzyPierrot: Looks like closestmatch
normalizes all entries to lowercase. So you can work around by sanitizing your input the same way.