public class Token extends Word
Word
class from LBJava's NLP
library. Two extra fields are provided to store the token's type. First,
type
is intended to store the type of the token as computed by
some classifier. Second, label
is intended for use only when
the data is labeled.Modifier and Type | Field and Description |
---|---|
String |
label
This field stores the type tag found in labeled data.
|
String |
type
This field is used to store a computed type tag.
|
capitalized, form, lemma, partOfSpeech, wordSense
Constructor and Description |
---|
Token(Word w,
Token p,
String type)
A
Token can be constructed from a Word
object representing the same word, a Token representing
the previous word in the sentence, and the type label found in the data. |
Modifier and Type | Method and Description |
---|---|
String |
toString()
Produces a simple
String representation of this word in
which the label field appears followed by the word's part
of speech and finally the form (i.e., spelling) of the word all
surrounded by parentheses. |
public String type
public String label
public Token(Word w, Token p, String type)
Token
can be constructed from a Word
object representing the same word, a Token
representing
the previous word in the sentence, and the type label found in the data.w
- Represents the same word as the Token
being
constructed.p
- The previous word in the sentence.type
- The type label for this word from the data.Copyright © 2017. All rights reserved.