Skip to content

Instantly share code, notes, and snippets.

@ejmurray
Created September 4, 2015 15:41
Show Gist options
  • Save ejmurray/c70b2da2d179a466f5c0 to your computer and use it in GitHub Desktop.
Save ejmurray/c70b2da2d179a466f5c0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
__author__ = 'Ernest'
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
COMPOUND_LIST = "compounds.txt"
wordlist = open(COMPOUND_LIST).readlines()
# Get rid of newlines
wordlist = [word.lower().strip() for word in wordlist]
for word in wordlist:
print word
choices = ["YH3945", "Procarbazineide", "Procarbazine-N-oxide", "Dallas Cowboys"]
c = process.extract("Procarb", choices, limit=2)
print c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment