fuzzywuzzy / helper.py
sqy-harshil's picture
Create helper.py
ef2509f
raw
history blame contribute delete
299 Bytes
from fuzzywuzzy import fuzz, process
from constants import builders
def find_best_match(query):
best_matches = process.extractBests(query, choices=builders, scorer=fuzz.token_set_ratio, limit=3)
best_matches.insert(0, " ")
return "\n".join([str(item[0]) for item in best_matches])