Question: could you help me to do the same code in c++ but for v.size()==3 if (v.size() == 2) { if ((v[1] != noun) && (v[1]
could you help me to do the same code in c++ but for v.size()==3
if (v.size() == 2) { if ((v[1] != "noun") && (v[1] != "adjective") && (v[1] != "verb")) { cout << " <2nd argument must be a part of speech.>" << endl; } else { if (find(keyWords.begin(), keyWords.end(), v[0]) != keyWords.end()) { //cout << "return vector >> if pos if found return definition" << endl; for (auto map_iter = mymap.cbegin(); map_iter != mymap.cend(); ++map_iter) { if (v[0] == map_iter->first) { if ((v[1] == "noun") || (v[1] == "adjective") || (v[1] == "verb")) { int count = 0; for (auto vec_iter = map_iter->second.cbegin(); vec_iter != map_iter->second.cend(); ++vec_iter) { string str1 = *vec_iter; string str2 = v[1]; if (str1.find(str2) != string::npos) { std::cout << " " << wordSearch << " " << *vec_iter << endl; count++; }if (v.size() == 2) { if ((v[1] != "noun") && (v[1] != "adjective") && (v[1] != "verb")) { cout << " <2nd argument must be a part of speech.>" << endl; } else { if (find(keyWords.begin(), keyWords.end(), v[0]) != keyWords.end()) { //cout << "return vector >> if pos if found return definition" << endl; for (auto map_iter = mymap.cbegin(); map_iter != mymap.cend(); ++map_iter) { if (v[0] == map_iter->first) { if ((v[1] == "noun") || (v[1] == "adjective") || (v[1] == "verb")) { int count = 0; for (auto vec_iter = map_iter->second.cbegin(); vec_iter != map_iter->second.cend(); ++vec_iter) { string str1 = *vec_iter; string str2 = v[1]; if (str1.find(str2) != string::npos) { std::cout << " " << wordSearch << " " << *vec_iter << endl; count++; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
