|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ling.CoreLabel
edu.stanford.nlp.ling.CyclicCoreLabel
public class CyclicCoreLabel
Version of CoreLabel that allows for cycles in values/keys. Equals is defined as object equality, hashcode is defined on object address, and toString will not print cycles. TODO: This class may be removable if it is the case that TreeGraphNode (it's main user) doesn't actually need the cyclic semantics (because we fixed a bug in its lack of hashCode).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.stanford.nlp.ling.CoreLabel |
---|
CoreLabel.GenericAnnotation<T> |
Nested classes/interfaces inherited from interface edu.stanford.nlp.util.TypesafeMap |
---|
TypesafeMap.Key<BASE,VALUE> |
Field Summary |
---|
Fields inherited from class edu.stanford.nlp.ling.CoreLabel |
---|
genericKeys, genericValues, map |
Constructor Summary | |
---|---|
CyclicCoreLabel()
Default constructor, calls super() |
|
CyclicCoreLabel(Label label)
Copy constructor from any CoreMap. |
Method Summary | |
---|---|
boolean |
cyclicEquals(Object obj)
Equals method that is well defined even if there are cycles in keys/values. |
int |
cyclicHashCode()
Hashcode function that works on object address equality. |
String |
cyclicToString()
To string method that works regardless of whether cycles exist |
boolean |
equals(Object obj)
Two CoreMaps are equal iff all keys and values are equal. |
static LabelFactory |
factory()
|
int |
hashCode()
Returns a composite hashcode over all the keys and values currently stored in the map. |
LabelFactory |
labelFactory()
Returns a factory that makes labels of the exact same type as this one. |
String |
toString()
Return a String containing the value (and index,
if any) of this label. |
String |
toString(String format)
Returns a formatted string representing this label. |
Methods inherited from class edu.stanford.nlp.ling.CoreLabel |
---|
after, appendAfter, before, category, containsKey, current, docID, fromCoreMap, get, getString, has, index, keySet, lemma, ner, prependBefore, remove, sentIndex, set, setAfter, setBefore, setCategory, setCurrent, setDocID, setFromString, setIndex, setLemma, setNER, setSentIndex, setTag, setValue, setWord, size, tag, value, word |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CyclicCoreLabel()
public CyclicCoreLabel(Label label)
Method Detail |
---|
public boolean equals(Object obj)
equals
in class CoreLabel
public int hashCode()
hashCode
in class CoreLabel
public String toString()
String
containing the value (and index,
if any) of this label. This is equivalent to
toString("value-index").
toString
in interface Label
toString
in class CoreLabel
public String toString(String format)
String
.
Currently supported formats include:
CATEGORY_KEY
)INDEX_KEY
,
respectively, and prints them with a hyphen in between
public static LabelFactory factory()
public LabelFactory labelFactory()
null
if no appropriate factory is known.
labelFactory
in interface Label
labelFactory
in class CoreLabel
public String cyclicToString()
public int cyclicHashCode()
public boolean cyclicEquals(Object obj)
obj
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |