TheFuzz.Similarity.DiceSorensen

This module contains functions to calculate the Sorensen-Dice coefficient of 2 given strings.

Source

Summary

compare(a, b)

Calculates the Sorensen-Dice coefficient of two given strings with the ngram size set to a default value of 2.

Examples

iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht")
0.25
iex> TheFuzz.Similarity.DiceSorensen.compare("context", "contact")
0.5
compare(a, b, ngram_size)

Calculates the Sorensen-Dice coefficient of two given strings with a specified ngram size passed as the third argument.

Examples

iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht", 1)
0.6
iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht", 2)
0.25
iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht", 3)
0.0

Functions

compare(a, b)

Calculates the Sorensen-Dice coefficient of two given strings with the ngram size set to a default value of 2.

Examples

iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht")
0.25
iex> TheFuzz.Similarity.DiceSorensen.compare("context", "contact")
0.5
Source
compare(a, b, ngram_size)

Calculates the Sorensen-Dice coefficient of two given strings with a specified ngram size passed as the third argument.

Examples

iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht", 1)
0.6
iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht", 2)
0.25
iex> TheFuzz.Similarity.DiceSorensen.compare("night", "nacht", 3)
0.0
Source