Skip to content

Instantly share code, notes, and snippets.

@guilleJB
Forked from ecarreras/fuzzy.py
Created August 6, 2013 11:18
Show Gist options
  • Save guilleJB/6163650 to your computer and use it in GitHub Desktop.
Save guilleJB/6163650 to your computer and use it in GitHub Desktop.
from fuzzywuzzy import process
from fuzzywuzzy.utils import full_process
def processor(choice):
return full_process(choice['name'])
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