Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++!!! vector fileToWords(const string& filename) { ... } abc A Spell Checker he homework problem for this chapter combines the reading from the last

C++!!!

image text in transcribed\

vector fileToWords(const string& filename) {

...

}

abc A Spell Checker he homework problem for this chapter combines the reading from the last three chapters into a single, larger problem, where write a Spell Checker program Upload the starter code to your workspace, and then read through the instructions here. For this assignment you have to write two kinds of functions The fileToWords () function opens and reads a file, and returns a vector of string as described below. The spellCheck() function checks the spelling of all words in a stream. It reads a word from the stream and checks whether it is contained in a list of correctly-spelled words. If the word is in a list of excluded (common) words, you should just ignore it. . . Part 1- fileToWords0 We're going to use the standard UNIX word list. On the version of Linux that we are using, it is in /usr/share/dict/words. I have also created a file named excluded.txt that you should use for these tests as your words to ignore The fileToWords() function takes one parameter, a const path to the file to open. Your function should work like this: string&containing the Open an input file, using the file name If it can't be opened Then throw invalid_argument exception Create an empty vector of string (results) Read the input until end of file (getline) Store each word in the vector (push_back) Return the results vector

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago

Question

=+employee to take on the international assignment?

Answered: 1 week ago

Question

=+differences in home- and host-country costs of living?

Answered: 1 week ago