Day146 — fuzzy match

Jacky Tsang
1 min readMay 19, 2021

--

Fuzzy match uses Levenshtein Distance to calculate the similarity between two strings.

ratio

compare two strings directly

partial_ratio

use “ ” as a separator to split the string. compare the strings in that list of separated strings. return the highest score.

token_sort_ratio

use “ ” as a separator to split the string. sort the list before comparing.

token_set_ratio

use “ ” as a separator to split the string. convert to a set that removes duplication before comparing.

Speeder version of FuzzyWuzzy.

Number does not lie.

--

--

No responses yet