Hello, there.
I am trying to develop a few basic statistics scripts about word frequencies in a text.
For example, with a script (partially reduced) like
$text = explode (" ", $input_text);
$list_of_words = array_count_values ($text);
arsort ($list_of_words);
foreach ($list_of_words $key => $val)
{
echo ($key ." : $val <br>");
}
it takes more than 30 seconds to get the results in a file of just 60K. Why is so slow? Am I doing something wrong? Is there any other way to do this in a simple way?
I am also trying to make some scripts to find bigrams (collocations) in a text using similar functions, but is there any other one which is faster?
Many thanks in advance for any help.
Antonio Ruiz