edu.stanford.nlp.trees
Class Category

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

public class Category
extends StringLabel
implements HasCategory

A Category object acts as a Label by containing a String that is a part-of-speech category.


Field Summary
static String EMPTYSTRING
          The empty category.
 
Constructor Summary
Category()
          Constructs a Category object.
Category(Label lab)
          Creates a new category whose category value is the value of any class that supports the Label interface.
Category(String category)
          Constructs a Category object.
 
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 (i.e., Category).
 LabelFactory labelFactory()
          Return a factory for this kind of label (i.e., Category).
 void setCategory(String category)
          Set the category value for the label (if one is stored).
 
Methods inherited from class edu.stanford.nlp.trees.StringLabel
setFromString, setValue, value
 
Methods inherited from class edu.stanford.nlp.trees.AbstractLabel
compareTo, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTYSTRING

public static final String EMPTYSTRING
The empty category.

See Also:
Constant Field Values
Constructor Detail

Category

public Category()
Constructs a Category object.


Category

public Category(String category)
Constructs a Category object.

Parameters:
category - The name of the category

Category

public Category(Label lab)
Creates a new category whose category value is the value of any class that supports the Label interface.

Parameters:
lab - The label to be used as the basis of the new Category
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

labelFactory

public LabelFactory labelFactory()
Return a factory for this kind of label (i.e., Category). 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 (i.e., Category). The factory returned is always the same one (a singleton).

Returns:
The label factory


Stanford NLP Group