edu.stanford.nlp.trees
Class WordFactory

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

public class WordFactory
extends Object
implements LabelFactory

A WordFactory acts as a factory for creating objects of class Word.


Constructor Summary
WordFactory()
          Creates a new WordFactory.
 
Method Summary
 Label newLabel(Label oldLabel)
          Create a new Word Label, where the label is formed from the Label object passed in.
 Label newLabel(String word)
          Create a new word, where the label is formed from the String passed in.
 Label newLabel(String word, int options)
          Create a new word, where the label is formed from the String passed in.
 Label newLabelFromString(String word)
          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
 

Constructor Detail

WordFactory

public WordFactory()
Creates a new WordFactory.

Method Detail

newLabel

public Label newLabel(String word)
Create a new word, where the label is formed from the String passed in.

Specified by:
newLabel in interface LabelFactory
Parameters:
word - The word that will go into the Word
Returns:
The new label

newLabel

public Label newLabel(String word,
                      int options)
Create a new word, where the label is formed from the String passed in.

Specified by:
newLabel in interface LabelFactory
Parameters:
word - The word that will go into the Word
options - is ignored by a WordFactory
Returns:
The new label

newLabelFromString

public Label newLabelFromString(String word)
Create a new word, where the label is formed from the String passed in.

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

newLabel

public Label newLabel(Label oldLabel)
Create a new Word 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