User Tools

Site Tools


syntax:functions:distance

distance(text, text)

The edit distance between two text strings calculated as the Damerau-Levenshtein distance. It shows the number of text edits such as character insertion or deletion is needed to produce one text string from another. It's used to measure a degree of variance between two strings. The bigger is the edit distance, the more different the strings are.

Example Result
distance(“cat”, “cat”) 0
distance(“cat”, “cut”) 1
distance(“cat”, “dog”) 3
distance(“cat”, “Scott”) 3

Use cases: fuzzy matching, detection of mistyped words.

syntax/functions/distance.txt · Last modified: 2018/03/01 14:24 by dmitry