private class ShingleFilter.CircularSequence
extends java.lang.Object
An instance of this class is used to maintain the number of input
stream tokens that will be used to compose the next unigram or shingle:
ShingleFilter.gramSize
.
gramSize
will take on values from the circular sequence
{ [ 1, ] ShingleFilter.minShingleSize
[ , ... , ShingleFilter.maxShingleSize
] }.
1 is included in the circular sequence only if
ShingleFilter.outputUnigrams
= true.
Modifier and Type | Field and Description |
---|---|
private int |
minValue |
private int |
previousValue |
private int |
value |
Constructor and Description |
---|
CircularSequence() |
Modifier and Type | Method and Description |
---|---|
void |
advance()
Increments this circular number's value to the next member in the
circular sequence
gramSize will take on values from the circular sequence
{ [ 1, ] ShingleFilter.minShingleSize [ , ... |
boolean |
atMinValue()
Returns true if the current value is the first member of the circular
sequence.
|
int |
getPreviousValue() |
int |
getValue() |
void |
reset()
Sets this circular number's value to the first member of the
circular sequence
|
private int value
private int previousValue
private int minValue
public int getValue()
advance()
public void advance()
Increments this circular number's value to the next member in the
circular sequence
gramSize
will take on values from the circular sequence
{ [ 1, ] ShingleFilter.minShingleSize
[ , ... , ShingleFilter.maxShingleSize
] }.
1 is included in the circular sequence only if
ShingleFilter.outputUnigrams
= true.
public void reset()
Sets this circular number's value to the first member of the circular sequence
gramSize
will take on values from the circular sequence
{ [ 1, ] ShingleFilter.minShingleSize
[ , ... , ShingleFilter.maxShingleSize
] }.
1 is included in the circular sequence only if
ShingleFilter.outputUnigrams
= true.
public boolean atMinValue()
Returns true if the current value is the first member of the circular sequence.
If ShingleFilter.outputUnigrams
= true, the first member of the circular
sequence will be 1; otherwise, it will be ShingleFilter.minShingleSize
.
public int getPreviousValue()