In a loop, I used this code to start from the found word and take until the first encounter with a dot. But I think there's something wrong with it, because in output there are some errors. I search in text files, which are actually source codes of some webpages, so they contain many HTML tags. They also interrupt. Is there any better algorithm to avoid that?
size_t pos1,pos2;
pos1=line.find(keyword_vector[i]);
pos2=line.find(".",pos1);
string sentence = line.substr(pos1,pos2);
Thanks for help.
Last edited by serhannn; Jan 11th, 2009 at 11:56 am.