lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: Term frequency
Date Thu, 12 Apr 2007 07:25:47 GMT

12 apr 2007 kl. 09.12 skrev sai hariharan:

> Thanx for replying. In my scenario i'm not going to index any of my  
> docs.
> So is there a way to find out term frequencies of the terms in a doc
> without doing the indexing part?

Using an analyzer (Tokenstream) and a Map<String, Integer>?

while ((t = ts.next)!=null) {
   Integer tf = map.get(t.termtext());
   if (tf == null) {
     tf = 1;
   } else {
     tf++;
   }
   map.put(t.termtext(), tf);
}


-- 
karl


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


Mime
View raw message