public class LabeledToken extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
POS_ATTRIBUTE |
static String |
STEM_ATTRIBUTE |
static String |
TOKEN_ELEMENT |
| Constructor and Description |
|---|
LabeledToken()
Creates a new labeled token with none of its features set.
|
LabeledToken(String originalWord)
Creates a new labeled token with its original word value set.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCharacterPosition()
Get character position where this token starts in the sentence.
|
int |
getIndex()
Get the index of this token into its sentence.
|
String |
getOriginalWord()
Gets the token in its original form.
|
String |
getStem()
Gets the stemmed form (lemma) for this token.
|
TokenType |
getTokenType()
Get the token type assigned to this token (see the TokenType enum).
|
Node |
makeXML(Document doc) |
void |
setCharacterPosition(int charPos)
Set the character position where this token starts in the sentence.
|
void |
setIndex(int index)
Set the index of this token into its sentence.
|
void |
setOriginalWord(String token)
Sets the token.
|
void |
setStem(String stem)
Sets the stemmed form of this token.
|
void |
setTokenType(TokenType tokenType)
Set the token type on this token (see the TokenType enum).
|
String |
toString()
Returns a string representation showing the original token and its
part-of-speech separated by a slash.
|
public static final String TOKEN_ELEMENT
public static final String POS_ATTRIBUTE
public static final String STEM_ATTRIBUTE
public LabeledToken()
public LabeledToken(String originalWord)
originalWord - the original form of the tokenpublic String getOriginalWord()
public void setOriginalWord(String token)
token - the token in its original formpublic String getStem()
public void setStem(String stem)
stem - the stemmed form of the tokenpublic TokenType getTokenType()
public void setTokenType(TokenType tokenType)
tokenType - the type to assign to this tokenpublic int getIndex()
public void setIndex(int index)
index - the index of this token in its sentencepublic int getCharacterPosition()
public void setCharacterPosition(int charPos)
charPos - the integer that indicates the token's starting pointpublic String toString()
Copyright © 2017. All rights reserved.