Package cc.mallet.extract
Class LabeledSpan
- java.lang.Object
-
- 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:
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LabeledSpan(Span span, Label label, boolean isBackground)
LabeledSpan(Span span, Label label, boolean isBackground, double confidence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
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.
-
getDocument
public java.lang.Object getDocument()
- Specified by:
getDocument
in interfaceSpan
-
getConfidence
public double getConfidence()
-
intersects
public boolean intersects(Span r)
- Specified by:
intersects
in interfaceSpan
-
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 interfaceSpan
-
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.
-
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 interfaceSpan
-
isBackground
public boolean isBackground()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-