|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.ArrayCoreMap
edu.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). TODO: However, something now used in various places is that it has a tidy minimal toString output of value-index, which is not preserved in CoreLabel. Maybe it should be but changing that might also break stuff now.
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 |
Constructor Summary | |
---|---|
CyclicCoreLabel()
Default constructor, calls super() |
|
CyclicCoreLabel(CoreLabel label)
Copy constructor from any CoreMap. |
|
CyclicCoreLabel(CoreMap label)
Copy constructor from any CoreMap. |
|
CyclicCoreLabel(CyclicCoreLabel label)
Copy constructor from any CoreMap. |
|
CyclicCoreLabel(Label label)
Copy constructor from any CoreMap. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Two CoreMaps are equal iff all keys and values are equal (really, ==). |
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, beginPosition, category, current, docID, endPosition, getString, index, lemma, ner, prependBefore, sentIndex, setAfter, setBefore, setBeginPosition, setCategory, setCurrent, setDocID, setEndPosition, setFromString, setIndex, setLemma, setNER, setSentIndex, setTag, setValue, setWord, tag, value, word |
Methods inherited from class edu.stanford.nlp.util.ArrayCoreMap |
---|
compact, containsKey, get, has, keySet, remove, set, setCapacity, size, toShorterString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CyclicCoreLabel()
public CyclicCoreLabel(Label label)
public CyclicCoreLabel(CoreMap label)
public CyclicCoreLabel(CoreLabel label)
public CyclicCoreLabel(CyclicCoreLabel label)
Method Detail |
---|
public boolean equals(Object obj)
equals
in class ArrayCoreMap
public int hashCode()
hashCode
in class ArrayCoreMap
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 ArrayCoreMap
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |