Question: 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!

C++!!!! I need a help! vector spellCheck(istream& in, const vector& dictionary, const

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!