🐛 Update editops() and seq_align() due to RapidFuzz API changes

pull/73/head
Gerber, Mike 2 years ago
parent 15dfbac3a7
commit c4e85da5ab

@ -22,7 +22,7 @@ def seq_align(s1, s2):
try: try:
ot = ops[0] ot = ops[0]
if ot[1] == i and ot[2] == j: if ot[1] == i and ot[2] == j:
ops = ops[1:] del ops[0]
o = ot o = ot
except IndexError: except IndexError:
pass pass

@ -40,4 +40,4 @@ def editops(word1, word2):
""" """
word1 = list(grapheme_clusters(unicodedata.normalize("NFC", word1))) word1 = list(grapheme_clusters(unicodedata.normalize("NFC", word1)))
word2 = list(grapheme_clusters(unicodedata.normalize("NFC", word2))) word2 = list(grapheme_clusters(unicodedata.normalize("NFC", word2)))
return Levenshtein.editops(word1, word2) return Levenshtein.editops(word1, word2).as_list()

Loading…
Cancel
Save