Python Problem: Spell Checker (20 points) The problem reviews material we covered on strings, files, anddictionaries. You
Question:
Python
Problem: Spell Checker (20 points)
The problem reviews material we covered on strings, files, anddictionaries.
You will write a simple spell checker that uses the officialScrabble players list of words to check all the words in asentence.
Part 1: (8 points)
The first thing your program should do is read a the list ofcorrectly spelled words into a datastructure that you can use tofind them. For this problem the datastructure only needs to supportthe in Boolean operator to determine ifa word is present. A list will work fine for this, more advanceddatastructures like the dictionary or set (not covered) would alsowork and provide more speed.
The main function will test if you have build the datastructureby printing its length. Running the updated program should producethe following one line result:
267751 words read into spelling dictionary
Part 2: (8 points)
Next you will implement thefunction check_sentence. The function takesone argument which is the list of words created in Part 1. The completed function will prompt the user for asentence to check. It will look at each word in the sentence andprint out those words it did not find in the list of correctlyspelled words.
For example entering "The quick brown foxx played in the rain inSpain on the plain." should identify the words "The", "foxx","Spain", and "plain." as misspelled because these words do notexactly appear in the word list.
Enter a sentence to check:The quick brown foxx played in the rain in Spain on the plain.ThefoxxSpainplain.
Part 3: (4 points)
To improve your spell checker, your program will convert wordsto lower case before looking them up in the dictionary. It willalso clean the words by removing any punctuation on the ends. Thiscleaning process is described in lecture 23. When the example above is re-run, only the word "foxx" is identified asmisspelled. The words The and Spain are found in the word list inlower case, and plain is found after the period is removed.
Enter a sentence to check:The quick brown foxx played in the rain in Spain on the plain.foxx
Fundamentals of Cost Accounting
ISBN: 978-0077398194
3rd Edition
Authors: William Lanen, Shannon Anderson, Michael Maher