Last active
December 20, 2015 16:39
-
-
Save ecarreras/6163087 to your computer and use it in GitHub Desktop.
Exemple d'utilització de la llibreria fuzzywuzzy https://github.com/gisce/fuzzywuzzy
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 | |
| from fuzzywuzzy.utils import full_process | |
| def processor(choice): | |
| return full_process(choice[1]) | |
| res = process.extractOne(poblacio, poblacions_list, processor) | |
| if not res: | |
| print "Població no trobada: %s" % poblacio | |
| continue | |
| if res[1] >= 95: | |
| msg = "%s => %s (%s)" % (poblacio, res[0], res[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment