fuzzywuzzy
fuzzywuzzy copied to clipboard
process.extractOne does not match fuzz.ratio
Using the process.extractOne and fuzz.ratio give different results in this case:
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
stringToMatch = 'Florinia-SP'
possibleResults = ['São Bernado do Campo-SP', 'Florínea-SP']
print(fuzz.ratio(stringToMatch,possibleResults[0]))
print(fuzz.ratio(stringToMatch,possibleResults[1]))
print(process.extract(stringToMatch,possibleResults))
While the individual fuzz.ratio
give correct results (41 for the lowest score and 82 for the highest score), the process.extract
gives 86 for both of them.