edu.stanford.nlp.ling
Class WordLemmaTagFactory

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

public class WordLemmaTagFactory
extends Object
implements LabelFactory

/** A WordLemmaTagFactory acts as a factory for creating objects of class WordLemmaTag.

Author:
Marie-Catherine de Marneffe

Field Summary
static int LEMMA_LABEL
           
static int TAG_LABEL
           
 
Constructor Summary
WordLemmaTagFactory()
          Create a new WordLemmaTagFactory.
WordLemmaTagFactory(char divider)
          Create a new WordLemmaTagFactory.
 
Method Summary
 Label newLabel(Label oldLabel)
          Create a new WordLemmaTag 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 (word).
 Label newLabel(String labelStr, int options)
          Make a new label with this String as a value component.
 Label newLabelFromString(String labelStr)
          Create a new word, where the label is formed from the String passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEMMA_LABEL

public static final int LEMMA_LABEL
See Also:
Constant Field Values

TAG_LABEL

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

WordLemmaTagFactory

public WordLemmaTagFactory()
Create a new WordLemmaTagFactory. The divider will be taken as '/'.


WordLemmaTagFactory

public WordLemmaTagFactory(char divider)
Create a new WordLemmaTagFactory.

Parameters:
divider - This character will be used in calls to the one argument version of newLabel(), to divide word from lemma and tag.
Method Detail

newLabel

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

Specified by:
newLabel in interface LabelFactory
Parameters:
labelStr - The String that will be used for value
Returns:
The new WordLemmaTag (lemma and tag will be null)

newLabel

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

Specified by:
newLabel in interface LabelFactory
Parameters:
labelStr - The String that will be used for value
options - what to make (use labelStr as word, lemma or tag)
Returns:
The new WordLemmaTag (word or lemma or tag will be null)

newLabelFromString

public Label newLabelFromString(String labelStr)
Create a new word, where the label is formed from the String passed in. The String is divided according to the divider character. We assume that we can always just divide on the rightmost divider character, rather than trying to parse up escape sequences. If the divider character isn't found in the word, then the whole string becomes the word, and lemma and tag are null. We assume that if only one divider character is found, word and tag are presents in the String, and lemma will be computed.

Specified by:
newLabelFromString in interface LabelFactory
Parameters:
labelStr - The word that will go into the Word
Returns:
The new WordLemmaTag

newLabel

public Label newLabel(Label oldLabel)
Create a new WordLemmaTag Label, where the label is formed from the Label object passed in. Depending on what fields each label has, other things will be null.

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