public class HighFreqTerms extends Object
HighFreqTerms
class extracts the top n most frequent terms
(by document frequency ) from an existing Lucene index and reports their document frequencey.
If the -t flag is and reports both their document frequency and their total tf (total number of occurences)
in order of highest total tfModifier and Type | Field and Description |
---|---|
static int |
DEFAULTnumTerms |
static int |
numTerms |
Constructor and Description |
---|
HighFreqTerms() |
Modifier and Type | Method and Description |
---|---|
static TermStats[] |
getHighFreqTerms(IndexReader reader,
int numTerms,
String field)
Returns TermStats[] ordered by terms with highest docFreq first.
|
static long |
getTotalTermFreq(IndexReader reader,
Term term) |
static void |
main(String[] args) |
static TermStats[] |
sortByTotalTermFreq(IndexReader reader,
TermStats[] terms)
Takes array of TermStats.
|
public static final int DEFAULTnumTerms
public static int numTerms
public static TermStats[] getHighFreqTerms(IndexReader reader, int numTerms, String field) throws Exception
Exception
public static TermStats[] sortByTotalTermFreq(IndexReader reader, TermStats[] terms) throws Exception
terms
- TermStats[]Exception
public static long getTotalTermFreq(IndexReader reader, Term term) throws Exception
Exception
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.