gate.creole.annic.apache.lucene.index
Class TermVectorsReader
java.lang.Object
gate.creole.annic.apache.lucene.index.TermVectorsReader
class TermVectorsReader
- extends Object
TODO: relax synchro!
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fieldInfos
private FieldInfos fieldInfos
tvx
private InputStream tvx
tvd
private InputStream tvd
tvf
private InputStream tvf
size
private int size
TermVectorsReader
TermVectorsReader(Directory d,
String segment,
FieldInfos fieldInfos)
throws IOException
- Throws:
IOException
checkValidFormat
private void checkValidFormat(InputStream in)
throws IOException
- Throws:
IOException
close
void close()
throws IOException
- Throws:
IOException
size
int size()
- Returns:
- The number of documents in the reader
get
TermFreqVector get(int docNum,
String field)
- Retrieve the term vector for the given document and field
- Parameters:
docNum - The document number to retrieve the vector forfield - The field within the document to retrieve
- Returns:
- The TermFreqVector for the document and field or null
get
TermFreqVector[] get(int docNum)
- Return all term vectors stored for this document or null if the could not be read in.
readTermVectors
private SegmentTermVector[] readTermVectors(String[] fields,
long[] tvfPointers)
throws IOException
- Throws:
IOException
readTermVector
private SegmentTermVector readTermVector(String field,
long tvfPointer)
throws IOException
- Parameters:
fieldNum - The field to read intvfPointer - The pointer within the tvf file where we should start reading
- Returns:
- The TermVector located at that position
- Throws:
IOException