Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions