Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++!!!! I need a help! vector spellCheck(istream& in, const vector & dictionary, const vector & excluded) { vector results; string word; ... } Here's the

C++!!!! I need a help!

image text in transcribed

vector spellCheck(istream& in, const vector& dictionary, const vector& excluded) {

vector results; string word;

...

}

Here's the pseudocode for your function which takes an istream& and two const vector& parameters (the dictionary and the ignored words): Create the empty results vector Read until end of file (while in) Save current position (in.telLg() ->cast to long Long) If tellg() returns -1 (at end of file) Then Exit the Loop Read next word (in >> word >> ws) Convert to Lowercase, remove punctuation Search the List of misspelled words (results)->set found If found word Then Add position to results ElseIf not found If found word Then ElseIf not found If found word Then (Not misspelled) ElseIf not found Go to top of Loop Search the List of excluded words ->found Go to top of Loop Search the dictionary->found Go to top of Loop Create a WORD, populate with word, position Addnew WORD to resuLts End Loojp Return results (misspelled words and their positions) Here's the pseudocode for your function which takes an istream& and two const vector& parameters (the dictionary and the ignored words): Create the empty results vector Read until end of file (while in) Save current position (in.telLg() ->cast to long Long) If tellg() returns -1 (at end of file) Then Exit the Loop Read next word (in >> word >> ws) Convert to Lowercase, remove punctuation Search the List of misspelled words (results)->set found If found word Then Add position to results ElseIf not found If found word Then ElseIf not found If found word Then (Not misspelled) ElseIf not found Go to top of Loop Search the List of excluded words ->found Go to top of Loop Search the dictionary->found Go to top of Loop Create a WORD, populate with word, position Addnew WORD to resuLts End Loojp Return results (misspelled words and their positions)

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago