Package cc.mallet.extract
Interface Span
-
- All Known Implementing Classes:
LabeledSpan,StringSpan
public interface SpanA sub-section of a document, either linear or two-dimensional. Spans are immutable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetDocument()intgetEndIdx()Returns an integer index identifying the end of this span.intgetStartIdx()Returns an integer index identifying the start of this span.java.lang.StringgetText()Returns a textual representatio of the span, suitable for XML output, e.g.Spanintersection(Span r)Returns a new span that is the intersection of this span and another.booleanintersects(Span r)booleanisSubspan(Span r)
-
-
-
Method Detail
-
getText
java.lang.String getText()
Returns a textual representatio of the span, suitable for XML output, e.g.
-
intersection
Span intersection(Span r)
Returns a new span that is the intersection of this span and another.
-
getDocument
java.lang.Object getDocument()
-
intersects
boolean intersects(Span r)
-
isSubspan
boolean isSubspan(Span r)
-
getStartIdx
int getStartIdx()
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.
-
getEndIdx
int getEndIdx()
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.
-
-