|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.stanford.nlp.ling.ValueLabel edu.stanford.nlp.ling.StringLabel edu.stanford.nlp.ling.CategoryWordTag
public class 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
Field Summary | |
---|---|
static boolean |
printWordTag
If this is false, the tag and word are never printed in toString() calls. |
static boolean |
suppressTerminalDetails
If set to true, when a terminal or preterminal has as its category something that is also the word or tag value, the latter are suppressed. |
protected String |
tag
|
protected String |
word
|
Constructor Summary | |
---|---|
CategoryWordTag()
|
|
CategoryWordTag(Label oldLabel)
Creates a new CategoryWordTag label from an existing label. |
|
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 toString 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.ling.StringLabel |
---|
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 |
Field Detail |
---|
protected String word
protected String tag
public static boolean printWordTag
public static boolean suppressTerminalDetails
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)
oldLabel
- The label to use as a basis of this LabelMethod Detail |
---|
public String category()
HasCategory
category
in interface HasCategory
public void setCategory(String category)
HasCategory
setCategory
in interface HasCategory
category
- The category value for the labelpublic 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 ValueLabel
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 |