Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ create the following program The program should create a text file where each line contains the wrong word from the checked text and

In C++ create the following program The program should create a text file where each line contains the wrong word from the checked text and the suggestions how to correct this word. It is possible to have no suggestions. The word is considered wrong if it is not in the dictionary.

Your program should start with creating a dictionary. In our program, dictionary is just a collection of all known correct words. Those words should be read from the dictionary file (the second command-line argument) and stored in some container.

I want you to measure the running time of the spell-checking itself for the given text and given dictionary files. Find them attached to this assignment. First, do it smart and try std::unordered_set for the container. Then do it with thestd::set for the sake of comparison. Place the results of the tests in a separate text-file (which you obviously should also submit).

The types of mistakes that your spell-checker should recognize are

a single letter is missing somewhere in the word. So, if the word is moter, one of the suggested corrections should be mother.

a single extra letter appears in the word. If the word is cadse, one of the suggested corrections should be case.

a single letter is replaced by the other letter. For the same moter word, the list of corrections should include meter and motor.

two neighboring letters swapped their positions. If the word is nto, one of the suggested corrections should be not.

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions