|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.ling.WordLemmaTag
public class WordLemmaTag
A WordLemmaTag corresponds to a pair of a tagged (e.g., for part of speech)
word and its lemma. WordLemmaTag is implemented with String-valued word,
lemma and tag.
It implements the Label interface; the value() method for that
interface corresponds to the word of the WordLemmaTag.
| Constructor Summary | |
|---|---|
WordLemmaTag()
|
|
WordLemmaTag(Label word)
|
|
WordLemmaTag(Label word,
Label tag)
Create a new WordLemmaTag from a Label. |
|
WordLemmaTag(java.lang.String word)
|
|
WordLemmaTag(java.lang.String word,
java.lang.String tag)
Create a new WordLemmaTag. |
|
WordLemmaTag(java.lang.String word,
java.lang.String lemma,
java.lang.String tag)
Create a new WordLemmaTag. |
|
| Method Summary | |
|---|---|
int |
compareTo(WordLemmaTag wordLemmaTag)
Orders first by word, then by lemma, then by tag. |
boolean |
equals(java.lang.Object o)
Equality is satisfied only if the compared object is a WordLemmaTag and has String-equal word, lemma and tag fields. |
int |
hashCode()
|
LabelFactory |
labelFactory()
Return a factory for this kind of label (i.e., TaggedWord). |
java.lang.String |
lemma()
|
static void |
main(java.lang.String[] args)
|
void |
setFromString(java.lang.String labelStr)
The String is divided according to the divider character (usually, "/"). |
void |
setFromString(java.lang.String labelStr,
java.lang.String divider)
|
void |
setLemma(java.lang.String lemma)
|
void |
setTag(java.lang.String tag)
Set the tag for the Label. |
void |
setValue(java.lang.String value)
Set the value for the Label. |
void |
setWord(java.lang.String word)
Set the word value for the label (if one is stored). |
java.lang.String |
tag()
Return the tag value of the label (or null if none). |
java.lang.String |
toString()
Return a String representation of the Label. |
java.lang.String |
toString(java.lang.String divider)
|
java.lang.String |
value()
Return a String representation of just the "main" value of this Label. |
java.lang.String |
word()
Return the word value of the label (or null if none). |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WordLemmaTag(java.lang.String word)
public WordLemmaTag(Label word)
public WordLemmaTag()
public WordLemmaTag(java.lang.String word,
java.lang.String tag)
WordLemmaTag.
word - This word is set as the word of this Labeltag - The value() of this Label is set as the
tag of this Label
public WordLemmaTag(java.lang.String word,
java.lang.String lemma,
java.lang.String tag)
WordLemmaTag.
word - This word is passed to the supertype constructorlemma - The lemma is set as the lemma of this Labeltag - The value() of this Label is set as the
tag of this Label
public WordLemmaTag(Label word,
Label tag)
WordLemmaTag from a Label. The value of
the Label corresponds to the word of the WordLemmaTag.
word - This word is passed to the supertype constructortag - The value() of this Label is set as the
tag of this Label| Method Detail |
|---|
public java.lang.String value()
value in interface Labelpublic java.lang.String word()
HasWord
word in interface HasWordpublic void setValue(java.lang.String value)
setValue in interface Labelvalue - the value for the Labelpublic void setWord(java.lang.String word)
HasWord
setWord in interface HasWordword - The word value for the labelpublic void setLemma(java.lang.String lemma)
public final void setTag(java.lang.String tag)
setTag in interface HasTagtag - the value for the Labelpublic java.lang.String tag()
HasTag
tag in interface HasTagpublic java.lang.String lemma()
public java.lang.String toString()
toString in interface LabeltoString in class java.lang.Objectpublic java.lang.String toString(java.lang.String divider)
public void setFromString(java.lang.String labelStr)
null.
We assume that if only one divider character is found, word and tag are present in
the String, and lemma will be computed.
setFromString in interface LabellabelStr - The word that will go into the WordLemmaTag
public void setFromString(java.lang.String labelStr,
java.lang.String divider)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(WordLemmaTag wordLemmaTag)
compareTo in interface java.lang.Comparable<WordLemmaTag>wordLemmaTag - object to compare to
this is greater than
obj, 0 if equal, negative otherwise)public LabelFactory labelFactory()
TaggedWord).
The factory returned is always the same one (a singleton).
labelFactory in interface Labelpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||