edu.umass.cs.mallet.base.pipe.iterator
Class LineGroupIterator
java.lang.Object
edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
edu.umass.cs.mallet.base.pipe.iterator.LineGroupIterator
- All Implemented Interfaces:
- java.util.Iterator, PipeInputIterator
- public class LineGroupIterator
- extends AbstractPipeInputIterator
Iterate over groups of lines of text, separated by lines that
match a regular expression. For example, the WSJ BaseNP data
consists of sentences with one word per line, each sentence
separated by a blank line. If the "boundary" line is to be
included in the group, it is placed at the end of the group.
Constructor Summary |
LineGroupIterator(java.io.Reader input,
java.util.regex.Pattern lineBoundaryRegex,
boolean skipBoundary)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineGroupIterator
public LineGroupIterator(java.io.Reader input,
java.util.regex.Pattern lineBoundaryRegex,
boolean skipBoundary)
getLineGroup
public java.lang.String getLineGroup()
nextLineGroup
public void nextLineGroup()
getNextLineGroup
public java.lang.String getNextLineGroup()
nextInstance
public Instance nextInstance()
- Specified by:
nextInstance
in interface PipeInputIterator
- Specified by:
nextInstance
in class AbstractPipeInputIterator
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator
- Specified by:
hasNext
in class AbstractPipeInputIterator