Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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).

  

Make this program using c++

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: L21 TheHashcodemap h(S)= int(S)?i.where?=26. ? =0 i 1 The Compression Map: h2(K)?[0, N-1], where N is the table size The hash Table ADT The hash Table ADT can be implemented using a Simple Linked List (SLL) with the following member functions: Constructor: Construct an empty table Destructor: Destroy table Make TableEmpty: Empty whole table TablelsEmpty: Return True if table is empty TablelsEull: Return True if table is full Occupancy: Return number of occupied slots Insert: Insert key and data in a slot

Step by Step Solution

3.41 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

maincpp include include include hashTableh include hashTablecpp includ... 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

Fundamentals of Cost Accounting

Authors: William Lanen, Shannon Anderson, Michael Maher

3rd Edition

9780078025525, 9780077517359, 77517350, 978-0077398194

More Books

Students also viewed these Accounting questions