anl.aida.core
Class STCWriter
java.lang.Object
anl.aida.core.STCWriter
- All Implemented Interfaces:
- ScoredTermCallback
public class STCWriter
- extends java.lang.Object
- implements ScoredTermCallback
Writes a ScoredTermsCollection out to a binary file.
Field Summary |
private org.apache.lucene.store.IndexOutput |
out
|
private int |
termIndex
|
Method Summary |
void |
apply(int docIndex,
MIFSDocument doc,
int frequency,
float score)
Notifies the implementor of a document score for the
term specified in the last call to newTerm. |
void |
newTerm(int termIndex,
MIFSTerm term)
Called when a new term is encountered during
iteration. |
void |
writeCollection(java.lang.String file,
ScoredTermsCollection terms)
Writes the specified collection to the specified file with the specified timestamp. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
private org.apache.lucene.store.IndexOutput out
termIndex
private int termIndex
STCWriter
public STCWriter()
newTerm
public void newTerm(int termIndex,
MIFSTerm term)
- Called when a new term is encountered during
iteration.
- Specified by:
newTerm
in interface ScoredTermCallback
- Parameters:
termIndex
- the index of the term in the collectionterm
- the term itself
apply
public void apply(int docIndex,
MIFSDocument doc,
int frequency,
float score)
throws AIDAException
- Notifies the implementor of a document score for the
term specified in the last call to newTerm.
- Specified by:
apply
in interface ScoredTermCallback
- Parameters:
docIndex
- the index of the document for which this is the term scoredoc
- the document itselffrequency
- the frequency count of the term in the documentscore
- the term score for the document
- Throws:
AIDAException
- if there is an error during the callback.
writeCollection
public void writeCollection(java.lang.String file,
ScoredTermsCollection terms)
throws java.io.IOException
- Writes the specified collection to the specified file with the specified timestamp.
- Parameters:
file
- the path of the file to write toterms
- the scored terms collection to write
- Throws:
java.io.IOException
- if there is an error writing the file.