anl.aida.ae.lucene
Class DocumentFrequencyFilter

java.lang.Object
  extended by anl.aida.ae.lucene.DocumentFrequencyFilter
All Implemented Interfaces:
Filter<org.apache.lucene.index.Term>

public class DocumentFrequencyFilter
extends java.lang.Object
implements Filter<org.apache.lucene.index.Term>

Filters a Term based on how many documents in an index it appears in.


Field Summary
private  int freq
           
private  org.apache.lucene.index.IndexReader reader
           
 
Constructor Summary
DocumentFrequencyFilter(org.apache.lucene.index.IndexReader reader, int frequency)
          Creates a DocFrequencyFilter that will use the specified index.
 
Method Summary
 boolean evaluate(org.apache.lucene.index.Term term)
          Evaluates an item against some implementor specific criteria and returns true if the item passes the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

private org.apache.lucene.index.IndexReader reader

freq

private int freq
Constructor Detail

DocumentFrequencyFilter

public DocumentFrequencyFilter(org.apache.lucene.index.IndexReader reader,
                               int frequency)
                        throws java.io.IOException
Creates a DocFrequencyFilter that will use the specified index.

Parameters:
reader - the reader to read the index with
frequency - the minimum number of times the terms must appear in the indexed corpus.
Throws:
java.io.IOException - if there is an exception opening the index.
Method Detail

evaluate

public boolean evaluate(org.apache.lucene.index.Term term)
Evaluates an item against some implementor specific criteria and returns true if the item passes the filter.

Specified by:
evaluate in interface Filter<org.apache.lucene.index.Term>
Parameters:
term - the item to evaluate
Returns:
true if the item passes the filter, otherwise false.