lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Getting word freqency?
Date Tue, 13 Jan 2004 13:22:06 GMT
On Jan 13, 2004, at 7:26 AM, ambiesense@gmx.de wrote:
> Example: I have a very long text. I parse these text with an
> WhitespaceAnalyser. From this Text I generate an Index. From this 
> index I get each word
> together with its alsolute frequency / relative frequency.
>
> Can I do it without generating an index?

May be other ways to do it, but a poor mans solution would be to take 
the output (a TokenStream) of an analyzer directly, and iterate over it 
and insert it into a Map.  If it is already in the Map, add one to the 
counter, if not insert it with a counter of one.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message