TheFuzz.Similarity.NGram (TheFuzz v0.6.0)
View SourceThis module contains functions to calculate the ngram distance between two given strings based on this paper
Summary
Functions
Calculates the ngram similarity between two given strings with a default ngram size of 2
Calculates the ngram similarity between two given strings with a specified ngram size
Functions
Calculates the ngram similarity between two given strings with a default ngram size of 2
Examples
iex> TheFuzz.Similarity.NGram.compare("context", "contact")
0.5
iex> TheFuzz.Similarity.NGram.compare("ht", "nacht")
0.25
Calculates the ngram similarity between two given strings with a specified ngram size
Examples
iex> TheFuzz.Similarity.NGram.compare("night", "naght", 3)
0.3333333333333333
iex> TheFuzz.Similarity.NGram.compare("context", "contact", 1)
0.7142857142857143