public class Root extends GraphNode implements DependencyNode, PhraseStructureNode, NonTerminalNode
| Modifier and Type | Field and Description |
|---|---|
protected java.util.SortedSet<PhraseStructureNode> |
children |
protected DependencyNode |
component
a reference to a node where the node is part of a component.
|
protected java.util.SortedSet<DependencyNode> |
leftDependents |
protected int |
rank |
protected java.util.SortedSet<DependencyNode> |
rightDependents |
incomingEdges, outgoingEdges| Constructor and Description |
|---|
Root() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeadEdgeLabel(LabelSet labelSet) |
void |
addHeadEdgeLabel(SymbolTable table,
int code) |
void |
addHeadEdgeLabel(SymbolTable table,
java.lang.String symbol) |
void |
addIncomingEdge(Edge in) |
void |
addOutgoingEdge(Edge out) |
void |
clear()
Resets the graph element.
|
int |
compareTo(ComparableNode o) |
boolean |
equals(java.lang.Object obj) |
DependencyNode |
findComponent() |
DependencyNode |
getAncestor() |
PhraseStructureNode |
getChild(int index) |
java.util.SortedSet<PhraseStructureNode> |
getChildren() |
DependencyNode |
getClosestLeftDependent()
Returns the closest left dependent to the node it self, if not found
null is returned. |
DependencyNode |
getClosestRightDependent()
Returns the closest right dependent to the node it self, if not found
null is returned. |
int |
getCompareToIndex()
Returns the index of the node (only used internal by compareTo).
|
DependencyNode |
getComponent() |
protected void |
getDependencyDominationSet(java.util.SortedSet<DependencyNode> dominationSet) |
int |
getDependencyNodeDepth()
Returns the depth of the node.
|
DependencyNode |
getHead()
Returns the head dependency node if it exists, otherwise null.
|
PhraseStructureNode |
getHeadChild() |
PhraseStructureNode |
getHeadChild(HeadRules headRules) |
Edge |
getHeadEdge()
Returns the edge between the head and the node if it exists, otherwise null.
|
int |
getHeadEdgeLabelCode(SymbolTable table) |
LabelSet |
getHeadEdgeLabelSet() |
java.lang.String |
getHeadEdgeLabelSymbol(SymbolTable table) |
java.util.Set<SymbolTable> |
getHeadEdgeLabelTypes() |
java.util.Set<Edge> |
getHeadEdges() |
java.util.Set<DependencyNode> |
getHeads() |
int |
getHeight() |
int |
getIndex()
Returns the index of the node.
|
PhraseStructureNode |
getLeftChild() |
DependencyNode |
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
|
java.util.SortedSet<DependencyNode> |
getLeftDependents()
Returns a sorted set of left dependents.
|
DependencyNode |
getLeftmostDependent() |
ComparableNode |
getLeftmostDescendant()
Returns the left-most terminal descendant node.
|
ComparableNode |
getLeftmostProperDescendant()
Returns the left-most proper terminal descendant node (excluding itself).
|
DependencyNode |
getLeftSibling()
Returns the left sibling if it exists, otherwise
null |
TokenNode |
getLexicalHead() |
TokenNode |
getLexicalHead(HeadRules headRules) |
java.util.List<DependencyNode> |
getListOfDependents() |
java.util.List<DependencyNode> |
getListOfLeftDependents() |
java.util.List<DependencyNode> |
getListOfRightDependents() |
PhraseStructureNode |
getParent() |
Edge |
getParentEdge() |
int |
getParentEdgeLabelCode(SymbolTable table) |
java.lang.String |
getParentEdgeLabelSymbol(SymbolTable table) |
DependencyNode |
getPredecessor()
Returns the predecessor dependency node in the linear order of the token nodes.
|
DependencyNode |
getProperAncestor() |
int |
getRank() |
PhraseStructureNode |
getRightChild() |
DependencyNode |
getRightDependent(int index) |
int |
getRightDependentCount()
Return the number of right dependents
|
java.util.SortedSet<DependencyNode> |
getRightDependents()
Returns a sorted set of right dependents.
|
DependencyNode |
getRightmostDependent() |
ComparableNode |
getRightmostDescendant()
Returns the right-most terminal descendant node.
|
ComparableNode |
getRightmostProperDescendant()
Returns the right-most proper terminal descendant node (excluding itself).
|
DependencyNode |
getRightSibling()
Returns the right sibling if it exists, otherwise
null |
DependencyNode |
getSameSideLeftSibling()
Returns the left sibling at the same side of head as the node it self.
|
DependencyNode |
getSameSideRightSibling()
Returns the right sibling at the same side of head as the node it self.
|
DependencyNode |
getSuccessor()
Returns the successor dependency node in the linear order of the token nodes.
|
boolean |
hasAncestorInside(int left,
int right) |
boolean |
hasAtMostOneHead()
Returns true if the node has at most one head, otherwise false.
|
boolean |
hasDependent() |
int |
hashCode() |
boolean |
hasHead()
Returns true if the node has one or more head(s), otherwise false.
|
boolean |
hasHeadEdgeLabel(SymbolTable table) |
boolean |
hasLeftDependent()
Returns
true if the node has one or more left dependents, otherwise false. |
boolean |
hasNonTerminalChildren() |
boolean |
hasParentEdgeLabel(SymbolTable table) |
boolean |
hasRightDependent()
Returns
true if the node has one or more right dependents, otherwise false. |
boolean |
hasTerminalChildren() |
TokenNode |
identifyHead(HeadRules headRules) |
boolean |
isContinuous() |
boolean |
isContinuousExcludeTerminalsAttachToRoot() |
boolean |
isHeadEdgeLabeled() |
boolean |
isProjective()
Returns true if the head edge is projective, otherwise false.
|
boolean |
isRoot()
Returns true if the node is a root node, otherwise false.
|
int |
nChildren() |
int |
nHeadEdgeLabels() |
void |
removeIncomingEdge(Edge in) |
void |
removeOutgoingEdge(Edge out) |
void |
setComponent(DependencyNode x) |
void |
setIndex(int index) |
void |
setRank(int r) |
java.lang.String |
toString() |
getIncomingEdgeIterator, getIncomingSecondaryEdges, getInDegree, getLeftmostDescendantIndex, getLeftmostProperDescendantIndex, getOutDegree, getOutgoingEdgeIterator, getOutgoingSecondaryEdges, getRightmostDescendantIndex, getRightmostProperDescendantIndexaddLabel, addLabel, addLabel, compareTo, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraphaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetIncomingSecondaryEdges, getInDegree, getLeftmostDescendantIndex, getLeftmostProperDescendantIndex, getOutDegree, getOutgoingSecondaryEdges, getRightmostDescendantIndex, getRightmostProperDescendantIndexaddLabel, addLabel, addLabel, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraphprotected final java.util.SortedSet<DependencyNode> leftDependents
protected final java.util.SortedSet<DependencyNode> rightDependents
protected final java.util.SortedSet<PhraseStructureNode> children
protected DependencyNode component
protected int rank
public Root() throws MaltChainedException
MaltChainedExceptionpublic void addIncomingEdge(Edge in) throws MaltChainedException
addIncomingEdge in interface NodeaddIncomingEdge in class GraphNodeMaltChainedExceptionpublic void removeIncomingEdge(Edge in)
removeIncomingEdge in interface NoderemoveIncomingEdge in class GraphNodepublic void addOutgoingEdge(Edge out) throws MaltChainedException
addOutgoingEdge in interface NodeaddOutgoingEdge in class GraphNodeMaltChainedExceptionpublic void removeOutgoingEdge(Edge out) throws MaltChainedException
removeOutgoingEdge in interface NoderemoveOutgoingEdge in class GraphNodeMaltChainedExceptionpublic DependencyNode getPredecessor()
DependencyNodegetPredecessor in interface DependencyNodepublic DependencyNode getSuccessor()
DependencyNodegetSuccessor in interface DependencyNodepublic DependencyNode getAncestor() throws MaltChainedException
getAncestor in interface DependencyNodeMaltChainedExceptionpublic DependencyNode getProperAncestor() throws MaltChainedException
getProperAncestor in interface DependencyNodeMaltChainedExceptionpublic int getRank()
getRank in interface DependencyNodepublic void setRank(int r)
setRank in interface DependencyNodepublic DependencyNode findComponent()
findComponent in interface DependencyNodepublic DependencyNode getComponent()
getComponent in interface DependencyNodepublic void setComponent(DependencyNode x)
setComponent in interface DependencyNodepublic boolean isContinuous()
isContinuous in interface NonTerminalNodepublic boolean isContinuousExcludeTerminalsAttachToRoot()
isContinuousExcludeTerminalsAttachToRoot in interface NonTerminalNodepublic PhraseStructureNode getParent()
getParent in interface PhraseStructureNodepublic Edge getParentEdge() throws MaltChainedException
getParentEdge in interface PhraseStructureNodeMaltChainedExceptionpublic java.lang.String getParentEdgeLabelSymbol(SymbolTable table) throws MaltChainedException
getParentEdgeLabelSymbol in interface PhraseStructureNodeMaltChainedExceptionpublic int getParentEdgeLabelCode(SymbolTable table) throws MaltChainedException
getParentEdgeLabelCode in interface PhraseStructureNodeMaltChainedExceptionpublic boolean hasParentEdgeLabel(SymbolTable table) throws MaltChainedException
hasParentEdgeLabel in interface PhraseStructureNodeMaltChainedExceptionpublic java.util.SortedSet<PhraseStructureNode> getChildren()
getChildren in interface NonTerminalNodepublic PhraseStructureNode getChild(int index)
getChild in interface NonTerminalNodepublic PhraseStructureNode getLeftChild()
getLeftChild in interface NonTerminalNodepublic PhraseStructureNode getRightChild()
getRightChild in interface NonTerminalNodepublic int nChildren()
nChildren in interface NonTerminalNodepublic boolean hasNonTerminalChildren()
hasNonTerminalChildren in interface NonTerminalNodepublic boolean hasTerminalChildren()
hasTerminalChildren in interface NonTerminalNodepublic int getHeight()
getHeight in interface NonTerminalNodepublic TokenNode getLexicalHead(HeadRules headRules) throws MaltChainedException
getLexicalHead in interface NonTerminalNodeMaltChainedExceptionpublic PhraseStructureNode getHeadChild(HeadRules headRules) throws MaltChainedException
getHeadChild in interface NonTerminalNodeMaltChainedExceptionpublic TokenNode getLexicalHead() throws MaltChainedException
getLexicalHead in interface NonTerminalNodeMaltChainedExceptionpublic PhraseStructureNode getHeadChild() throws MaltChainedException
getHeadChild in interface NonTerminalNodeMaltChainedExceptionpublic TokenNode identifyHead(HeadRules headRules) throws MaltChainedException
identifyHead in interface NonTerminalNodeMaltChainedExceptionpublic boolean hasAtMostOneHead()
DependencyNodehasAtMostOneHead in interface DependencyNodepublic boolean hasAncestorInside(int left, int right) throws MaltChainedException
hasAncestorInside in interface DependencyNodeMaltChainedExceptionpublic boolean hasHead()
DependencyNodehasHead in interface DependencyNodepublic DependencyNode getHead() throws MaltChainedException
DependencyNodegetHead in interface DependencyNodeMaltChainedExceptionpublic Edge getHeadEdge() throws MaltChainedException
DependencyNodegetHeadEdge in interface DependencyNodeMaltChainedExceptionpublic void addHeadEdgeLabel(SymbolTable table, java.lang.String symbol) throws MaltChainedException
addHeadEdgeLabel in interface DependencyNodeMaltChainedExceptionpublic void addHeadEdgeLabel(SymbolTable table, int code) throws MaltChainedException
addHeadEdgeLabel in interface DependencyNodeMaltChainedExceptionpublic void addHeadEdgeLabel(LabelSet labelSet) throws MaltChainedException
addHeadEdgeLabel in interface DependencyNodeMaltChainedExceptionpublic int getHeadEdgeLabelCode(SymbolTable table) throws MaltChainedException
getHeadEdgeLabelCode in interface DependencyNodeMaltChainedExceptionpublic LabelSet getHeadEdgeLabelSet() throws MaltChainedException
getHeadEdgeLabelSet in interface DependencyNodeMaltChainedExceptionpublic java.lang.String getHeadEdgeLabelSymbol(SymbolTable table) throws MaltChainedException
getHeadEdgeLabelSymbol in interface DependencyNodeMaltChainedExceptionpublic java.util.Set<SymbolTable> getHeadEdgeLabelTypes() throws MaltChainedException
getHeadEdgeLabelTypes in interface DependencyNodeMaltChainedExceptionpublic boolean hasHeadEdgeLabel(SymbolTable table) throws MaltChainedException
hasHeadEdgeLabel in interface DependencyNodeMaltChainedExceptionpublic boolean isHeadEdgeLabeled() throws MaltChainedException
isHeadEdgeLabeled in interface DependencyNodeMaltChainedExceptionpublic int nHeadEdgeLabels() throws MaltChainedException
nHeadEdgeLabels in interface DependencyNodeMaltChainedExceptionpublic java.util.Set<Edge> getHeadEdges() throws MaltChainedException
getHeadEdges in interface DependencyNodeMaltChainedExceptionpublic java.util.Set<DependencyNode> getHeads() throws MaltChainedException
getHeads in interface DependencyNodeMaltChainedExceptionpublic boolean hasDependent()
hasDependent in interface DependencyNodepublic boolean hasLeftDependent()
true if the node has one or more left dependents, otherwise false.hasLeftDependent in interface DependencyNodetrue if the node has one or more left dependents, otherwise false.public DependencyNode getLeftDependent(int index)
index, where index==0 equals the left most dependent.getLeftDependent in interface DependencyNodeindex - the indexindex, where index==0 equals the left most dependentpublic int getLeftDependentCount()
getLeftDependentCount in interface DependencyNodepublic java.util.SortedSet<DependencyNode> getLeftDependents()
DependencyNodegetLeftDependents in interface DependencyNodepublic DependencyNode getLeftSibling() throws MaltChainedException
nullgetLeftSibling in interface DependencyNodenullMaltChainedExceptionpublic DependencyNode getSameSideLeftSibling() throws MaltChainedException
null is returnedgetSameSideLeftSibling in interface DependencyNodenull is returnedMaltChainedExceptionpublic DependencyNode getClosestLeftDependent()
null is returned.getClosestLeftDependent in interface DependencyNodenull is returned.public DependencyNode getLeftmostDependent()
getLeftmostDependent in interface DependencyNodepublic DependencyNode getRightDependent(int index)
getRightDependent in interface DependencyNodepublic int getRightDependentCount()
getRightDependentCount in interface DependencyNodepublic java.util.SortedSet<DependencyNode> getRightDependents()
DependencyNodegetRightDependents in interface DependencyNodepublic DependencyNode getRightSibling() throws MaltChainedException
nullgetRightSibling in interface DependencyNodenullMaltChainedExceptionpublic DependencyNode getSameSideRightSibling() throws MaltChainedException
null is returnedgetSameSideRightSibling in interface DependencyNodenull is returnedMaltChainedExceptionpublic DependencyNode getClosestRightDependent()
null is returned.getClosestRightDependent in interface DependencyNodenull is returned.public DependencyNode getRightmostDependent()
getRightmostDependent in interface DependencyNodepublic boolean hasRightDependent()
true if the node has one or more right dependents, otherwise false.hasRightDependent in interface DependencyNodetrue if the node has one or more right dependents, otherwise false.protected void getDependencyDominationSet(java.util.SortedSet<DependencyNode> dominationSet)
public boolean isProjective() throws MaltChainedException
DependencyNodeisProjective in interface DependencyNodeMaltChainedExceptionpublic int getDependencyNodeDepth() throws MaltChainedException
DependencyNodegetDependencyNodeDepth in interface DependencyNodeMaltChainedExceptionpublic int getIndex()
ComparableNodegetIndex in interface ComparableNodegetIndex in class GraphNodepublic int getCompareToIndex()
ComparableNodegetCompareToIndex in interface ComparableNodepublic boolean isRoot()
ComparableNodeisRoot in interface ComparableNodeisRoot in class GraphNodepublic ComparableNode getLeftmostProperDescendant() throws MaltChainedException
ComparableNodegetLeftmostProperDescendant in interface ComparableNodeMaltChainedExceptionpublic ComparableNode getRightmostProperDescendant() throws MaltChainedException
ComparableNodegetRightmostProperDescendant in interface ComparableNodeMaltChainedExceptionpublic ComparableNode getLeftmostDescendant() throws MaltChainedException
ComparableNodegetLeftmostDescendant in interface ComparableNodeMaltChainedExceptionpublic ComparableNode getRightmostDescendant() throws MaltChainedException
ComparableNodegetRightmostDescendant in interface ComparableNodeMaltChainedExceptionpublic java.util.List<DependencyNode> getListOfDependents()
getListOfDependents in interface DependencyNodepublic java.util.List<DependencyNode> getListOfLeftDependents()
getListOfLeftDependents in interface DependencyNodepublic java.util.List<DependencyNode> getListOfRightDependents()
getListOfRightDependents in interface DependencyNodepublic void setIndex(int index) throws MaltChainedException
setIndex in interface NodesetIndex in class GraphNodeMaltChainedExceptionpublic void clear() throws MaltChainedException
GraphElementclear in interface Elementclear in class GraphNodeMaltChainedExceptionpublic int compareTo(ComparableNode o)
compareTo in interface java.lang.Comparable<ComparableNode>compareTo in class GraphNodeCopyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.