class LanguageHelper: #define languagehelper class def __init__(self,languagefile): self._languagefile = open(raw_input('Enter the name of the language file: ')) print 'Please enter the filename for the language: ' #get the dictionary file file_path = raw_input() file_open = open(file_path, 'r') #open the user file language = list() #create an internal list for line in open(file_path): language.append(line) #add words to internal list userfile = file(raw_input('Enter the filename you wish to correct: ')) #ask the user for his file to fix tofix = list() #create an internal list for line in userfile: tofix.append(line) #add userfile words to list getSuggestions(self, word):
I'm trying to get it to run like this:
Open up the program and have it ask where the language file is(English.txt) and store it internally in a list.
Ask to open up a file the user wants spell checked, and then what they want to name the final fixed version.
Then the program would ideally iterate through the users file and put suggestions for spelling mistakes such as this:
3. 1st suggestion
4. 2nd suggestion
I'm not sure how I would go about this by defining a class around it, but I would appreciate any help.