smatch
Approximate string matching for go.
This packages uses the Levenshtein distance algorithm implemented in edi(Edit distance calculator)
go get git.markveres.ro/mark/smatch
package main
import "git.markveres.ro/mark/smatch"
func main() {
choices := []string{"Hello world", "Hellow world!", "hello friends", "hello their"}
smatch.Ratio("ab", "ac") // 0.5
smatch.Percent("ab", "ac") // 50
smatch.Match("hello there", choices)
// [{hello their 75} {hello friends 53} {Hello world 50} {Hellow world! 46}]
}
Read more about Approximate string matching on wikipedia.