Created
September 7, 2015 15:04
-
-
Save ejmurray/9ad34fa9de26359998b7 to your computer and use it in GitHub Desktop.
updtaed with helper.py
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
#!/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