Fácil comparação de similaridade de string na lista python
import difflibimport itertools# min similarity ratio between stringsthreshold_ratio = 0.75for str_1, str_2 in itertools.combinations(str_list, 2): ratio = difflib.SequenceMatcher(None, str_1, str_2).ratio() if (ratio > threshold_ratio): print ‘%ft%stt could be tt%s’ % …
Continuar lendo