我使用Pythonfuzzywuzzy
在句子列表中查找匹配项:
def getMatches(needle):
return process.extract(needle, bookSentences, scorer=fuzz.token_sort_ratio, limit=3)
我正试着打印出匹配的句子:
^{pr2}$很遗憾,脚本在原始列表中找不到匹配项:
ValueError: (u'Thus, in addition to the twin purposes mentioned above, this book is written for at least two groups: 1.', 59) is not in list
有没有更好的方法可以在原始列表中找到匹配项的索引?能给我一点吗?在readme里似乎没有关于它的任何东西。在
如何获得fuzzywuzzy
返回的匹配项的原始列表中的索引?在
我觉得有点傻。
fuzzywuzzy
返回一个包含分数的元组,而不仅仅是匹配项。解决方案:相关问题 更多 >
编程相关推荐