cc.mallet.extract
Class LabeledSpan

java.lang.Object
  extended by cc.mallet.extract.LabeledSpan
All Implemented Interfaces:
Span, java.io.Serializable

public class LabeledSpan
extends java.lang.Object
implements Span, java.io.Serializable

Created: Oct 12, 2004

Version:
$Id: LabeledSpan.java,v 1.1 2007/10/22 21:37:44 mccallum Exp $
Author:
Serialized Form

Constructor Summary
LabeledSpan(Span span, Label label, boolean isBackground)
           
LabeledSpan(Span span, Label label, boolean isBackground, double confidence)
           
 
Method Summary
 double getConfidence()
           
 java.lang.Object getDocument()
           
 int getEndIdx()
          Returns an integer index identifying the end of this span.
 Label getLabel()
           
 Span getSpan()
           
 int getStartIdx()
          Returns an integer index identifying the start of this span.
 java.lang.String getText()
          Returns a textual representatio of the span, suitable for XML output, e.g.
 Span intersection(Span r)
          Returns a new span that is the intersection of this span and another.
 boolean intersects(Span r)
           
 boolean isBackground()
           
 boolean isSubspan(Span r)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabeledSpan

public LabeledSpan(Span span,
                   Label label,
                   boolean isBackground)

LabeledSpan

public LabeledSpan(Span span,
                   Label label,
                   boolean isBackground,
                   double confidence)
Method Detail

getSpan

public Span getSpan()

getLabel

public Label getLabel()

getText

public java.lang.String getText()
Description copied from interface: Span
Returns a textual representatio of the span, suitable for XML output, e.g.

Specified by:
getText in interface Span

getDocument

public java.lang.Object getDocument()
Specified by:
getDocument in interface Span

getConfidence

public double getConfidence()

intersects

public boolean intersects(Span r)
Specified by:
intersects in interface Span

isSubspan

public boolean isSubspan(Span r)
Specified by:
isSubspan in interface Span

intersection

public Span intersection(Span r)
Description copied from interface: Span
Returns a new span that is the intersection of this span and another.

Specified by:
intersection in interface Span

getEndIdx

public int getEndIdx()
Description copied from interface: Span
Returns an integer index identifying the end of this span. Beware that in some cases (e.g., for images), this may not correspond directly to a sequence index.

Specified by:
getEndIdx in interface Span

getStartIdx

public int getStartIdx()
Description copied from interface: Span
Returns an integer index identifying the start of this span. Beware that in some cases (e.g., for images), this may not correspond directly to a sequence index.

Specified by:
getStartIdx in interface Span

isBackground

public boolean isBackground()

toString

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