Documentation ¶
Overview ¶
textdistance provides a set of string comparison functions for different applications. It includes a set of algorithms: * Hamming * Jaccard * Match Rating Approach * Sorenson Dice
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WordsToSet ¶
Types ¶
type Hamming ¶
type Hamming struct { }
Hamming structure incorporates methods for computing distance and similarity on Hamming.
type Jaccard ¶
func NewJaccard ¶
func NewJaccard() Jaccard
NewJaccard returns a Jaccard structure with the StringToSet set to the default WordsToSet
type Levenshtein ¶
type Levenshtein struct { }
func NewLevenshtein ¶
func NewLevenshtein() Levenshtein
NewLevenshtein returns a Levenshtein structure
type MRA ¶
type MRA struct { }
func (MRA) Encoding ¶
Encoding returns the encoded MRA string according to the match rating approach. Encoding follows the following steps:
1. Delete all vowels unless the vowel begins the word 2. Remove the second consonant of any double consonants present 3. Reduce codex to 6 letters by joining the first 3 and last 3 letters only
From Wikipedia: https://en.wikipedia.org/wiki/Match_rating_approach
type Overlap ¶
func NewOverlap ¶
func NewOverlap() Overlap
NewOverlap returns a Overlap structure with the StringToSet set to the default WordsToSet
type Similarity ¶
Similarity is a normalised measure of the distance between 0 and 1
type SorensonDice ¶
func NewSorensonDice ¶
func NewSorensonDice() SorensonDice
NewSorensonDice returns a SorensonDice structure with the StringToSet set to the default WordsToSet
func (SorensonDice) Similarity ¶
func (s SorensonDice) Similarity(s1, s2 string) (float64, error)
type SymmetricalTversky ¶
func NewSymmetricalTversky ¶
func NewSymmetricalTversky(alpha, beta float64) SymmetricalTversky
NewSymmetricalTversky returns a SymmetricalTversky structure with the StringToSet set to the default WordsToSet
func (SymmetricalTversky) Similarity ¶
func (t SymmetricalTversky) Similarity(s1, s2 string) (float64, error)