Question: C++ searching a vector for commonly used words I need help with my code for a function which is supposed to look at a file

C++ searching a vector for commonly used words

I need help with my code for a function which is supposed to look at a file of the most used english words and search for those words in another .txt file. This is what I have so far:

bool isStopWord(string word, vector &_vecIgnoreWords){

for(int i = 0; i < _vecIgnoreWords.size() ; i++){

if(_vecIgnoreWords[i] == word)

return true;

else

return false;

}

return 0;

}

For example: "the dog went to the park" the should be identified as a Stop Word

We aren't allowed to use so no find function

Here is the .txt file of words:

the be to of and a in that have i it for not on with he as you do at this but his by from they we say her she or an will my one all would there their what so up out if about who get which go me

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!