Documentation
¶
Index ¶
- func DamerauLevenshteinDistance(s1, s2 string) int
- func JaccardSimilarity(s1, s2 string, f func(string) mapset.Set) float64
- func JaroDistance(s1, s2 string) (float64, int)
- func JaroWinklerDistance(s1, s2 string) float64
- func LevenshteinDistance(s1, s2 string) int
- func Max(is ...int) int
- func Min(is ...int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DamerauLevenshteinDistance ¶
DamerauLevenshteinDistance calculates the damerau-levenshtein distance between s1 and s2. Reference: [Damerau-Levenshtein Distance](http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance) Note that this calculation's result isn't normalized. (not between 0 and 1.) and if s1 and s2 are exactly the same, the result is 0.
func JaccardSimilarity ¶
JaccardSimilarity, as known as the Jaccard Index, compares the similarity of sample sets. This doesn't measure similarity between texts, but if regarding a text as bag-of-word, it can apply.
func JaroDistance ¶
JaroDistance calculates jaro distance between s1 and s2. This implementation is influenced by an implementation of [lucene](http://lucene.apache.org/) Note that this calculation's result is normalized ( the result will be bewtwen 0 and 1) and if t1 and t2 are exactly the same, the result is 1.0. This function returns distance and prefix (for jaro-winkler distance)
func JaroWinklerDistance ¶
JaroWinklerDistance calculates jaro-winkler distance between s1 and s2. This implementation is influenced by an implementation of [lucene](http://lucene.apache.org/) Note that this calculation's result is normalized ( the result will be bewtwen 0 and 1) and if t1 and t2 are exactly the same, the result is 1.0.
func LevenshteinDistance ¶
LevenshteinDistance calculates the levenshtein distance between s1 and s2. Reference: [Levenshtein Distance](http://en.wikipedia.org/wiki/Levenshtein_distance) Note that this calculation's result isn't normalized. (not between 0 and 1.) and if s1 and s2 are exactly the same, the result is 0.
Types ¶
This section is empty.