Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THIS IS FOR PYTHON -----> Write a file named spellcheck.py that checks the user-entered text for misspelled words. Do this by reading a list of

THIS IS FOR PYTHON ----->

Write a file named spellcheck.py that checks the user-entered text for misspelled words.

Do this by reading a list of correctly spelled words from http://cs1110.cs.virginia.edu/files/words.txt the file has one word per line.

Then read lines of user-entered text; list any misspelled words in what they entered, and keep reading lines until they enter a blank line. Strip off any leading or trailing punctuation before checking the word (i.e., strip .?!,()"'). Only list a word as misspelled if it does not appear either in the case they typed it or in lower-case form.

Your program should read the list of words from the web only once per run of the program, no matter how many lines of text the user types in a given run. image text in transcribedWrite a file

2. Example Invocations An example run of the program might look like: Type text; enter a blank line to end "'But oh, beamish nephew, beware of the day, MISSPELLED: beamish If your Snark be a Boojum ! For then MISSPELLED: Snark MISSPELLED: Boojum You will softly and suddenly vanish away, And never be met with again !" 3. Thought Question How hard would it be to handle hyphenated words? To only permit capitalized words if they appear capitalized in the word list or start a sentence? To let the user specify which word list they want (or allow several word lists)? To have multiple dictionaries (e.g., for multiple languages) and infer the language based on which reports the fewest misspellings? As always with such enhancements, don't submit them if you implement them. 4. Troubleshooting Did you remember to decode and strip the lines of text you read from the website? Match our formatting exactly, including having a line printed up front and then no prompt in the input s for each line the user types putting two spaces before the all-caps MISSPELLED: reporting misspellings in the order they appear within the line Capitalization sometimes matters. For example, Abe is spelled correctly (because it is a common nick-name) but abe is not (because it is not an English word). A few more examples: User enters Dictionary has Decision Abe Abe correctly spelled abe Abe misspelled Abjure abjure correctly spelled abjure abjure correctly spelled ecmascript ECMAScript misspelled Ecmascript ECMAScript misspelled ECMAScript ECMAScript misspelled ECMAScript ECMAScript correctly spelled Confused how to read the page only once? Try reading the page into a list of words before you do any spellchecking

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Advance warning and an explanation for the layoff.

Answered: 1 week ago