← string_distance operator page · string/string_distance/jaro_winkler_sc/disjoint_strings

Disjoint strings 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

string_distance(jaro_winkler, SC_1, SC_2) with SC_1 = FOO and SC_2 = BAR: two strings that have no character in common, the other case whose distance needs no approximation, with Identical strings.

Manual:

String distances: string_distance(jaro_winkler, "FOO", "BAR") gives "a value between 0 and 1", and jaro_winkler "Returns the Jaro–Winkler distance, which is a string metric measuring an edit distance between two sequences", with no formula; the Wikipedia article that it links says that "the distance is defined as the inversion of that value (distance = 1 − similarity)" (read on 2026-10-24).

Expected:

SC_r is 1, a Number: with no matching character the Jaro similarity is 0 ("If no matching characters are found then the strings are not similar"), and the Winkler boost, proportional to a common prefix of 0, adds nothing, so the distance is 1 − 0.

script.vtl ⇩

SC_r := string_distance(jaro_winkler, SC_1, SC_2);

input/scalars.csv ⇩

SC_1SC_2
FOOBAR

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "String"},
    {"name": "SC_2", "type": "String"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_r", "type": "Number", "value": 1}
  ]
}