Question: Exercise 1 . ( Spell Checker ) Write a program spell _ checker.py that accepts words from standard input; looks up each word in the

Exercise 1.(Spell Checker) Write a program spell_checker.py that accepts words from standard input; looks up each word in the file data/misspellings.txt that maps misspelled words to their correct spellings; and if it exists (ie, is misspelled), writes the word to standard output along with the correct spelling. - Python Only and Follow Directions Especially for While ...: Exercise 1.(Spell Checker) Write a program spell_checker.py that accepts words from standard input; looks up each word in the file data/misspellings.txt that maps misspelled words to their correct spellings; and if it exists (ie, is misspelled), writes the word to standard output along with the correct spelling. -"/workspace/project6 sucess but rather try to become man of value. Albert Einstein $ python3 spell checker.py Try nto to become a man of nto -> not sucess success spell checker.py from instream import InStream from symboltable import Symbol Table import stdio # Entry point. def main(): # Set in Stream to an input stream built from the file 'data/misspellings.txt'. # Set lines to the list of lines read from inStream. # Set misspellings to a new symbol table object. for in .. # For each line of the form 'misspelling correction') in lines... # Set tokens to the list obtained by splitting line using the split() method from str. # Insert the pair tokens [0]/tokens [1] into misspellings. while # As long as standard input is not empty... # Set word to a string read from standard input. # If word exists in misspellings, then it is misspelled. So write the word and the # correction to standard output, separated by the string '->. if main__'- name main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!