public static class LazyTermDocVector.Reader extends Object implements TermDocVector.Reader
Constructor and Description |
---|
LazyTermDocVector.Reader(int nTerms,
byte[] bytes,
String[] terms) |
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfTerms()
Returns the total number of terms in this document.
|
int[] |
getPositions()
Returns the position offsets of the current term as an array.
|
boolean |
getPositions(TermPositions tp)
Returns the position offsets of the current term as a
TermPositions object. |
short |
getTf()
Returns the term frequency of the current term.
|
boolean |
hasMoreTerms()
Returns
true if there are more terms to read. |
String |
nextTerm()
Returns the next term.
|
void |
reset()
Resets the reader to the beginning of the document.
|
public LazyTermDocVector.Reader(int nTerms, byte[] bytes, String[] terms) throws IOException
IOException
public int getNumberOfTerms()
TermDocVector.Reader
getNumberOfTerms
in interface TermDocVector.Reader
public int[] getPositions()
TermDocVector.Reader
getPositions
in interface TermDocVector.Reader
public boolean getPositions(TermPositions tp)
TermDocVector.Reader
TermPositions
object.getPositions
in interface TermDocVector.Reader
TermPositions
representing offsets of the current term.public short getTf()
TermDocVector.Reader
getTf
in interface TermDocVector.Reader
public boolean hasMoreTerms()
TermDocVector.Reader
true
if there are more terms to read.hasMoreTerms
in interface TermDocVector.Reader
true
if there are more terms to readpublic String nextTerm()
TermDocVector.Reader
nextTerm
in interface TermDocVector.Reader
public void reset()
TermDocVector.Reader
reset
in interface TermDocVector.Reader