edu.stanford.nlp.ling
Class MapLabelFactory

java.lang.Object
  extended by edu.stanford.nlp.ling.MapLabelFactory
All Implemented Interfaces:
LabelFactory

public class MapLabelFactory
extends Object
implements LabelFactory

A MapLabelFactory is a factory that makes a Label which is a MapLabel.

Author:
Bill MacCartney

Constructor Summary
MapLabelFactory()
           
 
Method Summary
static void main(String[] args)
          Just for testing.
 Label newLabel(Label oldLabel)
          Create a new MapLabel with the value of oldLabel as its value.
 Label newLabel(String str)
          Make a new label with this String as the value.
 Label newLabel(String str, int options)
          Make a new label with this String as the value.
 Label newLabelFromString(String str)
          Make a new label with this String as the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapLabelFactory

public MapLabelFactory()
Method Detail

newLabel

public Label newLabel(String str)
Make a new label with this String as the value.

Specified by:
newLabel in interface LabelFactory
Parameters:
str - the string to use as a value
Returns:
the newly created label

newLabel

public Label newLabel(String str,
                      int options)
Make a new label with this String as the value. This implementation ignores the options.

Specified by:
newLabel in interface LabelFactory
Parameters:
str - the string to use as a value
options - this argument is ignored
Returns:
the newly created label

newLabelFromString

public Label newLabelFromString(String str)
Make a new label with this String as the value.

Specified by:
newLabelFromString in interface LabelFactory
Parameters:
str - the string to use as a value
Returns:
the newly created label

newLabel

public Label newLabel(Label oldLabel)
Create a new MapLabel with the value of oldLabel as its value.

If oldLabel is a MapLabel, the new label is identical to oldLabel (but does not share storage).

If oldLabel is a CategoryWordTag, the category, word, and tag are stored in the map of the new label under the map keys CATEGORY_KEY, HEAD_WORD_KEY, and HEAD_TAG_KEY, respectively.

Specified by:
newLabel in interface LabelFactory
Parameters:
label - the other label
Returns:
The new label of a particular type

main

public static void main(String[] args)
Just for testing.



Stanford NLP Group