参考:
Python difflib.get_close_matches实例讲解 - 码农教程
使用difflib.get_close_matches来替换字符串中的单词 - Python
用法:
difflib.get_close_matches(word, possibilities, n=3, cutoff=0.6)
样例:
>>> get_close_matches('appel', ['ape', 'apple', 'peach', 'puppy'])
['apple', 'ape']
可以用于相似度匹配