title: Search multiple words in a string + java
body: <p>I have 10 pages of txt file, in which I have to search a series of 10,000 words to check how many words exists in the file content.</p>
  
  <p>I am using AhoCorasic algorithm for search. However to check if each word exists or not, I have add 10,000 terms to the list. That is I have to iterate 10,000 times to know if each word exists. (10,000 can grow to n)</p>
  
  <p>Problems with above approach are --> CPU boosts as it has to loop 10,000 times and Time it takes to complete the task is more.</p>
  
  <p>I am looking at alternative approach, where I can give all 10,000 words at a time ( to avoid looping) and get the result for each word.</p>
  
  <p>Is there a way to implement this. Or if there is any other alternative to Ahocorasic search to achieve above scenario.</p>