Class SegmentIterator

    • Constructor Summary

      Constructors 
      Constructor Description
      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.
      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
    • 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.
        segmentStartTags - array of tags indicating the start of a segment
        segmentContinueTags - array of tags indicating the continuation of a segment
        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.
        Parameters:
        ilist - InstanceList containing sequence.
        segmentStartTags - array of tags indicating the start of a segment
        segmentContinueTags - array of tags indicating the continuation of a segment
        predictions - list of Sequences that are the predicted output of some Transducer
      • 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

      • next

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

        public Segment nextSegment()
      • hasNext

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

        public java.util.ArrayList toArrayList()
      • remove

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