← string_distance operator page · string/string_distance/levenshtein_sc/one_deletion
pandas ✅ · DuckDB ✅
string_distance(levenshtein, SC_1, SC_2) with SC_1 = foo and SC_2 = fo, the Levenshtein distance of two scalars.
String distances: "Returns the Levenshtein distance, which is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into another.", as in string_distance(levenshtein, "foo", "fo") gives 1.
SC_r is 1, a Number: delete the last o.
SC_r := string_distance(levenshtein, SC_1, SC_2);
| SC_1 | SC_2 |
|---|---|
| foo | fo |
{
"scalars": [
{"name": "SC_1", "type": "String"},
{"name": "SC_2", "type": "String"}
]
}
{
"scalars": [
{"name": "SC_r", "type": "Number", "value": 1}
]
}