Class LineGroupIterator

  • All Implemented Interfaces:

    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

      Constructor Description
      LineGroupIterator​( input, java.util.regex.Pattern lineBoundaryRegex, boolean skipBoundary)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      • Methods inherited from interface java.util.Iterator

    • Constructor Detail

      • LineGroupIterator

        public LineGroupIterator​( 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>