Algorithm for multiple word matching in a text, count the number of every matched word

Posted by 66 on Stack Overflow See other posts from Stack Overflow or by 66
Published on 2010-06-06T03:16:11Z Indexed on 2010/06/06 3:22 UTC
Read the original article Hit count: 274

Filed under:
|
|

I have noticed that it has solutions for matching multiple words in a given text, such as below: http://stackoverflow.com/questions/1099985/algorithm-for-multiple-word-matching-in-text

If I want to know exactly the number of appearances of each matched word in the text, my solution is like this:

step 1: using ac-algorithm to obtain the maching words;

step 2: count the number of each word obtained in step 1

is there a faster way?

Thx~

© Stack Overflow or respective owner

Related posts about string

Related posts about full-text-search