mirror of
https://github.com/chubin/cheat.sh.git
synced 2025-01-06 04:16:04 +03:00
Merge pull request #182 from maxbachmann-forks/master
use rapidfuzz instead of fuzzywuzzy
This commit is contained in:
commit
0f011a0e84
@ -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.
|
||||
|
@ -4,7 +4,7 @@ flask
|
||||
requests
|
||||
pygments
|
||||
dateutils
|
||||
fuzzywuzzy
|
||||
rapidfuzz
|
||||
redis
|
||||
colored
|
||||
langdetect
|
||||
@ -14,4 +14,3 @@ PyICU
|
||||
pycld2
|
||||
colorama
|
||||
pyyaml
|
||||
python-Levenshtein
|
||||
|
Loading…
Reference in New Issue
Block a user