Class 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 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