cc.mallet.pipe.iterator
Class LineGroupIterator

java.lang.Object
  extended by cc.mallet.pipe.iterator.LineGroupIterator
All Implemented Interfaces:
java.util.Iterator<Instance>

public class LineGroupIterator
extends java.lang.Object
implements java.util.Iterator<Instance>

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)
           
 
Method Summary
 boolean hasNext()
           
 Instance next()
           
 java.lang.String peekLineGroup()
           
 void remove()
           
 
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

peekLineGroup

public java.lang.String peekLineGroup()

next

public Instance next()
Specified by:
next in interface java.util.Iterator<Instance>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<Instance>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<Instance>