|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.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(String word)
|
|
WordLemmaTag(String word,
String tag)
Create a new WordLemmaTag . |
|
WordLemmaTag(String word,
String lemma,
String tag)
Create a new WordLemmaTag . |
Method Summary | |
---|---|
int |
compareTo(WordLemmaTag wordLemmaTag)
Orders first by word, then by lemma, then by tag. |
boolean |
equals(Object obj)
Equality is satisfied only if the compared object is a WordLemmaTag and has String-equal word, lemma and tag fields. |
LabelFactory |
labelFactory()
Return a factory for this kind of label (i.e., TaggedWord ). |
String |
lemma()
|
static void |
main(String[] args)
|
static void |
setDivider(String divider)
Set the String (usually just a single character) used to mark the separation between the word and the tag. |
void |
setFromString(String labelStr)
The String is divided according to the divider character (usually, "/"). |
void |
setLemma(String lemma)
|
void |
setTag(String tag)
Set the tag value for the label (if one is stored). |
void |
setValue(String value)
Set the value for the Label. |
void |
setWord(String word)
Set the word value for the label (if one is stored). |
String |
tag()
Return the tag value of the label (or null if none). |
String |
toString()
Return a String representation of the Label. |
String |
value()
Return a String representation of just the "main" value of this Label. |
String |
word()
Return the word value of the label (or null if none). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WordLemmaTag(String word)
public WordLemmaTag(Label word)
public WordLemmaTag()
public WordLemmaTag(String word, 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 Labelpublic WordLemmaTag(String word, String lemma, 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 Labelpublic 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 LabelMethod Detail |
---|
public String value()
value
in interface Label
public String word()
HasWord
word
in interface HasWord
public void setValue(String value)
setValue
in interface Label
value
- the value for the Labelpublic void setWord(String word)
HasWord
setWord
in interface HasWord
word
- The word value for the labelpublic void setLemma(String lemma)
public void setTag(String tag)
HasTag
setTag
in interface HasTag
tag
- The tag value for the labelpublic String tag()
HasTag
tag
in interface HasTag
public String lemma()
public String toString()
toString
in interface Label
toString
in class Object
public void setFromString(String labelStr)
null
.
We assume that if only one divider character is found, word and tag are presents in
the String, and lemma will be computed.
setFromString
in interface Label
labelStr
- The word that will go into the WordLemmaTag
public boolean equals(Object obj)
equals
in class Object
public int compareTo(WordLemmaTag wordLemmaTag)
compareTo
in interface 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 Label
public static void setDivider(String divider)
TaggedWord
via the toString()
method, and when reading in a TaggedWord
via the
setFromString()
method.
Unless altered using this method, the default is "/".
divider
- The String between words, tags (and lemmas)public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |