Akin.SorensenDice (Akin v0.1.7) View Source
Functions to calculate the Sorensen-Dice coefficient of two strings.
Link to this section Summary
Functions
Calculates the Sorensen-Dice coefficient of two given strings with a specified ngram size passed as the third argument.
Link to this section Functions
Specs
compare( %Akin.Corpus{ list: term(), original: term(), set: term(), stems: term(), string: term() }, %Akin.Corpus{ list: term(), original: term(), set: term(), stems: term(), string: term() }, Keyword.t() ) :: float()
Calculates the Sorensen-Dice coefficient of two given strings with a specified ngram size passed as the third argument.
Examples
iex> Akin.SorensenDice.compare(%Akin.Corpus{string: "night"}, %Akin.Corpus{string: "nacht"}, [ngram_size: 1]) 0.6 iex> Akin.SorensenDice.compare(%Akin.Corpus{string: "night"}, %Akin.Corpus{string: "nacht"}, []) 0.25 iex> Akin.SorensenDice.compare(%Akin.Corpus{string: "night"}, %Akin.Corpus{string: "nacht"}, [ngram_size: 3]) 0.0