|
MaltParser 1.0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.maltparser.core.graph.Node
public class Node
Field Summary | |
---|---|
protected HeadArcs |
arcs
the head arcs that contains one or more labeled arcs (if singleHeadedConstraint==true , it
contains only one arc per node) |
protected Node |
component
a reference to a node where the node is part of a component. |
protected Integer |
index
the node index |
protected SortedSet<Node> |
leftDependents
a sorted set of left dependent nodes (sorted according to the node index) |
protected Node |
predecessor
the previous node in the linear precedence |
protected int |
rank
|
protected SortedSet<Node> |
rightDependents
a sorted set of right dependent nodes (sorted according to the node index) |
protected boolean |
root
true if the node is a root, otherwise false |
protected boolean |
singleHeadedConstraint
|
protected Node |
successor
the next node in the linear precedence |
protected Token |
token
a reference to the token in the sentence |
Constructor Summary | |
---|---|
Node(int index,
boolean isRoot,
boolean isSingleHeaded)
|
|
Node(int index,
boolean isRoot,
boolean isSingleHeaded,
Token token)
|
Method Summary | |
---|---|
protected void |
addDependent(Node dependent)
|
void |
addHead(Node head)
|
void |
addHead(Node head,
ArcLabels arcLabelCodes)
|
void |
clear()
|
int |
compareTo(Node o)
|
Node |
findComponent()
|
ArcLabels |
getArcLabels(int headindex)
|
Node |
getClosestLeftDependent()
Returns the closest left dependent to the node it self, if not found null is returned. |
Node |
getClosestRightDependent()
Returns the closest right dependent to the node it self, if not found null is returned. |
Node |
getComponent()
|
Node |
getHead()
|
Node |
getHead(int index)
|
Integer |
getHeadLabelCode(SymbolTable table)
|
SortedSet<Node> |
getHeads()
|
Integer |
getIndex()
|
ArcLabels |
getLabelCode()
|
Integer |
getLabelCode(int headindex,
SymbolTable table)
|
Integer |
getLabelCode(Node head,
SymbolTable table)
|
Integer |
getLabelCode(SymbolTable table)
|
Node |
getLeftDependent(int index)
Returns the left dependent at the position index , where index==0 equals the left most dependent. |
int |
getLeftDependentCount()
Return the number of left dependents |
SortedSet<Node> |
getLeftDependents()
Returns a sorted set of left dependents |
Node |
getLeftmostDependent()
Returns the left most dependent. |
Node |
getLeftmostDescendant()
|
Node |
getLeftSibling()
Returns the left sibling if it exists, otherwise null |
Node |
getNode(String operation,
int index)
|
Node |
getPredecessor()
Returns the predecessor node in the input queue |
int |
getRank()
|
Node |
getRightDependent(int index)
Returns the right dependent at the position index , where index==0 equals the right most dependent. |
int |
getRightDependentCount()
Return the number of right dependents |
SortedSet<Node> |
getRightDependents()
Returns a sorted set of right dependent nodes |
Node |
getRightmostDependent()
Returns the right most dependent. |
Node |
getRightmostDescendant()
|
Node |
getRightSibling()
Returns the right sibling if it exists, otherwise null |
Node |
getSameSideLeftSibling()
Returns the left sibling at the same side of head as the node it self. |
Node |
getSameSideRightSibling()
Returns the right sibling at the same side of head as the node it self. |
Node |
getSuccessor()
Returns the successor node in the input queue |
Token |
getToken()
|
boolean |
hasAncestorInside(int left,
int right)
|
boolean |
hasHead()
|
boolean |
hasLabelCodes()
|
boolean |
hasLeftDependent()
Returns true if the node has one or more left dependents, otherwise false . |
boolean |
hasRightDependent()
Returns true if the node has one or more right dependents, otherwise false . |
protected void |
initArcs()
|
boolean |
isOperation(String operation)
|
boolean |
isRoot()
|
boolean |
isSingleHeaded()
|
boolean |
isSingleHeadedConstraint()
|
protected void |
removeDependent(Node dependent)
|
void |
setComponent(Node x)
|
protected void |
setIndex(Integer index)
|
void |
setPredecessor(Node predecessor)
|
void |
setRank(int r)
|
protected void |
setRoot(boolean root)
|
protected void |
setSingleHeadedConstraint(boolean singleHeadedConstraint)
|
void |
setSuccessor(Node successor)
|
protected void |
setToken(Token token)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Integer index
protected Node predecessor
protected Node successor
protected SortedSet<Node> leftDependents
protected SortedSet<Node> rightDependents
protected HeadArcs arcs
singleHeadedConstraint==true
, it
contains only one arc per node)
protected Token token
protected Node component
protected int rank
protected boolean root
true
if the node is a root, otherwise false
protected boolean singleHeadedConstraint
Constructor Detail |
---|
public Node(int index, boolean isRoot, boolean isSingleHeaded)
public Node(int index, boolean isRoot, boolean isSingleHeaded, Token token)
Method Detail |
---|
public void addHead(Node head) throws MaltChainedException
MaltChainedException
public void addHead(Node head, ArcLabels arcLabelCodes) throws MaltChainedException
MaltChainedException
public int getRank()
public void setRank(int r)
public Node findComponent()
public Node getComponent()
public void setComponent(Node x)
public boolean isSingleHeaded()
public Node getHead(int index)
public Integer getLabelCode(Node head, SymbolTable table)
public Integer getLabelCode(SymbolTable table)
public ArcLabels getLabelCode()
public boolean hasLabelCodes()
public Node getHead()
public SortedSet<Node> getHeads()
public Integer getLabelCode(int headindex, SymbolTable table)
public ArcLabels getArcLabels(int headindex)
public Integer getHeadLabelCode(SymbolTable table)
protected void addDependent(Node dependent) throws MaltChainedException
MaltChainedException
protected void removeDependent(Node dependent)
public void clear()
public boolean hasAncestorInside(int left, int right)
public boolean isRoot()
public boolean isSingleHeadedConstraint()
public Integer getIndex()
public Token getToken()
public boolean hasHead()
public Node getPredecessor()
public Node getSuccessor()
public Node getLeftSibling()
null
null
public Node getSameSideLeftSibling()
null
null
public Node getRightSibling()
null
null
public Node getSameSideRightSibling()
null
null
public boolean hasLeftDependent()
true
if the node has one or more left dependents, otherwise false
.
true
if the node has one or more left dependents, otherwise false
.public Node getLeftmostDependent()
null
is returned.
null
is returned.public Node getClosestLeftDependent()
null
is returned.
null
is returned.public SortedSet<Node> getLeftDependents()
public Node getLeftDependent(int index)
index
, where index==0
equals the left most dependent.
index
- the index
index
, where index==0
equals the left most dependentpublic int getLeftDependentCount()
public boolean hasRightDependent()
true
if the node has one or more right dependents, otherwise false
.
true
if the node has one or more right dependents, otherwise false
.public Node getRightmostDependent()
null
is returned.
null
is returned.public Node getClosestRightDependent()
null
is returned.
null
is returned.public SortedSet<Node> getRightDependents()
public Node getRightDependent(int index)
index
, where index==0
equals the right most dependent.
index
- the index
index
, where index==0
equals the right most dependentpublic int getRightDependentCount()
public Node getLeftmostDescendant()
public Node getRightmostDescendant()
public boolean isOperation(String operation)
isOperation
in interface Featurable
public Node getNode(String operation, int index)
getNode
in interface Featurable
protected void setIndex(Integer index)
public void setPredecessor(Node predecessor)
public void setSuccessor(Node successor)
protected void setRoot(boolean root)
protected void setSingleHeadedConstraint(boolean singleHeadedConstraint)
protected void setToken(Token token)
protected void initArcs()
public int compareTo(Node o)
compareTo
in interface Comparable<Node>
|
MaltParser 1.0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |