cc.mallet.fst
Class Segment

java.lang.Object
  extended by cc.mallet.fst.Segment
All Implemented Interfaces:
java.lang.Comparable

public class Segment
extends java.lang.Object
implements java.lang.Comparable

Represents a labelled chunk of a Sequence segmented by a Transducer, usually corresponding to some object extracted from an input Sequence.


Constructor Summary
Segment(Sequence input, Sequence pred, Sequence truth, int start, int end, java.lang.Object startTag, java.lang.Object inTag)
          Initializes the segment.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean correct()
           
 boolean endsPrematurely()
           
 boolean equals(java.lang.Object o)
           
 double getConfidence()
           
 int getEnd()
           
 Sequence getInput()
           
 java.lang.Object getInTag()
           
 Sequence getPredicted()
           
 java.lang.Object getPredicted(int i)
           
 Sequence getSegmentInputSequence()
           
 int getStart()
           
 java.lang.Object getStartTag()
           
 Sequence getTruth()
           
 java.lang.Object getTruth(int i)
           
 boolean indexInSegment(int index)
           
 java.lang.String sequenceToString()
           
 void setConfidence(double c)
           
 void setCorrect(boolean b)
           
 void setPredicted(Sequence predicted)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Segment

public Segment(Sequence input,
               Sequence pred,
               Sequence truth,
               int start,
               int end,
               java.lang.Object startTag,
               java.lang.Object inTag)
Initializes the segment.

Parameters:
input - entire input sequence
pred - predicted sequence
start - starting position of extracted segment
end - ending position of extracted segment
Method Detail

setCorrect

public void setCorrect(boolean b)

size

public int size()

getTruth

public java.lang.Object getTruth(int i)

getTruth

public Sequence getTruth()

getPredicted

public java.lang.Object getPredicted(int i)

getPredicted

public Sequence getPredicted()

setPredicted

public void setPredicted(Sequence predicted)

getInput

public Sequence getInput()

getStart

public int getStart()

getEnd

public int getEnd()

getStartTag

public java.lang.Object getStartTag()

getInTag

public java.lang.Object getInTag()

getConfidence

public double getConfidence()

setConfidence

public void setConfidence(double c)

correct

public boolean correct()

endsPrematurely

public boolean endsPrematurely()

indexInSegment

public boolean indexInSegment(int index)

getSegmentInputSequence

public Sequence getSegmentInputSequence()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

sequenceToString

public java.lang.String sequenceToString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object