Fuzzy: replace thefuzz with jellyfish

GPL -> BSD2Clause and should be faster though I haven't tested it myself and just trusted people on the internet.
Jellyfish also allows us access to many more algorithms should they be any better. Trying out Jaro distance now instead of Levenshtein.
This commit is contained in:
Fabian Dill
2022-05-09 07:18:50 +02:00
committed by KonoTyran
parent a020dea277
commit 513ab62ce7
4 changed files with 14 additions and 8 deletions

View File

@@ -24,8 +24,6 @@ ModuleUpdate.update()
import websockets
import colorama
from thefuzz import process as fuzzy_process
import NetUtils
from worlds.AutoWorld import AutoWorldRegister
@@ -907,7 +905,7 @@ def json_format_send_event(net_item: NetworkItem, receiving_player: int):
def get_intended_text(input_text: str, possible_answers) -> typing.Tuple[str, bool, str]:
picks = fuzzy_process.extract(input_text, possible_answers, limit=2)
picks = Utils.get_fuzzy_results(input_text, possible_answers)
if len(picks) > 1:
dif = picks[0][1] - picks[1][1]
if picks[0][1] == 100: