TheFuzz v0.5.0 TheFuzz.Similarity.Jaccard View Source
This module contains functions to calculate the Jaccard similarity coefficient between two given strings
Link to this section Summary
Functions
Calculates the Jaccard similarity coefficient between two given strings with a default ngram size of 2
Calculates the Jaccard similarity coefficient between two given strings with the specified ngram size
Link to this section Functions
Link to this function
compare(a, b) View Source
Calculates the Jaccard similarity coefficient between two given strings with a default ngram size of 2
Examples
iex> TheFuzz.Similarity.Jaccard.compare("contact", "context")
0.3333333333333333
iex> TheFuzz.Similarity.Jaccard.compare("ht", "hththt")
0.2
Link to this function
compare(a, b, n) View Source
Calculates the Jaccard similarity coefficient between two given strings with the specified ngram size
Examples
iex> TheFuzz.Similarity.Jaccard.compare("contact", "context", 3)
0.25
iex> TheFuzz.Similarity.Jaccard.compare("contact", "context", 1)
0.5555555555555556