Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write this program is C. Please comment code. And please show the results as well. As well as the execution on the command line. You

Write this program is C. Please comment code. And please show the results as well. As well as the execution on the command line.

  1. You are given Shakespeare RomeoandJuliet.txt file which contains the whole book. (A large file). (Please use any file if you cant find RomeoandJuliet.txt).
  2. You are also given another text file called correctspelling.txt that contains correct spelling of words in the RomeandJuliet.txt. Each word of correctspelling.txt it on its own line. This file is in alphabetical order. This is also a large .txt file.
  3. You are basically looking for the misspelled words in Romeo and Juliet. If a word is not spelled like it is in correctspelling.txt then is in incorrect.
  4. Take into account the 26 letters and apostrophe ( ). It is also case insensitive.
  5. Please write TWO codes!
  6. First code - You will need to insert the words in correctspelling.txt into a dictionary tree. This tree should allow a caller to insert words to a tree to build a dictionary and search the tree to find if a given word matches (case insensitive search) any stored word in the tree.
  7. Next write a code to test your dictionary tree implementation by building a dictionary tree from a source dictionary text file and then use the dictionary tree to perform spell checks on all words read from another text file and print out all misspelled words there.
  • This code should contain the main(int argc, char **argv)
  • Basically, in this code you will use check to see if the words in RomeandJuliet.txt is spelled the same as in correctspelling.txt.
  1. Print the misspelled words to standard out. You can capture standard out to a file using the > and a filename. Please show how to do this in command line. The misspelled words should be EXACTLY how they were in the Romeo and Juliet book.
  2. To sum up, insert the words in correctspelling.txt into a tree. So, if a word in the RomeoandJuliet.txt file is not spelled the way it is in correctspelling.txt then it is incorrect. The incorrect words should be printed to a standard out. The misspelled words should be in the order of from beginning of the file to the end of the file.
  3. I will give a small example below.
  • RomeoandJuliet.txt first line is- Enterd Sampson and Gregory, with swords and bucklers, ofs thed house of Capulet.
  • correctspelling.txt (each word on its own line) and
  • bucklers
  • Enter
  • Gregory
  • of
  • the
  • The incorrect words in RomeoandJuliet.txt is Enterd
  • ofs
  • Thed

The misspelled words are exactly in the order of how they appeared in RomeoandJuliet.txt

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_2

Step: 3

blur-text-image_3

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Explain recruiting technology.

Answered: 1 week ago

Question

Define and operationalize types of employment discrimination.

Answered: 1 week ago

Question

Describe sexual harassment in the global environment.

Answered: 1 week ago