edu.umass.cs.mallet.base.pipe.iterator
Class LineGroupIterator

java.lang.Object
  extended byedu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
      extended byedu.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.


Field Summary
 
Fields inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
parentInstance
 
Constructor Summary
LineGroupIterator(java.io.Reader input, java.util.regex.Pattern lineBoundaryRegex, boolean skipBoundary)
           
 
Method Summary
 java.lang.String getLineGroup()
           
 java.lang.String getNextLineGroup()
           
 boolean hasNext()
           
 Instance nextInstance()
           
 void nextLineGroup()
           
 
Methods inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
next, remove, setParentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineGroupIterator

public LineGroupIterator(java.io.Reader input,
                         java.util.regex.Pattern lineBoundaryRegex,
                         boolean skipBoundary)
Method Detail

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