Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Machine > Re: Keyword ext...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 9 Topic 745 of 833
Post > Topic >>

Re: Keyword extractor's source code....where I can find it???

by "giugy" <matteozatto@[EMAIL PROTECTED] > Jan 17, 2007 at 01:15 AM

Sorry but maybe I make a stupid errore....if I change
return "\n" + word + " [" + count + "]";
with
return count=" "+word;

I obtain an error like this "found: java.lang.String required: int" ,
because count is an it and word is a string and the function required
gives back a String....how can i do?



glen herrmannsfeldt ha scritto:

> 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
 




 9 Posts in Topic:
Keyword extractor's source code....where I can find it???
"giugy" <mat  2007-01-11 07:59:17 
Re: Keyword extractor's source code....where I can find it???
glen herrmannsfeldt <g  2007-01-11 17:57:33 
Re: Keyword extractor's source code....where I can find it???
"giugy" <mat  2007-01-16 09:20:23 
Re: Keyword extractor's source code....where I can find it???
glen herrmannsfeldt <g  2007-01-16 23:15:15 
Re: Keyword extractor's source code....where I can find it???
"giugy" <mat  2007-01-16 09:20:25 
Re: Keyword extractor's source code....where I can find it???
"giugy" <mat  2007-01-17 01:15:50 
Re: Keyword extractor's source code....where I can find it???
glen herrmannsfeldt <g  2007-01-17 01:25:31 
Re: Keyword extractor's source code....where I can find it???
"giugy" <mat  2007-01-17 01:15:51 
Re: Keyword extractor's source code....where I can find it???
"giugy" <mat  2007-01-17 01:15:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 13:30:19 CDT 2008.