Documentation ¶
Index ¶
- Constants
- Variables
- func AbsInt(v int) int
- func CompareErrors(e1 error, e2 error) bool
- func Cosine(s []rune, t []rune, options ...CosineSimilarityOptions) float64
- func DotProductNGrams(m1, m2 map[string]int) int
- func EqualFloat64(x, y float64) bool
- func GetNGram(s string, NGramSizes []int) map[string]int
- func Hamming(s []rune, t []rune, options ...HammingSimilarityOptions) (int, error)
- func Jaccard(s []rune, t []rune, NGramSizes []int) float64
- func Jaro(s []rune, t []rune, options ...JaroSimilarityOptions) float64
- func JaroWinkler(s []rune, t []rune, options ...JaroSimilarityOptions) float64
- func LCS(s []rune, t []rune, options ...LCSSimilarityOptions) int
- func Levenshtein(s []rune, t []rune, options ...LevenshteinSimilarityOptions) int
- func Max(a int, b int) int
- func Min(a int, b int) int
- func NormNGram(m map[string]int) float64
- func QGram(s []rune, t []rune, options ...QGramSimilarityOptions) int
- func SameRune(a rune, b rune, caseInsensitive bool) bool
- type CosineSimilarityOptions
- type HammingSimilarityOptions
- type JaroSimilarityOptions
- type LCSSimilarityOptions
- type LevenshteinSimilarityOptions
- type QGramSimilarityOptions
- type SimilarityOptions
Constants ¶
View Source
const EPS = 0.000000001
Variables ¶
View Source
var DefaultCosineSimilarityOptions = CosineSimilarityOptions{ CaseInsensitive: false, NGramSizes: []int{2}, }
View Source
var DefaultHammingSimilarityOptions = HammingSimilarityOptions{ CaseInsensitive: false, }
View Source
var DefaultJaroSimilarityOptions = JaroSimilarityOptions{ CaseInsensitive: false, Threshold: 0.7, PValue: 0.1, LValue: 4, }
View Source
var DefaultLCSSimilarityOptions = LCSSimilarityOptions{ CaseInsensitive: false, }
View Source
var DefaultLevenshteinSimilarityOptions = LevenshteinSimilarityOptions{
InsertCost: 1,
DeleteCost: 1,
SubstituteCost: 1,
}
View Source
var DefaultQGramSimilarityOptions = QGramSimilarityOptions{ CaseInsensitive: false, NGramSizes: []int{2}, }
View Source
var HAMMING_ERROR_DIFFERENT_LENGTH = errors.New("Can't compare strings of different lengths")
Functions ¶
func CompareErrors ¶
func DotProductNGrams ¶
func EqualFloat64 ¶
func JaroWinkler ¶
func JaroWinkler(s []rune, t []rune, options ...JaroSimilarityOptions) float64
func Levenshtein ¶
func Levenshtein(s []rune, t []rune, options ...LevenshteinSimilarityOptions) int
Types ¶
type CosineSimilarityOptions ¶
type HammingSimilarityOptions ¶
type HammingSimilarityOptions struct {
CaseInsensitive bool
}
type JaroSimilarityOptions ¶
type LCSSimilarityOptions ¶
type LCSSimilarityOptions struct {
CaseInsensitive bool
}
type QGramSimilarityOptions ¶
type SimilarityOptions ¶
type SimilarityOptions struct {
CaseInsensitive bool
}
Click to show internal directories.
Click to hide internal directories.