edu.stanford.nlp.trees
Class AdaptiveLabelFactory

java.lang.Object
  |
  +--edu.stanford.nlp.trees.AdaptiveLabelFactory
All Implemented Interfaces:
LabelFactory

public class AdaptiveLabelFactory
extends Object
implements LabelFactory

An AdaptiveLabelFactory object makes simple Labels for objects, by creating a label of an appropriate type depending on the arguments passed in.


Field Summary
static int CATEGORY_LABEL
           
static int TAG_LABEL
           
static int WORD_LABEL
           
 
Constructor Summary
AdaptiveLabelFactory()
           
 
Method Summary
 Label newLabel(Label oldLabel)
          Create a new Label, where the label is formed from the Label object passed in.
 Label newLabel(String labelStr)
          The AdaptiveLabelFactory does not support this operation, because it does not know what sort of label to make.
 Label newLabel(String labelStr, int options)
          Create a new Label, where the Label is formed from the passed in String, using it to name the component given by options.
 Label newLabelFromString(String labelStr)
          The AdaptiveLabelFactory does not support this operation, because it does not know what sort of label to make.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORD_LABEL

public static final int WORD_LABEL
See Also:
Constant Field Values

TAG_LABEL

public static final int TAG_LABEL
See Also:
Constant Field Values

CATEGORY_LABEL

public static final int CATEGORY_LABEL
See Also:
Constant Field Values
Constructor Detail

AdaptiveLabelFactory

public AdaptiveLabelFactory()
Method Detail

newLabel

public Label newLabel(String labelStr)
The AdaptiveLabelFactory does not support this operation, because it does not know what sort of label to make.

Specified by:
newLabel in interface LabelFactory
Parameters:
labelStr - A string that determines the content of the label.
Returns:
The created label
Throws:
UnsupportedOperationException

newLabel

public Label newLabel(String labelStr,
                      int options)
Create a new Label, where the Label is formed from the passed in String, using it to name the component given by options.

Specified by:
newLabel in interface LabelFactory
Parameters:
labelStr - A String to use as the label
options - May determine what kind of label is created
Returns:
The created label

newLabelFromString

public Label newLabelFromString(String labelStr)
The AdaptiveLabelFactory does not support this operation, because it does not know what sort of label to make.

Specified by:
newLabelFromString in interface LabelFactory
Parameters:
labelStr - A string that determines the content of the label.
Returns:
The created label
Throws:
UnsupportedOperationException

newLabel

public Label newLabel(Label oldLabel)
Create a new Label, where the label is formed from the Label object passed in. Depending on the first non-null component, looking in the order category, first, then word, and then tag, an object of the appropriate sort is created.

Specified by:
newLabel in interface LabelFactory
Parameters:
oldLabel - The Label that the new label is being created from
Returns:
a new label of a particular type


Stanford NLP Group