lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Getting word freqency?
Date Tue, 13 Jan 2004 13:22:06 GMT
On Jan 13, 2004, at 7:26 AM, 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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message