Skip to content

Commit

Permalink
use rapidfuzz instead of fuzzywuzzy (#92)
Browse files Browse the repository at this point in the history
Signed-off-by: maxbachmann <ssh@maxbachmann.de>
  • Loading branch information
maxbachmann authored Jul 13, 2020
1 parent 155def8 commit 4508d0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill, intent_handler
from mycroft.util.log import getLogger
from fuzzywuzzy import fuzz
from rapidfuzz import fuzz

import requests
import json
Expand Down Expand Up @@ -167,7 +167,7 @@ def findItemName(self, itemDictionary, messageItem):

try:
for itemName, itemLabel in list(itemDictionary.items()):
score = fuzz.ratio(messageItem, itemLabel)
score = fuzz.ratio(messageItem, itemLabel, score_cutoff=bestScore)
if score > bestScore:
bestScore = score
bestItem = itemName
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
requests>=2.10.0
fuzzywuzzy==0.14.0
python-Levenshtein==0.12.0
rapidfuzz==0.7.6

0 comments on commit 4508d0b

Please sign in to comment.