Package cc.mallet.extract
Class StringSpan
- java.lang.Object
-
- cc.mallet.types.Token
-
- cc.mallet.extract.StringSpan
-
- All Implemented Interfaces:
Span
,PropertyHolder
,java.io.Serializable
public class StringSpan extends Token implements Span
A sub-section of a linear string.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringSpan(java.lang.CharSequence doc, int start, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getDocument()
int
getEndIdx()
Returns an integer index identifying the end of this span.int
getStartIdx()
Returns an integer index identifying the start of this span.Span
intersection(Span r)
Returns a new span that is the intersection of this span and another.boolean
intersects(Span r)
boolean
isSubspan(Span r)
java.lang.String
toString()
-
Methods inherited from class cc.mallet.types.Token
getFeatures, getFeatureValue, getNumericProperty, getProperties, getProperty, getText, hasProperty, setFeatures, setFeatureValue, setNumericProperty, setProperties, setProperty, setText, toFeatureVector, toStringWithFeatureNames
-
-
-
-
Method Detail
-
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
-
getDocument
public java.lang.Object getDocument()
- Specified by:
getDocument
in interfaceSpan
-
intersects
public boolean intersects(Span r)
- Specified by:
intersects
in interfaceSpan
-
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
-
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.
-
-