edu.stanford.nlp.trees
Class CategoryWordTag

java.lang.Object
  |
  +--edu.stanford.nlp.trees.AbstractLabel
        |
        +--edu.stanford.nlp.trees.StringLabel
              |
              +--edu.stanford.nlp.trees.CategoryWordTag
All Implemented Interfaces:
Comparable, HasCategory, HasTag, HasWord, Label

public class CategoryWordTag
extends StringLabel
implements HasCategory, HasWord, HasTag

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

CategoryWordTag

public CategoryWordTag()

CategoryWordTag

public CategoryWordTag(String label)
This one argument constructor sets just the value.

Parameters:
label - the string that will become the category/value

CategoryWordTag

public CategoryWordTag(String category,
                       String word,
                       String tag)

CategoryWordTag

public CategoryWordTag(Label oldLabel)
Method Detail

category

public String category()
Description copied from interface: HasCategory
Return the category value of the label (or null if none).

Specified by:
category in interface HasCategory
Returns:
String the category value for the label

setCategory

public void setCategory(String category)
Description copied from interface: HasCategory
Set the category value for the label (if one is stored).

Specified by:
setCategory in interface HasCategory

word

public String word()
Description copied from interface: HasWord
Return the word value of the label (or null if none).

Specified by:
word in interface HasWord
Returns:
String the word value for the label

setWord

public void setWord(String word)
Description copied from interface: HasWord
Set the word value for the label (if one is stored).

Specified by:
setWord in interface HasWord
Parameters:
word - The word value for the label

tag

public String tag()
Description copied from interface: HasTag
Return the tag value of the label (or null if none).

Specified by:
tag in interface HasTag
Returns:
String the tag value for the label

setTag

public void setTag(String tag)
Description copied from interface: HasTag
Set the tag value for the label (if one is stored).

Specified by:
setTag in interface HasTag
Parameters:
tag - The tag value for the label

setCategoryWordTag

public void setCategoryWordTag(String category,
                               String word,
                               String tag)

toString

public String toString()
Returns a String representation of the label. This attempts to be somewhat clever in choosing to print or suppress null components.

Specified by:
toString in interface Label
Overrides:
toString in class AbstractLabel
Returns:
The label as a string

setFromString

public void setFromString(String labelStr)
Set everything by reversing a two string operation. This should be added at some point.

Specified by:
setFromString in interface Label
Overrides:
setFromString in class StringLabel
Parameters:
labelStr - The str for the label

labelFactory

public LabelFactory labelFactory()
Return a factory for this kind of label (i.e., CategoryWordTag). The factory returned is always the same one (a singleton).

Specified by:
labelFactory in interface Label
Overrides:
labelFactory in class StringLabel
Returns:
The label factory

factory

public static LabelFactory factory()
Return a factory for this kind of label

Returns:
The label factory


Stanford NLP Group