Skip to content

Instantly share code, notes, and snippets.

@ejmurray
Created September 7, 2015 15:04
Show Gist options
  • Save ejmurray/9ad34fa9de26359998b7 to your computer and use it in GitHub Desktop.
Save ejmurray/9ad34fa9de26359998b7 to your computer and use it in GitHub Desktop.
updtaed with helper.py
#!/usr/bin/env python
__author__ = 'Ernest'
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
import helper
import sys
reload(sys)
sys.setdefaultencoding('utf8')
new_search = raw_input("Enter the name of a compound > ")
# create an empty list of all the compounds - this is kept in the coupound.txt file
compounds_in_list = []
for word in helper.wordlist:
compounds_in_list.append(word) # add the compounds to the list
# print compounds_in_list
c = process.extract(new_search, compounds_in_list, limit=5)
print "The names of the compounds that are the same or similar to " + "\"" + new_search + "\"" + "are:"
print c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment