Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make this program using c++ The problem: Spell checker, an application of hashing Many applications such as word processors, text editors, and email clients, include

Make this program using c++

The problem: Spell checker, an application of hashing

Many applications such as word processors, text editors, and email clients, include a spell- checking feature. A spell checker's task is centered around searching for words in a potentially large wordlist and reports all of the misspelled words (i.e. words that are not found in the wordlist). An efficient search is critical to the performance of the spell checker, since it will be searching the wordlist not only for the words in the input, but possibly suggestions that it might like to make for each misspelling.

Objective

Implement a spell checker that reads a wordlist from a file (wordlist.txt), stores the list of words in a hash table using separate chaining (i.e. linked lists) to resolve collisions, then spell- check an input file. For each misspelling found in the input file, your program will report it, along with a list of 5 suggestions (i.e. 5 closest words from the wordlist).

Suggested closest words

Definition of closest in this assignment follows the Hamming-Distance concept. Distance between two strings follows the algorithm below:

For two strings A, B. A match occurs at position k if A(k) = B(k). M = # of matches Distance = Number of mismatches D = max (length(A) , length(B)) M

D = 0 if A and B are identical

For each misspelled word, starting with the same first character find the list of five closest words from the wordlist using the above algorithm.

Hashing function Your spell checker is case insensitive. The hashing function is h2(h1(key)) where key is the string such that:

L?1 TheHashcodemap:h(S)= int(S)?i,where?=26.

? i=0

i

1 The Compression Map: h2(K)?[0, N-1], where N is the table size

The hashTable ADT

The hashTable ADT can be implemented using a Simple Linked List (SLL) with the following member functions:

Constructor: Construct an empty table

Destructor: Destroy table

MakeTableEmpty: Empty whole table

TableIsEmpty : Return True if table is empty

TableIsFull : Return True if table is full

Occupancy: Return number of occupied slots

Insert: Insert key and data in a slot

Search: Search for a key

Retrieve: Retrieve the data part of the current slot

Update: Update the data part of the current slot

Traverse: Traverse whole table

Required Implementation:

Design and implement a template class hashTable using a SLL with a minimum of the above member functions.

Read and store each entry in the file wordlist.txt in the hash table using separate chaining to resolve collisions.

Spell check an input file such that for each misspelled word list 5 suggestions from the wordlist that are closest to it based on the Hamming Distance measure.

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

What is the submission deadline for the final report?

Answered: 1 week ago

Question

What is the indicative word limit?

Answered: 1 week ago