edu.stanford.nlp.ling
Class Tag

java.lang.Object
  extended by edu.stanford.nlp.ling.ValueLabel
      extended by edu.stanford.nlp.ling.StringLabel
          extended by edu.stanford.nlp.ling.Tag
All Implemented Interfaces:
HasTag, Label, Serializable, Comparable<ValueLabel>

public class Tag
extends StringLabel
implements HasTag

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

Author:
Christopher Manning
See Also:
Serialized Form

Constructor Summary
Tag()
          Constructs a Tag object.
Tag(Label lab)
          Creates a new tag whose tag value is the value of any class that supports the Label interface.
Tag(String tag)
          Constructs a Tag object.
 
Method Summary
static LabelFactory factory()
          Return a factory for this kind of label (i.e., Tag).
 LabelFactory labelFactory()
          Return a factory for this kind of label (i.e., Tag).
 void setTag(String tag)
          Set the tag value for the label (if one is stored).
 String tag()
          Return the tag value of the label (or null if none).
 
Methods inherited from class edu.stanford.nlp.ling.StringLabel
setFromString, setValue, value
 
Methods inherited from class edu.stanford.nlp.ling.ValueLabel
compareTo, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Constructs a Tag object.


Tag

public Tag(String tag)
Constructs a Tag object.

Parameters:
tag - The tag name

Tag

public Tag(Label lab)
Creates a new tag whose tag 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 Tag
Method Detail

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

labelFactory

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

Returns:
The label factory


Stanford NLP Group