@创建于20220220
@修改于20220220
安装了fuzzywuzzy
且使用了 python-Levenshtein 包
from fuzzywuzzy import fuzz
s1 = ‘abc’
s2 = ‘🔪’
s3 = ‘马𨟠村民委员会’
print(fuzz.partial_ratio(s1, s2))
print(fuzz.partial_ratio(s1, s3))
不使用python-Levenshtein运行正确,使用则错误。
特别警示:
𨟠不能被python-Levenshtein包使用utf-8正确编译
原因:
python-Levenshtein package doesn’t handle UTF-8 input properly.
参考链接:FuzzyWuzzy throwing ValueError when reading string array