class BoundedWordIter extends BasicWordIter
Modifier and Type | Field and Description |
---|---|
(package private) int |
boundSize |
maxWordPos, text, tokens, tokNum, wordPos
FIELD_END, FIELD_START, TERM_END, TERM_END_PLUS, TERM_START
Constructor and Description |
---|
BoundedWordIter(String text,
TokenStream stream,
int boundSize)
Construct a bounded word iterator on the given text.
|
Modifier and Type | Method and Description |
---|---|
MarkPos |
getPos(int startOrEnd)
Create a new place to hold position info
|
void |
getPos(MarkPos pos,
int startOrEnd)
Get the position of the end of the current word.
|
boolean |
next(boolean force)
Advance to the next token.
|
boolean |
prev(boolean force)
Go to the previous token.
|
clone, seekFirst, seekLast, term
public BoundedWordIter(String text, TokenStream stream, int boundSize) throws IOException
IOException
public final boolean next(boolean force)
next
in interface WordIter
next
in class BasicWordIter
force
- true to ignore section boundariespublic final boolean prev(boolean force)
prev
in interface WordIter
prev
in class BasicWordIter
force
- true to ignore section boundariespublic MarkPos getPos(int startOrEnd)
getPos
in interface WordIter
getPos
in class BasicWordIter
startOrEnd
- FIELD_START for the very start of the field;
TERM_START for the first character of the word;
TERM_END for the last character of the word;
TERM_END_PLUS for the last character plus any trailing
punctuation and/or spaces;
FIELD_END for the very last end of the field.public void getPos(MarkPos pos, int startOrEnd)
getPos
in interface WordIter
getPos
in class BasicWordIter
startOrEnd
- FIELD_START for the very start of the field;
TERM_START for the first character of the word;
TERM_END for the last character of the word;
TERM_END_PLUS for the last character plus any trailing
punctuation and/or spaces;
FIELD_END for the very last end of the field.