[FreeCiv-Java] Re: Some Help Please
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Houjeh Tiourchi wrote:
>
> The following code reads a text file, makes a tally of all the different
> words used in the file, and prints out a list of the words that appear
> most frequently, along with the number of times each word appears.
> Please explain to me what each lone of code does and how if possible. I
> am a novice and really want to learn this piece of code inside and out.
Why use a long java program? I just used a unix command to do it.
Something like:
cat foo.bar | tr "[A-ZÅÄÖ]" "[a-zåäö]" | tr -d "\(\)\_\t" | tr "
0123456789\"\-\.\,\:\;\'\=\<\>\?\!\/\*\[\]" "\n" | sort | uniq -c | sort
|
|