Supported in: Batch, Streaming
Compute the edit distance between two strings. Supports Levenshtein, indel, and Damerau-Levenshtein distance.
Expression categories: Distance measurement, String
Output type: Double | Integer
Description: String edit distance calculated using Levenshtein distance
Argument values:
levenshteinleftright| left | right | Output |
|---|---|---|
| hello | hello | 0 |
| hallo | hello | 1 |
| hlelo | hello | 2 |
| hello | hEllO | 2 |
| hello | hello, world! | 8 |
| hello | farewell | 6 |
Description: By setting ignore case to true, letters of different case are treated as equal. Here calculated using Damerau-Levenshtein distance.
Argument values:
damerau_levenshteinleftright| left | right | Output |
|---|---|---|
| hello | hello | 0 |
| hallo | hello | 1 |
| hlelo | hello | 1 |
| hello | hEllO | 0 |
| hello | hello, world! | 8 |
| hello | farewell | 6 |
Description: By setting normalize to true, the edit distance is normalized to a value between 0 and 1. Here calculated using indel distance.
Argument values:
indelleftright| left | right | Output |
|---|---|---|
| hello | hello | 0.0 |
| hallo | hello | 0.2 |
| hlelo | hello | 0.2 |
| hello | hEllO | 0.4 |
| hello | hello, world! | 0.4444444444444444 |
| hello | farewell | 0.5384615384615384 |
Argument values:
levenshteinleftright| left | right | Output |
|---|---|---|
| hello | null | null |
| null | hello | null |
| null | null | null |