Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: compute the occurrence of words

by vinoth.ree (Parson)
on Feb 13, 2013 at 13:57 UTC ( #1018540=note: print w/ replies, xml ) Need Help??


in reply to Re: compute the occurrence of words
in thread compute the occurrence of words

Hi Utilitarian yes I agree that hash is the best way to find the unique things, but BigGer is not trying to find the unique words, he tried in his code to counts the occurrence of each word.


Comment on Re^2: compute the occurrence of words
Re^3: compute the occurrence of words
by Utilitarian (Vicar) on Feb 13, 2013 at 14:13 UTC
    Perhaps I was unclear, one of the things you have to do in order to count the number of occurrences of each word in a given text is to create a list of the unique words present, the other thing you have to do is associate a count with each of these words.

    If you can think of a data structure more suited to this purpose than an associative array or hash, I'd be very interested.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-09-21 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls