Skip to content

Instantly share code, notes, and snippets.

@alext234
Last active November 1, 2018 21:01
Show Gist options
  • Save alext234/e0fb89d828c45081c50889c03d4a85c0 to your computer and use it in GitHub Desktop.
Save alext234/e0fb89d828c45081c50889c03d4a85c0 to your computer and use it in GitHub Desktop.
test closestmatch
package main
import (
"fmt"
"github.com/schollz/closestmatch"
)
func main() {
wordsToTest := []string{"MERCEDES (ID000001)",
"Ford", "Bmw", "Another name", "MAZDA(User005)", "Toyota", "Toyota Corp"}
// Choose a set of bag sizes, more is more accurate but slower
bagSizes := []int{2,3,4,5,6,7,8,9,10}
// Create a closestmatch object
cm := closestmatch.New(wordsToTest, bagSizes)
fmt.Println(cm.Closest("MERCEDES")) // returns empty?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment