strings.jaro_winkler¶
https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance
Attributes¶
Functions¶
|
Jaro-Winkler distance is a string metric measuring an edit distance between two |
Module Contents¶
- strings.jaro_winkler.jaro_winkler(str1: str, str2: str) float¶
Jaro-Winkler distance is a string metric measuring an edit distance between two sequences. Output value is between 0.0 and 1.0.
>>> jaro_winkler("martha", "marhta") 0.9611111111111111 >>> jaro_winkler("CRATE", "TRACE") 0.7333333333333334 >>> jaro_winkler("test", "dbdbdbdb") 0.0 >>> jaro_winkler("test", "test") 1.0 >>> jaro_winkler("hello world", "HeLLo W0rlD") 0.6363636363636364 >>> jaro_winkler("test", "") 0.0 >>> jaro_winkler("hello", "world") 0.4666666666666666 >>> jaro_winkler("hell**o", "*world") 0.4365079365079365
Matched positions cannot be reused as literal spaces. >>> round(jaro_winkler(“aa “, “aa”), 6) 0.911111 >>> round(jaro_winkler(“a a”, “aa”), 6) 0.9
Repeated characters must be consumed inside the matching window. >>> round(jaro_winkler(“aabb”, “bab”), 6) 0.722222
- strings.jaro_winkler.size = 2000¶