def wiki(self, query, amount=5, threshold=50):
best = BestHandler()
best.add(0, ('HOME', WIKI_URL))
if query != '':
for name, link in self._wiki.items():
score = fuzz.ratio(query.lower(), name.split(ARROW_CHARACTER)[-1].strip().lower())
best.add(score, (name, link))
return best.to_list(amount, threshold)
评论列表
文章目录