|
|||||||||
| 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.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 java.lang.String |
tag
|
protected java.lang.String |
word
|
| Constructor Summary | |
|---|---|
CategoryWordTag()
|
|
CategoryWordTag(Label oldLabel)
Creates a new CategoryWordTag label from an existing label. |
|
CategoryWordTag(java.lang.String label)
This one argument constructor sets just the value. |
|
CategoryWordTag(java.lang.String category,
java.lang.String word,
java.lang.String tag)
|
|
| Method Summary | |
|---|---|
java.lang.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(java.lang.String category)
Set the category value for the label (if one is stored). |
void |
setCategoryWordTag(java.lang.String category,
java.lang.String word,
java.lang.String tag)
|
void |
setFromString(java.lang.String labelStr)
Set everything by reversing a toString operation. |
void |
setTag(java.lang.String tag)
Set the tag value for the label (if one is stored). |
void |
setWord(java.lang.String word)
Set the word value for the label (if one is stored). |
java.lang.String |
tag()
Return the tag value of the label (or null if none). |
java.lang.String |
toString()
Returns a String representation of the label. |
java.lang.String |
toString(java.lang.String mode)
Returns a String representation of the label. |
java.lang.String |
word()
Return the word value of the label (or null if none). |
| Methods inherited from class edu.stanford.nlp.ling.StringLabel |
|---|
beginPosition, endPosition, setBeginPosition, setEndPosition, 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 java.lang.String word
protected java.lang.String tag
public static boolean printWordTag
public static boolean suppressTerminalDetails
| Constructor Detail |
|---|
public CategoryWordTag()
public CategoryWordTag(java.lang.String label)
label - the string that will become the category/value
public CategoryWordTag(java.lang.String category,
java.lang.String word,
java.lang.String tag)
public CategoryWordTag(Label oldLabel)
oldLabel - The label to use as a basis of this Label| Method Detail |
|---|
public java.lang.String category()
HasCategory
category in interface HasCategorypublic void setCategory(java.lang.String category)
HasCategory
setCategory in interface HasCategorycategory - The category value for the labelpublic java.lang.String word()
HasWord
word in interface HasWordpublic void setWord(java.lang.String word)
HasWord
setWord in interface HasWordword - The word value for the labelpublic java.lang.String tag()
HasTag
tag in interface HasTagpublic void setTag(java.lang.String tag)
HasTag
setTag in interface HasTagtag - The tag value for the label
public void setCategoryWordTag(java.lang.String category,
java.lang.String word,
java.lang.String tag)
public java.lang.String toString()
String representation of the label.
This attempts to be somewhat clever in choosing to print or
suppress null components and the details of words or categories
depending on the setting of printWordTag and
suppressTerminalDetails.
toString in interface LabeltoString in class StringLabelpublic java.lang.String toString(java.lang.String mode)
String representation of the label.
If the argument String is "full" then all components of the label
are returned, and otherwise the normal toString() is returned.
public void setFromString(java.lang.String labelStr)
setFromString in interface LabelsetFromString in class StringLabellabelStr - The str for the labelpublic LabelFactory labelFactory()
CategoryWordTag).
The factory returned is always the same one (a singleton).
labelFactory in interface LabellabelFactory in class StringLabelpublic static LabelFactory factory()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||