|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.trees.AbstractLabel | +--edu.stanford.nlp.trees.StringLabel | +--edu.stanford.nlp.trees.CategoryWordTag
A CategoryWordTag
object acts as a complex Label
which contains a category, a head word, and a tag.
The category label is the primary value
Constructor Summary | |
CategoryWordTag()
|
|
CategoryWordTag(Label oldLabel)
|
|
CategoryWordTag(String label)
This one argument constructor sets just the value. |
|
CategoryWordTag(String category,
String word,
String tag)
|
Method Summary | |
String |
category()
Return the category value of the label (or null if none). |
static LabelFactory |
factory()
Return a factory for this kind of label |
LabelFactory |
labelFactory()
Return a factory for this kind of label (i.e., CategoryWordTag ). |
void |
setCategory(String category)
Set the category value for the label (if one is stored). |
void |
setCategoryWordTag(String category,
String word,
String tag)
|
void |
setFromString(String labelStr)
Set everything by reversing a two string operation. |
void |
setTag(String tag)
Set the tag value for the label (if one is stored). |
void |
setWord(String word)
Set the word value for the label (if one is stored). |
String |
tag()
Return the tag value of the label (or null if none). |
String |
toString()
Returns a String representation of the label. |
String |
word()
Return the word value of the label (or null if none). |
Methods inherited from class edu.stanford.nlp.trees.StringLabel |
setValue, value |
Methods inherited from class edu.stanford.nlp.trees.AbstractLabel |
compareTo, equals, hashCode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CategoryWordTag()
public CategoryWordTag(String label)
label
- the string that will become the category/valuepublic CategoryWordTag(String category, String word, String tag)
public CategoryWordTag(Label oldLabel)
Method Detail |
public String category()
HasCategory
category
in interface HasCategory
public void setCategory(String category)
HasCategory
setCategory
in interface HasCategory
public String word()
HasWord
word
in interface HasWord
public void setWord(String word)
HasWord
setWord
in interface HasWord
word
- The word value for the labelpublic String tag()
HasTag
tag
in interface HasTag
public void setTag(String tag)
HasTag
setTag
in interface HasTag
tag
- The tag value for the labelpublic void setCategoryWordTag(String category, String word, String tag)
public String toString()
String
representation of the label.
This attempts to be somewhat clever in choosing to print or
suppress null components.
toString
in interface Label
toString
in class AbstractLabel
public void setFromString(String labelStr)
setFromString
in interface Label
setFromString
in class StringLabel
labelStr
- The str for the labelpublic LabelFactory labelFactory()
CategoryWordTag
).
The factory returned is always the same one (a singleton).
labelFactory
in interface Label
labelFactory
in class StringLabel
public static LabelFactory factory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |