|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ling.ValueLabel
edu.stanford.nlp.ling.StringLabel
edu.stanford.nlp.ling.Word
public class Word
A Word
object acts as a Label by containing a String.
This class is in essence identical to a StringLabel
, but
it also uses the value to implement the HasWord
interface.
Field Summary | |
---|---|
static Word |
EMPTY
Word representation of an empty. |
static String |
EMPTYSTRING
String representation of an empty. |
Constructor Summary | |
---|---|
Word()
Construct a new word with a null value. |
|
Word(Label lab)
Creates a new word whose word value is the value of any class that supports the Label interface. |
|
Word(String word)
Construct a new word, with the given value. |
Method Summary | |
---|---|
static LabelFactory |
factory()
Return a factory for this kind of label. |
LabelFactory |
labelFactory()
Return a factory for this kind of label (i.e., Word ). |
void |
setWord(String word)
Set the word value for the label (if one is stored). |
String |
word()
Return the word value of the label (or null if none). |
Methods inherited from class edu.stanford.nlp.ling.StringLabel |
---|
setFromString, setValue, value |
Methods inherited from class edu.stanford.nlp.ling.ValueLabel |
---|
compareTo, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String EMPTYSTRING
public static final Word EMPTY
Constructor Detail |
---|
public Word()
null
value.
public Word(String word)
word
- String value of the Wordpublic Word(Label lab)
Label
interface.
lab
- The label to be used as the basis of the new WordMethod Detail |
---|
public String word()
HasWord
word
in interface HasWord
public void setWord(String word)
HasWord
setWord
in interface HasWord
word
- The word value for the labelpublic LabelFactory labelFactory()
Word
).
The factory returned is always the same one (a singleton).
labelFactory
in interface Label
labelFactory
in class StringLabel
public static LabelFactory factory()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |