Complete.Org: Mailing Lists: Archives: freeciv-java: October 2000:
[FreeCiv-Java] Re: Some Help Please
Home

[FreeCiv-Java] Re: Some Help Please

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Erik Sigra" <freeciv@xxxxxxx>, <freeciv-java@xxxxxxxxxxx>
Subject: [FreeCiv-Java] Re: Some Help Please
From: "SamBC" <sambc@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 8 Oct 2000 12:53:29 +0100

Two reasons, perhaps?

1) He's learning Java and it is a code example (and a reasonably good one,
esp for string handling)

2) It may be more verbose, but it is far nearer plain english than that
command, and more understandable with less work...


SamBC

----- Original Message -----
From: "Erik Sigra" <freeciv@xxxxxxx>
To: <freeciv-java@xxxxxxxxxxxx>
Sent: Saturday, October 07, 2000 12:13 AM
Subject: [FreeCiv-Java] Re: Some Help Please


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







[Prev in Thread] Current Thread [Next in Thread]