Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED THE UML DIAGRAM! Q) Write a spell checker that stores a set of words, W, in a hash table and implements a function, spellCheck(s)

NEED THE UML DIAGRAM!

Q) Write a spell checker that stores a set of words, W, in a hash table and implements a function,spellCheck(s), which performs a spell check on the string swith respect to the set of words, W.

If s is in W, then the call to spellCheck(s) returns an iterable collection that contains only s, because it is assumed to be spelled correctly in this case. Otherwise, if s is not in W, then the call to spellCheck(s) returns a list of every word in W that could be a correct spelling of s.

Your program should be able to handle all the common ways that s might be a misspelling of a word in W,including:

- swapping adjacent characters in a word;

- inserting a single character in between two adjacent characters in a word;

- deleting a single character from a word; and

- replacing a character in a word with another character.

The input to your program will consist of the name of a text file, and strings of characters manually entered by the user. The text file will contain the set of words, W, one word per line, and should be read in the program when the program starts. The strings of characters input by the user will be used to test the hash table and the spellCheck function. The program will keep running the tests until the user enters the string "quit".

Create classes SpellChecker and HashTable to implement the spell checker and the hash table, respectively. Create a UML class diagram that describes your class design.

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

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

describe the main employment rights as stated in the law

Answered: 1 week ago