use rapidfuzz instead of fuzzywuzzy (#92)
Signed-off-by: maxbachmann <ssh@maxbachmann.de>pull/102/head
parent
155def8db8
commit
4508d0bced
|
@ -18,7 +18,7 @@ from os.path import dirname
|
||||||
from adapt.intent import IntentBuilder
|
from adapt.intent import IntentBuilder
|
||||||
from mycroft.skills.core import MycroftSkill, intent_handler
|
from mycroft.skills.core import MycroftSkill, intent_handler
|
||||||
from mycroft.util.log import getLogger
|
from mycroft.util.log import getLogger
|
||||||
from fuzzywuzzy import fuzz
|
from rapidfuzz import fuzz
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
@ -167,7 +167,7 @@ class openHABSkill(MycroftSkill):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for itemName, itemLabel in list(itemDictionary.items()):
|
for itemName, itemLabel in list(itemDictionary.items()):
|
||||||
score = fuzz.ratio(messageItem, itemLabel)
|
score = fuzz.ratio(messageItem, itemLabel, score_cutoff=bestScore)
|
||||||
if score > bestScore:
|
if score > bestScore:
|
||||||
bestScore = score
|
bestScore = score
|
||||||
bestItem = itemName
|
bestItem = itemName
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
requests>=2.10.0
|
requests>=2.10.0
|
||||||
fuzzywuzzy==0.14.0
|
rapidfuzz==0.7.6
|
||||||
python-Levenshtein==0.12.0
|
|
Loading…
Reference in New Issue