public class InMemorySentence extends java.lang.Object implements Sentence
Sentence
interface.
The provided implementation is immutable and, therefore, instances can be freely shared.
ROOT_PHRASE_LABEL
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static InMemorySentence |
getInstance(Phrase rootPhrase)
Returns an
InMemorySentence with the given Phrase as its root node. |
Phrase |
getRootPhrase()
Returns the
Phrase that corresponds to the root node of the parse tree. |
int |
hashCode() |
java.lang.String |
toString() |
public static InMemorySentence getInstance(Phrase rootPhrase)
InMemorySentence
with the given Phrase
as its root node.rootPhrase
- the root node at the parse tree of the sentence to create.InMemorySentence
with the given Phrase
as its root node.public Phrase getRootPhrase()
Sentence
Phrase
that corresponds to the root node of the parse tree.
Its label should always be Sentence.ROOT_PHRASE_LABEL
.getRootPhrase
in interface Sentence
Phrase
that corresponds to the root node of the parse tree.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object