Module nlp::distance [] [src]

Distance module (Levenshtein, Jaro, Jaro-winkler)

Functions

jaro

Calculates the Jaro similarity between two strings. The returned value is between 0.0 and 1.0 (higher value means more similar).

jaro_winkler

Like Jaro but gives a boost to strings that have a common prefix.

levenshtein

Calculates the minimum number of insertions, deletions and substitutions required to change on string into the other.

levenshtein_against_vec

Calculates the levenshtein distance between a string and each string in a vector. Returns a vector of corresponding values.