Documentation
¶
Overview ¶
GoFuzz is a collection of metrics and phonetic (fuzzy string matching) algorithms for Go.
All of the phonetic functions are defined within the 'phon' subdirectory, and all of the similarity functions are defined within the 'sim' subdirectory. They are also set up to be called from the gofuzz package, whichever is easier.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Jaro ¶
Jaro calculates the Jaro distance between two strings.
Example ¶
result, err := Jaro("bob", "bobby")
if err != nil {
fmt.Print("an unexpected error was encountered")
}
fmt.Print(result)
Output: 0.75555557
func JaroWinkler ¶
JaroWinkler calculates the Jaro-Winkler distance between two strings.
Example ¶
result, err := JaroWinkler("bob", "bobby")
if err != nil {
fmt.Print("an unexpected error was encountered")
}
fmt.Print(result)
Output: 0.8288889
func Metaphone ¶
Metaphone returns the metaphone phonetic version of the provided string.
Example ¶
result, err := Metaphone("Colorado")
if err != nil {
fmt.Print("an unexpected error was encountered")
}
fmt.Print(result)
Output: klrt
func MetaphoneMetric ¶
MetaphoneMetric compares two strings and returns a boolean of whether they match or not.
Example ¶
result, err := MetaphoneMetric("Colorado", "Kolorado")
if err != nil {
fmt.Print("an unexpected error was encountered")
}
fmt.Print(result)
Output: true
func Overlap ¶
Overlap calculates the Overlap distance between two strings.
Note: the ngramSize is the number of letters to clump together when doing the comparison. When in doubt, set it to 1.
Example ¶
result, err := Overlap("Chipotle", "Chipotle Mexican Grill", 2)
if err != nil {
fmt.Print("an unexpected error was encountered")
}
fmt.Print(result)
Output: 1
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Phon contains all of the functions for doing phonetic comparisons.
|
Phon contains all of the functions for doing phonetic comparisons. |
|
Sim contains all of the functions for calculating similarity.
|
Sim contains all of the functions for calculating similarity. |
|
Utl contains utility fuctions used by the GoFuzz library.
|
Utl contains utility fuctions used by the GoFuzz library. |