|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectBasicWordIter
ChunkedWordIter
public class ChunkedWordIter
Iterates over words in a large document that has been broken up into
many overlapping Chunk
s. Applies section limits at empty chunks
(section limits can be overcome in any method to which they apply by
simply setting the 'force' parameter.)
Field Summary | |
---|---|
protected Chunk |
chunk
Current chunk whose tokens we're currently traversing |
protected ChunkSource |
chunkSource
Source for fetching chunks |
Fields inherited from class BasicWordIter |
---|
maxWordPos, text, tokens, tokNum, wordPos |
Fields inherited from interface WordIter |
---|
FIELD_END, FIELD_START, TERM_END, TERM_END_PLUS, TERM_START |
Constructor Summary | |
---|---|
ChunkedWordIter(ChunkSource chunkSource)
Construct the iterator to access text from the given chunk source. |
Method Summary | |
---|---|
MarkPos |
createPos()
|
void |
getPos(MarkPos pos,
int startOrEnd)
Replace the position within a MarkPos created by WordIter.getPos(int)
using the iterator's current position. |
boolean |
next(boolean force)
Advance to the next word. |
boolean |
prev(boolean force)
Back up to the previous word. |
protected void |
reseek(Chunk toChunk)
|
protected void |
reseek(int targetPos)
|
void |
seekFirst(int targetPos,
boolean force)
Reposition the iterator at the first word whose position is greater than or equal to 'wordPos'. |
void |
seekLast(int targetPos,
boolean force)
Reposition the iterator at the last word whose position is less than or equal to 'wordPos'. |
Methods inherited from class BasicWordIter |
---|
clone, getPos, term |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ChunkSource chunkSource
protected Chunk chunk
Constructor Detail |
---|
public ChunkedWordIter(ChunkSource chunkSource)
chunkSource
- Source to read chunks from.Method Detail |
---|
public boolean next(boolean force)
WordIter
next
in interface WordIter
next
in class BasicWordIter
force
- true to ignore section boundaries
public boolean prev(boolean force)
WordIter
prev
in interface WordIter
prev
in class BasicWordIter
force
- true to ignore section boundaries
protected void reseek(int targetPos)
protected void reseek(Chunk toChunk)
public void seekFirst(int targetPos, boolean force)
WordIter
seekFirst
in interface WordIter
seekFirst
in class BasicWordIter
targetPos
- Position to seek toforce
- true to ignore section boundariespublic void seekLast(int targetPos, boolean force)
WordIter
seekLast
in interface WordIter
seekLast
in class BasicWordIter
targetPos
- Position to seek toforce
- true to ignore section boundariespublic MarkPos createPos()
public void getPos(MarkPos pos, int startOrEnd)
WordIter
WordIter.getPos(int)
using the iterator's current position.
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |