lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: How to construct the term frequency vector of all words in dictionary?
Date Tue, 15 May 2012 18:04:42 GMT
You can get a TermEnum (IndexReader.terms()) and then keep calling
.next() to advance to the next term, and then .docFreq() to get the
document frequency (how many documents have the term) for that term...

Mike McCandless

http://blog.mikemccandless.com


On Tue, May 15, 2012 at 1:24 PM, Aoi Morida <xu.xumiao@gmail.com> wrote:
> Hi all,
>
> I want to create the term frequency vector for all words in the dictionary.
> I find that the function getTermFreqVector() can only give term frequency of
> the words existed in the particular document.
>
> BTW, I want to extract words in the dictionary and I find that the function
> getWordsIterator()  can do this. But as I import
> org.apache.lucene.search.spell.LuceneDictionary, there is always an error
> message. I wondered what's wrong with it. My lucene version is 2.9.4.
>
> Thank you.
>
> Regards,
>
> Aoi
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-construct-the-term-frequency-vector-of-all-words-in-dictionary-tp3983898.html
> Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message