some people missed the "dont need to count individual words" part, but for the sake of future reference, this could be done like so:
my %count; $count{$1}++ while $text =~ /($keyword_regex)/g;
and you could find some percentage of relevancy with:
use POSIX qw(ceil); print ceil(keys(%count) / (@keyword_list) * 100);
In reply to Re: Counting the frequency of words in a string
by cez
in thread Counting the frequency of words in a string
by cez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |