Question: Exercise 1 . ( Spell Checker ) Write a program spell _ checker.py that accepts words from standard input; looks up each word in the
Exercise Spell Checker Write a program spellchecker.py that accepts words from standard input; looks up each word in the file datamisspellingstxt 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 Spell Checker Write a program spellchecker.py that accepts words from standard input; looks up each word in the file datamisspellingstxt 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. workspaceproject sucess but rather try to become man of value. Albert Einstein $ python 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 'datamisspellingstxt # 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 tokens 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
