|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ling.AbstractMapLabel
public abstract class AbstractMapLabel
An abstract class for Label objects which store attributes in a Map. Also implements HasWord, HasTag, HasCategory, and HasContext by storing the words, tags, etc. under standardized keys in the Map.
For convenience, this class also contains standardized keys for storing many other possible label attributes, such as head words, ner tags, etc.
Field Summary | |
---|---|
static String |
AFTER_KEY
the standard key for the String that comes after this word (from the InvertiblePTBTokenizer) |
static String |
ANSWER_KEY
The standard key for the answer which is a String |
static String |
ARG_KEY
The standard key for a propbank label which is of type Argument |
static String |
BEFORE_KEY
the standard key for the String that comes before this word (from the InvertiblePTBTokenizer) |
static String |
CATEGORY_FUNCTIONAL_TAG_KEY
The standard key for storing category with functional tags. |
static String |
CATEGORY_KEY
The standard key for storing a category in the map, as a String. |
static String |
CURRENT_KEY
the standard key for the actual, unmangled, pre-PTB'd word (from the InvertiblePTBTokenizer) |
static String |
FEATURES_KEY
The standard key for the features which is a Collection |
static String |
GOLDANSWER_KEY
The standard key for gold answer which is a String |
static String |
HEAD_TAG_KEY
The standard key for storing a head tag in the map as a pointer to another node. |
static String |
HEAD_WORD_KEY
The standard key for storing a head word in the map as a pointer to another node. |
static String |
INDEX_KEY
The standard key for storing an integer index in the map. |
static String |
LEFT_TERM_KEY
The Standard key for storing the left terminal number relative to the root of the tree of the leftmost terminal dominated by the current node |
protected Map |
map
The Map which stores all of the attributes for this label, and the label value itself. |
static String |
MARKING_KEY
Another key used for propbank - to signify core arg nodes or predicate nodes |
static String |
NER_KEY
the standard key for the NER label. |
static String |
PARENT_KEY
The standard key for the parent which is a String |
static String |
SEMANTIC_HEAD_POS_KEY
The standard key for Semantic Head Word POS which is a String |
static String |
SEMANTIC_HEAD_WORD_KEY
The standard key for Semantic Head Word which is a String |
static String |
SPAN_KEY
The standard key for span which is a String |
static String |
TAG_KEY
The standard key for storing a tag in the map. |
static String |
VALUE_KEY
The standard key for storing a value in the map, as a String. |
static String |
VERB_SENSE_KEY
Probank key for the Verb sense given in the Propbank Annotation, should only be in the verbnode |
static String |
WORD_KEY
The standard key for storing a word in the map, as a String. |
Constructor Summary | |
---|---|
protected |
AbstractMapLabel()
|
Method Summary | |
---|---|
String |
after()
Return the String after the word, which is stored in the map under the key . |
String |
answer()
convenience method for getting answer * |
void |
appendAfter(String after)
Append this String to the current after String |
String |
before()
Return the String before the word, which is stored in the map under the key . |
String |
category()
Return the category of the label (or null if
none), which is stored in the map under the key . |
String |
current()
Return the String which is the unmangled word, which is stored in the map under the key . |
Object |
get(Object key)
Returns the value to which the map contained in this label maps the specified key. |
Collection |
getFeatures()
|
String |
getSemanticTag()
Returns the semantic head pos of the phrase if it exists, and null otherwise |
String |
getSemanticWord()
Returns the semantic head of the phrase if it exists, and null otherwise |
String |
goldAnswer()
convenience method for getting gold answer * |
Object |
headTag()
|
Object |
headWord()
Return the head word of the label (or null if
none), which is stored in the map under the key . |
int |
index()
Return the index of the label (or -1 if none), which is stored in the map under the key . |
Map |
map()
Return the Map contained in this label. |
String |
ner()
Return the NER type of the word, which is stored in the map under the key . |
void |
prependBefore(String before)
Prepend this String to the current before String |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in the map contained in this label. |
void |
setAfter(String after)
Set the String after the word by storing it in the map under the key . |
void |
setAnswer(String answer)
convenience method for setting answer * |
void |
setBefore(String before)
Set the String before the word by storing it in the map under the key BEFORE }. |
void |
setCategory(String category)
Set the category for the label. |
void |
setCurrent(String current)
Set the String which is the unmangled word, which is stored in the map under the key . |
void |
setFeatures(Collection features)
|
void |
setFromString(String str)
Set value for the label from a String. |
void |
setGoldAnswer(String goldAnswer)
convenience method for setting gold answer * |
void |
setHeadTag(Object headTagPtr)
Set a pointer to the head-word for the label. |
void |
setHeadWord(Object headWordPtr)
Set a pointer to the head-word for the label. |
int |
setIndex(int index)
Set the index for the label by storing it in the contained map under the key . |
void |
setMap(Map map)
Set the Map contained in this AbstractMapLabel to the
supplied Map . |
void |
setNER(String ner)
Set the NER label for the word, using the key . |
void |
setSemanticTag(String hTag)
Set the semantic head pos of the phrase |
void |
setSemanticWord(String hWord)
Set the semantic head of the phrase |
void |
setSpan(String span)
|
void |
setTag(String tag)
Set the head tag for the label by storing it in the map under the key . |
void |
setValue(String value)
Set the value for the label. |
void |
setWord(String word)
Set the word for the label. |
IntPair |
span()
The span of this node as begin and end positions if it exists |
String |
tag()
Return the head tag of the label (or null if none),
which is stored in the map under the key . |
String |
value()
Return a String representation of just the "main" value of this label. |
String |
word()
Return the word of the label, stored in the map under the key WORD_KEY . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.stanford.nlp.ling.Label |
---|
labelFactory, toString |
Field Detail |
---|
public static final String VALUE_KEY
public static final String TAG_KEY
public static final String WORD_KEY
public static final String CATEGORY_KEY
public static final String HEAD_WORD_KEY
public static final String HEAD_TAG_KEY
public static final String INDEX_KEY
public static final String ARG_KEY
public static final String MARKING_KEY
public static final String SEMANTIC_HEAD_WORD_KEY
public static final String SEMANTIC_HEAD_POS_KEY
public static final String VERB_SENSE_KEY
public static final String CATEGORY_FUNCTIONAL_TAG_KEY
public static final String NER_KEY
public static final String LEFT_TERM_KEY
public static final String PARENT_KEY
public static final String SPAN_KEY
public static final String BEFORE_KEY
public static final String AFTER_KEY
public static final String CURRENT_KEY
public static String ANSWER_KEY
public static String GOLDANSWER_KEY
public static String FEATURES_KEY
protected Map map
Constructor Detail |
---|
protected AbstractMapLabel()
Method Detail |
---|
public Map map()
Map
contained in this label.
Map
contained in this AbstractMapLabelpublic void setMap(Map map)
Map
contained in this AbstractMapLabel to the
supplied Map
.
map
- the new Map
for this labelpublic Object get(Object key)
null
if the map
contains no mapping for this key. (Analogous to Map.get(Object key)
.)
key
- key whose associated value is to be returned.
null
if the map
contains no mapping for this key.public Object put(Object key, Object value)
Map.put(Object key, Object value)
.)
If the map previously contained a mapping for this key, the
old value is replaced by the specified value.
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
null
if there was no mapping for key.public String value()
Label
value
in interface Label
public void setValue(String value)
setValue
in interface Label
value
- the value for the labelpublic void setFromString(String str)
setFromString
in interface Label
str
- the string value for the labelpublic String category()
null
if
none), which is stored in the map under the key CATEGORY_KEY
.
category
in interface HasCategory
public void setCategory(String category)
setCategory
in interface HasCategory
category
- the category for the labelpublic String word()
WORD_KEY
.
word
in interface HasWord
public void setWord(String word)
setWord
in interface HasWord
word
- the head word for the labelpublic IntPair span()
public void setSpan(String span)
public Object headWord()
null
if
none), which is stored in the map under the key HEAD_WORD_KEY
.
public void setHeadWord(Object headWordPtr)
public String getSemanticWord()
public void setSemanticWord(String hWord)
public String getSemanticTag()
public void setSemanticTag(String hTag)
public String tag()
null
if none),
which is stored in the map under the key TAG_KEY
.
tag
in interface HasTag
public void setTag(String tag)
HEAD_TAG_KEY
.
setTag
in interface HasTag
tag
- the head tag for the labelpublic Object headTag()
public void setHeadTag(Object headTagPtr)
public String ner()
NER
.
public void setNER(String ner)
NER
.
ner
- The String ner the wordpublic int index()
INDEX_KEY
.
public int setIndex(int index)
INDEX_KEY
. Returns the old index (or -1 if none).
public String before()
BEFORE
.
before
in interface HasContext
public void setBefore(String before)
BEFORE
}.
setBefore
in interface HasContext
before
- the String before the wordpublic void prependBefore(String before)
prependBefore
in interface HasContext
before
- the String to be prependedpublic String current()
CURRENT
.
current
in interface HasContext
public void setCurrent(String current)
CURRENT
.
setCurrent
in interface HasContext
current
- the unmangled wordpublic String after()
AFTEr
.
after
in interface HasContext
public void setAfter(String after)
AFTER
.
setAfter
in interface HasContext
after
- The String after the wordpublic void appendAfter(String after)
appendAfter
in interface HasContext
after
- The String to be prependedpublic String answer()
public void setAnswer(String answer)
public String goldAnswer()
public void setGoldAnswer(String goldAnswer)
public Collection getFeatures()
public void setFeatures(Collection features)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |