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 |
StringSpan(java.lang.CharSequence doc,
int start,
int end)
|
| Methods inherited from class cc.mallet.types.Token |
getFeatures, getFeatureValue, getNumericProperty, getProperties, getProperty, getText, hasProperty, setFeatures, setFeatureValue, setNumericProperty, setProperties, setProperty, setText, toFeatureVector, toStringWithFeatureNames |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface cc.mallet.extract.Span |
getText |
StringSpan
public StringSpan(java.lang.CharSequence doc,
int start,
int end)
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
getDocument
public java.lang.Object getDocument()
- Specified by:
getDocument in interface Span
intersects
public boolean intersects(Span r)
- Specified by:
intersects in interface Span
isSubspan
public boolean isSubspan(Span r)
- Specified by:
isSubspan 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
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
toString
public java.lang.String toString()
- Overrides:
toString in class Token