public class SimpleDependencyTreeNode extends Object implements DependencyTreeNode
DependencyTreeNode
that allows
mutating access to the list of neighbors.Constructor and Description |
---|
SimpleDependencyTreeNode(String word,
String pos,
int index)
Creates a new
SimpleDependencyTreeNode node for the provided
word, with the provided part of speech. |
SimpleDependencyTreeNode(String word,
String pos,
int index,
List<DependencyRelation> neighbors)
Creates a new
SimpleDependencyTreeNode node for the provided
word, with the provided part of speech and neighbor list. |
SimpleDependencyTreeNode(String word,
String pos,
String lemma,
int index) |
SimpleDependencyTreeNode(String word,
String pos,
String lemma,
int index,
List<DependencyRelation> neighbors)
Creates a new
SimpleDependencyTreeNode node for the provided
word, with the provided part of speech and neighbor list. |
Modifier and Type | Method and Description |
---|---|
void |
addNeighbor(DependencyRelation relation)
Adds a relation from node to another node.
|
boolean |
equals(Object o) |
int |
hashCode()
Returns a hash that is the XOR of the part of speech hash and the word
hash.
|
int |
index()
Returns the index used by this
DependencyTreeNode in an array. |
String |
lemma()
The lemmatized version of the word, if there is any.
|
List<DependencyRelation> |
neighbors()
Returns the list of neighbors to the current node.
|
String |
pos()
Returns the part of speech tag for this node.
|
String |
toString()
Returns "word:pos".
|
String |
word()
Returns the word stored in this node.
|
public SimpleDependencyTreeNode(String word, String pos, int index)
SimpleDependencyTreeNode
node for the provided
word, with the provided part of speech. Initially the neighbor list is
empty.public SimpleDependencyTreeNode(String word, String pos, String lemma, int index)
public SimpleDependencyTreeNode(String word, String pos, int index, List<DependencyRelation> neighbors)
SimpleDependencyTreeNode
node for the provided
word, with the provided part of speech and neighbor list.public SimpleDependencyTreeNode(String word, String pos, String lemma, int index, List<DependencyRelation> neighbors)
SimpleDependencyTreeNode
node for the provided
word, with the provided part of speech and neighbor list.public void addNeighbor(DependencyRelation relation)
relation
- a relation connecting this node to anotherpublic int hashCode()
public List<DependencyRelation> neighbors()
neighbors
in interface DependencyTreeNode
public String pos()
pos
in interface DependencyTreeNode
public String word()
word
in interface DependencyTreeNode
public String lemma()
lemma
in interface DependencyTreeNode
public int index()
DependencyTreeNode
in an array.index
in interface DependencyTreeNode
Copyright © 2012. All Rights Reserved.