|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ling.ValueLabel
edu.stanford.nlp.ling.StringLabel
edu.stanford.nlp.ling.Word
edu.stanford.nlp.ling.LabeledWord
public class LabeledWord
A LabeledWord
object contains a word and its tag.
The value()
of a TaggedWord is the Word. The tag
is, and is a Label instead of a String
Field Summary |
---|
Fields inherited from class edu.stanford.nlp.ling.Word |
---|
EMPTY, EMPTYSTRING |
Constructor Summary | |
---|---|
LabeledWord()
Create a new TaggedWord . |
|
LabeledWord(Label word,
Label tag)
|
|
LabeledWord(String word)
Create a new TaggedWord . |
|
LabeledWord(String word,
Label tag)
Create a new TaggedWord . |
Method Summary | |
---|---|
static LabelFactory |
factory()
Return a factory for this kind of label. |
LabelFactory |
labelFactory()
Return a factory for this kind of label (i.e., TaggedWord ). |
void |
setTag(Label tag)
|
Label |
tag()
|
String |
toString()
Return a string representation of the label. |
String |
toString(String divider)
|
Methods inherited from class edu.stanford.nlp.ling.Word |
---|
setWord, word |
Methods inherited from class edu.stanford.nlp.ling.StringLabel |
---|
beginPosition, endPosition, setBeginPosition, setEndPosition, setFromString, setValue, value |
Methods inherited from class edu.stanford.nlp.ling.ValueLabel |
---|
compareTo, equals, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LabeledWord()
TaggedWord
.
It will have null
for its content fields.
public LabeledWord(String word)
TaggedWord
.
word
- The word, which will have a null
tagpublic LabeledWord(String word, Label tag)
TaggedWord
.
word
- The wordtag
- The tagpublic LabeledWord(Label word, Label tag)
Method Detail |
---|
public Label tag()
public void setTag(Label tag)
public String toString()
ValueLabel
value()
if it is non-null
,
and the empty string otherwise.
toString
in interface Label
toString
in class StringLabel
public String toString(String divider)
public LabelFactory labelFactory()
TaggedWord
).
The factory returned is always the same one (a singleton).
labelFactory
in interface Label
labelFactory
in class Word
public static LabelFactory factory()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |