Re: Keyword extractor's source code....where I can find it???
by glen herrmannsfeldt <gah@[EMAIL PROTECTED]
>
Jan 16, 2007 at 11:15 PM
giugy wrote:
> Yes, I have found a code like this....
>
> im****t java.io.*;
> im****t java.util.*;
>
> class Counter implements Comparable {
> private String word;
> private int count;
> public Counter(String word) {
> this.word = word;
> count = 1;
> }
> public void increment() { count++; }
> public String toString() {
> return "\n" + word + " [" + count + "]";
Change this to:
return count=" "+word;
The the output will have a list of count followed by word, and
can be input to the unix command
sort -rn unsortedfile > sortedfile
which will output the list with the most common word first.
(snip)
-- glen