Welcome~~~


Another blog:
http://fun-st.blogspot.com/

It is easier to write an incorrect program than understand a correct one.

Wednesday, February 9, 2011

# Get the most repeated word in a string

-1- tokeniz words
-2- storing them in a dictionary (hash table)
-3- count for each word
-4- Sort by the counted number and find the maximum count

if using Python:

we could use the ultk
do the tokenize
then using the ultk.Freq to build the frequency for each words.

if use the "shell command":

sort logfile.txt | uniq -c
http://www.dreamsyssoft.com/sp_ss.jsp

♥ ¸¸.•*¨*•♫♪♪♫•*¨*•.¸¸♥

A PHP: http://stackoverflow.com/questions/3175390/most-used-words-in-text-with-php
Most expert: http://stackoverflow.com/questions/3169051/code-golf-word-frequency-chart
http://stackoverflow.com/questions/3097882/find-most-often-seen-string-from-a-log-file

No comments:

Post a Comment