Last active
November 1, 2018 21:01
-
-
Save alext234/e0fb89d828c45081c50889c03d4a85c0 to your computer and use it in GitHub Desktop.
test closestmatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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