Created
September 1, 2020 12:32
-
-
Save lucascheung/a95c38a4ff0e03f93473c163205e91df to your computer and use it in GitHub Desktop.
Autocorrect misspelled words from a master list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fuzzywuzzy import process | |
def find_best_match(misspelled, correct_names): | |
closest, ratio = process.extractOne(misspelled, correct_names) | |
return closest | |
print(find_best_match('noo yurk', ['New York', 'Boston', 'Washington'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment