public abstract class TokenBase
extends java.lang.Object
Constructor and Description |
---|
TokenBase(int wordId,
java.lang.String surface,
ViterbiNode.Type type,
int position,
Dictionary dictionary) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAllFeatures()
Gets all features for this token as a comma-separated String
|
java.lang.String[] |
getAllFeaturesArray()
Gets all features for this token as a String array
|
protected java.lang.String |
getFeature(int feature)
Gets a numbered feature for this token
|
int |
getPosition()
Gets the position/start index where this token is found in the input text
|
java.lang.String |
getSurface()
Gets the surface form of this token (表層形)
|
boolean |
isKnown()
Predicate indicating whether this token is known (contained in the standard dictionary)
|
boolean |
isUser()
Predicate indicating whether this token is included is from the user dictionary
|
java.lang.String |
toString() |
public TokenBase(int wordId, java.lang.String surface, ViterbiNode.Type type, int position, Dictionary dictionary)
public java.lang.String getSurface()
public boolean isKnown()
public boolean isUser()
If a token is contained both in the user dictionary and standard dictionary, this method will return true
public int getPosition()
public java.lang.String getAllFeatures()
public java.lang.String[] getAllFeaturesArray()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getFeature(int feature)
feature
- feature number