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

java.lang.Object
  extended byedu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
      extended byedu.umass.cs.mallet.base.pipe.iterator.SegmentIterator
All Implemented Interfaces:
java.util.Iterator, PipeInputIterator

public class SegmentIterator
extends AbstractPipeInputIterator

Iterates over Segments extracted by a Transducer for some InstanceList.


Field Summary
 
Fields inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
parentInstance
 
Constructor Summary
SegmentIterator(InstanceList ilist, java.lang.Object[] startTags, java.lang.Object[] inTags, java.util.ArrayList predictions)
          Useful when no Transduce is specified.
SegmentIterator(Instance instance, java.lang.Object[] startTags, java.lang.Object[] inTags, Sequence prediction)
          Iterate over segments in one instance.
SegmentIterator(Sequence input, Sequence predicted, Sequence truth, java.lang.Object[] startTags, java.lang.Object[] inTags)
          Iterate over segments in one labeled sequence
SegmentIterator(Transducer model, InstanceList ilist, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
          NOTE!: Assumes that segmentStartTags[i] corresponds to segmentContinueTags[i].
SegmentIterator(Transducer model, Instance instance, java.lang.Object[] segmentStartTags, java.lang.Object[] segmentContinueTags)
          Iterates over Segments for only one Instance.
 
Method Summary
 boolean hasNext()
           
 Instance nextInstance()
           
 Segment nextSegment()
           
 java.util.ArrayList toArrayList()
           
 
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

SegmentIterator

public SegmentIterator(Transducer model,
                       InstanceList ilist,
                       java.lang.Object[] segmentStartTags,
                       java.lang.Object[] segmentContinueTags)
NOTE!: Assumes that segmentStartTags[i] corresponds to segmentContinueTags[i].

Parameters:
model - model to segment input sequences
ilist - list of instances to be segmented
segmentStartTags - array of tags indicating the start of a segment
segmentContinueTags - array of tags indicating the continuation of a segment

SegmentIterator

public SegmentIterator(Transducer model,
                       Instance instance,
                       java.lang.Object[] segmentStartTags,
                       java.lang.Object[] segmentContinueTags)
Iterates over Segments for only one Instance.


SegmentIterator

public SegmentIterator(InstanceList ilist,
                       java.lang.Object[] startTags,
                       java.lang.Object[] inTags,
                       java.util.ArrayList predictions)
Useful when no Transduce is specified. A list of sequences specifies the output.

Parameters:
ilist - InstanceList containing sequence.
predictions - list of Sequences that are the predicted output of some Transducer

SegmentIterator

public SegmentIterator(Instance instance,
                       java.lang.Object[] startTags,
                       java.lang.Object[] inTags,
                       Sequence prediction)
Iterate over segments in one instance.


SegmentIterator

public SegmentIterator(Sequence input,
                       Sequence predicted,
                       Sequence truth,
                       java.lang.Object[] startTags,
                       java.lang.Object[] inTags)
Iterate over segments in one labeled sequence

Method Detail

nextInstance

public Instance nextInstance()
Specified by:
nextInstance in interface PipeInputIterator
Specified by:
nextInstance in class AbstractPipeInputIterator

nextSegment

public Segment nextSegment()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in class AbstractPipeInputIterator

toArrayList

public java.util.ArrayList toArrayList()