1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

Merge pull request #182 from maxbachmann-forks/master

use rapidfuzz instead of fuzzywuzzy
This commit is contained in:
Igor Chubin
2020-03-29 19:44:38 +02:00
committed by GitHub
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import sys
import os
import collections
from fuzzywuzzy import process, fuzz
from rapidfuzz import process, fuzz
from config import CONFIG
from .adapter import Adapter
@@ -120,7 +120,7 @@ class UnknownPages(InternalPages):
else:
topics_list = [x for x in topics_list if not x.startswith(':')]
possible_topics = process.extract(topic, topics_list, scorer=fuzz.ratio)[:3]
possible_topics = process.extract(topic, topics_list, limit=3, scorer=fuzz.ratio)
possible_topics_text = "\n".join([(" * %s %s" % x) for x in possible_topics])
return """
Unknown topic.
+1 -2
View File
@@ -4,7 +4,7 @@ flask
requests
pygments
dateutils
fuzzywuzzy
rapidfuzz
redis
colored
langdetect
@@ -14,4 +14,3 @@ PyICU
pycld2
colorama
pyyaml
python-Levenshtein