View Single Post
Join Date: Jan 2009
Posts: 7
Reputation: serhannn is an unknown quantity at this point 
Solved Threads: 0
serhannn serhannn is offline Offline
Newbie Poster

Re: extracting a sentence

 
0
  #5
Jan 11th, 2009
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?

  1. size_t pos1,pos2;
  2. pos1=line.find(keyword_vector[i]);
  3. pos2=line.find(".",pos1);
  4. string sentence = line.substr(pos1,pos2);

Thanks for help.
Last edited by serhannn; Jan 11th, 2009 at 11:56 am.
Reply With Quote