Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General

How to construct the term frequency vector of all words in dictionary?

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


xu.xumiao at gmail

May 15, 2012, 10:24 AM

Post #1 of 2 (423 views)
Permalink
How to construct the term frequency vector of all words in dictionary?

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.


lucene at mikemccandless

May 15, 2012, 11:04 AM

Post #2 of 2 (417 views)
Permalink
Re: How to construct the term frequency vector of all words in dictionary? [In reply to]

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 [at] gmail> 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.

Lucene general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.