|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.trees.TaggedWordFactory
A TaggedWordFactory
acts as a factory for creating objects of
class TaggedWord
.
Constructor Summary | |
TaggedWordFactory()
Create a new TaggedWordFactory . |
|
TaggedWordFactory(char divider)
Create a new TaggedWordFactory . |
Method Summary | |
Label |
newLabel(Label oldLabel)
Create a new TaggedWord 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 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 |
public TaggedWordFactory()
TaggedWordFactory
.
The divider will be taken as '/'.
public TaggedWordFactory(char divider)
TaggedWordFactory
.
divider
- This character will be used in calls to the one
argument version of newLabel()
, to divide
the word from the tag. Stuff after the last instance of this
character will become the tag, and stuff before it will
become the label.Method Detail |
public Label newLabel(String labelStr)
String
as the value (word).
Any other fields of the label would normally be null.
newLabel
in interface LabelFactory
labelStr
- The String that will be used for value
null
)public Label newLabel(String labelStr, int options)
String
as a value component.
Any other fields of the label would normally be null.
newLabel
in interface LabelFactory
labelStr
- The String that will be used for valueoptions
- what to make (use labelStr as word or tag)
null
)public Label newLabelFromString(String word)
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 the tag
is null
.
newLabelFromString
in interface LabelFactory
word
- The word that will go into the Word
public Label newLabel(Label oldLabel)
TaggedWord Label
, where the label is
formed from
the Label
object passed in. Depending on what fields
each label has, other things will be null
.
newLabel
in interface LabelFactory
oldLabel
- The Label that the new label is being created from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |