Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO NOT COPY OR PASTE OTHER SOLUTIONS DO IT BY YOURSELF WRITE THE CODE IN C++ LENGUAGE THE WORDLIST TEXT FILE DATA IS ALSO

PLEASE DO NOT COPY OR PASTE OTHER SOLUTIONS DO IT BY YOURSELF

WRITE THE CODE IN C++ LENGUAGE THE WORDLIST TEXT FILE DATA IS ALSO PASTED AT THE END OF SNAP I CAN NOT ATTACH THE FILE SO I COPPIED DATA FROM FILE AND PASTED AT THE END PLESE WRITE CODE IN C++ ACCORDING TO REQUIREMENTS

image text in transcribedimage text in transcribed

DATA OF TEXT FILE :

a aa aaa aaron ab abandoned abc aberdeen abilities ability able aboriginal abortion about above abraham abroad abs absence absent absolute absolutely absorption abstract abstracts abu abuse ac academic academics academy acc accent accept acceptable acceptance accepted accepting accepts access accessed accessibility accessible accessing accessories accessory accident accidents accommodate accommodation accommodations accompanied accompanying accomplish accomplished accordance according accordingly account accountability accounting accounts accreditation accredited accuracy accurate accurately accused acdbentity ace acer achieve achieved achievement achievements achieving acid acids acknowledge acknowledged acm acne acoustic acquire acquired acquisition acquisitions acre acres acrobat across acrylic act acting action actions activated activation active actively activists activities activity actor actors actress acts actual actually acute ad ada adam adams adaptation adapted adapter adapters adaptive adaptor add added addiction adding addition additional additionally additions address addressed addresses addressing adds adelaide adequate adidas adipex

adjacent adjust adjustable adjusted adjustment adjustments admin administered administration administrative administrator administrators admission admissions admit admitted adobe adolescent adopt adopted adoption adrian ads adsl adult adults advance advanced advancement advances advantage advantages adventure adventures adverse advert advertise advertisement advertisements advertiser advertisers advertising advice advise advised advisor advisors advisory advocacy advocate adware ae aerial aerospace af affair affairs affect affected affecting affects affiliate affiliated affiliates affiliation afford affordable afghanistan afraid africa african after afternoon afterwards ag again against age aged agencies agency agenda agent agents ages aggregate aggressive aging ago agree agreed agreement agreements agrees agricultural agriculture ah ahead ai aid aids aim aimed aims air aircraft airfare airline airlines airplane airport airports aj ak aka al ala alabama alan alarm alaska albania albany albert alberta album albums albuquerque alcohol alert alerts alex alexander alexandria alfred algebra algeria algorithm algorithms ali

Spell Checker using Hashing You are provided a repository of English words, which contains almost all the words used in the text. You need to insert all these words from the repository into the hash table using chaining method. After you have created the hash table, your program is ready to do the spell checking. For this purpose, a user will input some text into an input.txt file to check for any spelling mistakes. Your program should search for each word of the input text from the hash table to see if it's there or not. If the word is not found, then the missing word should be capitalized to make it clearly visible. After all the words have been searched, the program should rewrite the input text in the same file with those words capitalized which were not found in the hash table. If the input text contains words with characters other than the English alphabets, then you should not try to search such words. To search a word from the hash table, it first needs to be converted to lowercase before the searching, because all the words in the hash table are lowercase. Note that the repository contains ten thousand words in lowercase, therefore select the array size accordingly. It is recommended to select a prime number between 9,000 and 10,000 Performance: In this assignment, insertion is carried out only at the start, and then later on the program will only be searching words. As we know that searching is O(1) in hashing, given a good hash function. So hashing is the natural choice for our problem. A good hash function will minimize collisions, and will hash the data to an empty slot. You need to work on the hash function to minimize the collisions. To check out, how good your hash function is, you will need to find out the total number of occupied array slots. Bigger the number, the better it is. Ideally this number can equal the number of total words. Program Output: Text of input fie with wrong spelled words converted to uppercase to replace the text in the input file Print number of Non-empty Array slots of hash table HashChain Class: To implement hashing, you need to implement the following class design. HashChain Table: *list size: int Hashchain(int): ~Hashchain(); insert(item) : void search (key) : bool Spell Checker using Hashing You are provided a repository of English words, which contains almost all the words used in the text. You need to insert all these words from the repository into the hash table using chaining method. After you have created the hash table, your program is ready to do the spell checking. For this purpose, a user will input some text into an input.txt file to check for any spelling mistakes. Your program should search for each word of the input text from the hash table to see if it's there or not. If the word is not found, then the missing word should be capitalized to make it clearly visible. After all the words have been searched, the program should rewrite the input text in the same file with those words capitalized which were not found in the hash table. If the input text contains words with characters other than the English alphabets, then you should not try to search such words. To search a word from the hash table, it first needs to be converted to lowercase before the searching, because all the words in the hash table are lowercase. Note that the repository contains ten thousand words in lowercase, therefore select the array size accordingly. It is recommended to select a prime number between 9,000 and 10,000 Performance: In this assignment, insertion is carried out only at the start, and then later on the program will only be searching words. As we know that searching is O(1) in hashing, given a good hash function. So hashing is the natural choice for our problem. A good hash function will minimize collisions, and will hash the data to an empty slot. You need to work on the hash function to minimize the collisions. To check out, how good your hash function is, you will need to find out the total number of occupied array slots. Bigger the number, the better it is. Ideally this number can equal the number of total words. Program Output: Text of input fie with wrong spelled words converted to uppercase to replace the text in the input file Print number of Non-empty Array slots of hash table HashChain Class: To implement hashing, you need to implement the following class design. HashChain Table: *list size: int Hashchain(int): ~Hashchain(); insert(item) : void search (key) : bool

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

Horngrens Financial & Managerial Accounting, The Managerial Chapters

Authors: Tracie Miller Nobles, Brenda Mattison

7th Edition

0136503616, 9780136503613

More Books

Students also viewed these Accounting questions