edu.stanford.nlp.trees
Interface LabelFactory

All Known Implementing Classes:
AdaptiveLabelFactory, CategoryWordTagFactory, StringLabelFactory, TaggedWordFactory, WordFactory

public interface LabelFactory

A LabelFactory object acts as a factory for creating objects of class Label, or some descendent class. It can make Labels from Strings perhaps with options


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)
          Make a new label with this String as the value.
 Label newLabel(String labelStr, int options)
          Make a new label with this String as the value, and the type determined in an implementation-dependent way from the options value.
 Label newLabelFromString(String encodedLabelStr)
          Make a new label.
 

Method Detail

newLabel

public Label newLabel(String labelStr)
Make a new label with this String as the value. Any other fields of the label would normally be null.

Parameters:
labelStr - The String that will be used for balue
Returns:
The new Label

newLabel

public Label newLabel(String labelStr,
                      int options)
Make a new label with this String as the value, and the type determined in an implementation-dependent way from the options value.

Parameters:
labelStr - The String that will be used for value
options - May determine what kind of label is created
Returns:
The new Label

newLabelFromString

public Label newLabelFromString(String encodedLabelStr)
Make a new label. The String argument will be decomposed into multiple fields in an implementing class-specific way, in accordance with the class's setFromString() method.

Parameters:
encodedLabelStr - The String that will be used for labelling the object (by decoding it into parts)
Returns:
The new Label

newLabel

public Label newLabel(Label oldLabel)
Create a new Label, where the label is formed from the Label object passed in. The new Label will at least copy the value() of the source label, and may also copy other components.

Parameters:
oldLabel - The Label that the new label is being created from
Returns:
The new label of a particular type


Stanford NLP Group