public final class LWNode extends java.lang.Object implements DependencyNode, Node
| Modifier | Constructor and Description |
|---|---|
protected |
LWNode(LWDependencyGraph _graph,
int _index) |
protected |
LWNode(LWDependencyGraph _graph,
LWNode node) |
protected |
LWNode(LWNode node) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumnLabels(java.lang.String[] columnLabels) |
void |
addColumnLabels(java.lang.String[] columnLabels,
boolean addEdges) |
void |
addHeadEdgeLabel(LabelSet labelSet) |
void |
addHeadEdgeLabel(SymbolTable table,
int code) |
void |
addHeadEdgeLabel(SymbolTable table,
java.lang.String symbol) |
void |
addIncomingEdge(Edge in) |
void |
addLabel(LabelSet labels)
Adds the labels of the label set to the label set of the graph element.
|
void |
addLabel(SymbolTable table,
int code)
Adds a label (an integer value) to the symbol table and to the graph element.
|
void |
addLabel(SymbolTable table,
java.lang.String symbol)
Adds a label (a string value) to the symbol table and to the graph element.
|
void |
addOutgoingEdge(Edge out) |
void |
clear()
Resets the graph element.
|
int |
compareTo(ComparableNode that) |
boolean |
equals(java.lang.Object obj) |
DependencyNode |
findComponent() |
DependencyNode |
getAncestor() |
LabeledStructure |
getBelongsToGraph()
Returns the graph (structure) in which the graph element belongs to.
|
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() |
int |
getDependencyNodeDepth()
Returns the depth of the node.
|
java.util.SortedSet<DependencyNode> |
getDependents() |
protected DependencyStructure |
getGraph() |
DependencyNode |
getHead()
Returns the head dependency node if it exists, otherwise null.
|
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() |
int |
getHeadIndex() |
java.util.SortedSet<DependencyNode> |
getHeads() |
java.util.Iterator<Edge> |
getIncomingEdgeIterator() |
java.util.SortedSet<Edge> |
getIncomingSecondaryEdges()
Returns a sorted set of incoming secondary edges.
|
int |
getInDegree()
Returns the in degree of the node (number of incoming edges of all types of edges).
|
int |
getIndex()
Returns the index of the node.
|
java.lang.String |
getLabel(org.maltparser.concurrent.graph.dataformat.ColumnDescription column) |
java.lang.String |
getLabel(int columnPosition) |
java.lang.String |
getLabel(java.lang.String columnName) |
int |
getLabelCode(SymbolTable table)
Returns the label code (an integer representation) of the symbol table if it exists, otherwise
an exception is thrown.
|
java.util.SortedMap<org.maltparser.concurrent.graph.dataformat.ColumnDescription,java.lang.String> |
getLabels() |
LabelSet |
getLabelSet()
Returns the label set.
|
java.lang.String |
getLabelSymbol(SymbolTable table)
Returns the label symbol(a string representation) of the symbol table if it exists, otherwise
an exception is thrown.
|
java.util.Set<SymbolTable> |
getLabelTypes()
Returns a set of symbol tables (labeling functions or label types) that labels the graph element.
|
DependencyNode |
getLeftDependent(int leftDependentIndex)
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.
|
int |
getLeftmostDescendantIndex()
Returns the index of the left-most terminal descendant node.
|
ComparableNode |
getLeftmostProperDescendant()
Returns the left-most proper terminal descendant node (excluding itself).
|
int |
getLeftmostProperDescendantIndex()
Returns the index of the left-most proper terminal descendant node (excluding itself).
|
DependencyNode |
getLeftSibling()
Returns the left sibling if it exists, otherwise
null |
java.util.List<DependencyNode> |
getListOfDependents() |
java.util.List<DependencyNode> |
getListOfLeftDependents() |
java.util.List<DependencyNode> |
getListOfRightDependents() |
int |
getOutDegree()
Returns the out degree of the node (number of outgoing edges of all types of edges).
|
java.util.Iterator<Edge> |
getOutgoingEdgeIterator() |
java.util.SortedSet<Edge> |
getOutgoingSecondaryEdges()
Returns a sorted set of outgoing secondary edges.
|
DependencyNode |
getPredecessor()
Returns the predecessor dependency node in the linear order of the token nodes.
|
DependencyNode |
getProperAncestor() |
int |
getRank() |
DependencyNode |
getRightDependent(int rightDependentIndex) |
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.
|
int |
getRightmostDescendantIndex()
Returns the index of the right-most terminal descendant node.
|
ComparableNode |
getRightmostProperDescendant()
Returns the right-most proper terminal descendant node (excluding itself).
|
int |
getRightmostProperDescendantIndex()
Returns the index of 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 |
hasLabel(org.maltparser.concurrent.graph.dataformat.ColumnDescription column) |
boolean |
hasLabel(int columnPosition) |
boolean |
hasLabel(java.lang.String columnName) |
boolean |
hasLabel(SymbolTable table)
Returns true if the graph element has a label for the symbol table, otherwise false.
|
boolean |
hasLeftDependent()
Returns true if the node has one or more left dependents, otherwise false.
|
boolean |
hasRightDependent() |
boolean |
isHeadEdgeLabeled() |
boolean |
isHeadLabeled() |
boolean |
isLabeled()
Returns true if the graph element has one or more labels, otherwise false.
|
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 |
nHeadEdgeLabels() |
int |
nLabels()
Returns the number of labels of the graph element.
|
void |
removeIncomingEdge(Edge in) |
void |
removeLabel(SymbolTable table) |
void |
removeLabels() |
void |
removeOutgoingEdge(Edge out) |
void |
setBelongsToGraph(LabeledStructure belongsToGraph)
Sets the graph (structure) in which the graph element belongs to.
|
void |
setComponent(DependencyNode x) |
void |
setIndex(int index) |
void |
setRank(int r) |
java.lang.String |
toString() |
protected LWNode(LWNode node) throws LWGraphException
LWGraphExceptionprotected LWNode(LWDependencyGraph _graph, LWNode node) throws LWGraphException
LWGraphExceptionprotected LWNode(LWDependencyGraph _graph, int _index) throws LWGraphException
LWGraphExceptionprotected DependencyStructure getGraph()
public int getIndex()
ComparableNodegetIndex in interface ComparableNodepublic void setIndex(int index) throws MaltChainedException
setIndex in interface NodeMaltChainedExceptionpublic java.lang.String getLabel(int columnPosition)
public java.lang.String getLabel(java.lang.String columnName)
public java.lang.String getLabel(org.maltparser.concurrent.graph.dataformat.ColumnDescription column)
public boolean hasLabel(int columnPosition)
public boolean hasLabel(java.lang.String columnName)
public boolean hasLabel(org.maltparser.concurrent.graph.dataformat.ColumnDescription column)
public boolean isLabeled()
Elementpublic boolean isHeadLabeled()
public int getHeadIndex()
public java.util.SortedMap<org.maltparser.concurrent.graph.dataformat.ColumnDescription,java.lang.String> getLabels()
public DependencyNode getPredecessor()
DependencyNodegetPredecessor in interface DependencyNodepublic DependencyNode getSuccessor()
DependencyNodegetSuccessor in interface DependencyNodepublic boolean isRoot()
ComparableNodeisRoot in interface ComparableNodepublic boolean hasAtMostOneHead()
DependencyNodehasAtMostOneHead in interface DependencyNodepublic boolean hasHead()
DependencyNodehasHead in interface DependencyNodepublic boolean hasDependent()
hasDependent in interface DependencyNodepublic boolean hasLeftDependent()
DependencyNodehasLeftDependent in interface DependencyNodepublic boolean hasRightDependent()
hasRightDependent in interface DependencyNodepublic java.util.SortedSet<DependencyNode> getHeads()
getHeads in interface DependencyNodepublic DependencyNode getHead()
DependencyNodegetHead in interface DependencyNodepublic DependencyNode getLeftDependent(int leftDependentIndex)
DependencyNodegetLeftDependent in interface DependencyNodeleftDependentIndex - the indexpublic int getLeftDependentCount()
DependencyNodegetLeftDependentCount in interface DependencyNodepublic java.util.SortedSet<DependencyNode> getLeftDependents()
DependencyNodegetLeftDependents in interface DependencyNodepublic java.util.List<DependencyNode> getListOfLeftDependents()
getListOfLeftDependents in interface DependencyNodepublic DependencyNode getLeftSibling()
DependencyNodenullgetLeftSibling in interface DependencyNodenullpublic DependencyNode getSameSideLeftSibling()
DependencyNodenull is returnedgetSameSideLeftSibling in interface DependencyNodenull is returnedpublic DependencyNode getClosestLeftDependent()
DependencyNodenull is returned.getClosestLeftDependent in interface DependencyNodenull is returned.public DependencyNode getLeftmostDependent()
getLeftmostDependent in interface DependencyNodepublic DependencyNode getRightDependent(int rightDependentIndex)
getRightDependent in interface DependencyNodepublic int getRightDependentCount()
DependencyNodegetRightDependentCount in interface DependencyNodepublic java.util.SortedSet<DependencyNode> getRightDependents()
DependencyNodegetRightDependents in interface DependencyNodepublic java.util.List<DependencyNode> getListOfRightDependents()
getListOfRightDependents in interface DependencyNodepublic DependencyNode getRightSibling()
DependencyNodenullgetRightSibling in interface DependencyNodenullpublic DependencyNode getSameSideRightSibling()
DependencyNodenull is returnedgetSameSideRightSibling in interface DependencyNodenull is returnedpublic DependencyNode getClosestRightDependent()
DependencyNodenull is returned.getClosestRightDependent in interface DependencyNodenull is returned.public DependencyNode getRightmostDependent()
getRightmostDependent in interface DependencyNodepublic java.util.SortedSet<DependencyNode> getDependents()
public java.util.List<DependencyNode> getListOfDependents()
getListOfDependents in interface DependencyNodepublic int getInDegree()
ComparableNodegetInDegree in interface ComparableNodepublic int getOutDegree()
ComparableNodegetOutDegree in interface ComparableNodepublic DependencyNode getAncestor() throws MaltChainedException
getAncestor in interface DependencyNodeMaltChainedExceptionpublic DependencyNode getProperAncestor() throws MaltChainedException
getProperAncestor in interface DependencyNodeMaltChainedExceptionpublic boolean hasAncestorInside(int left, int right) throws MaltChainedException
hasAncestorInside in interface DependencyNodeMaltChainedExceptionpublic boolean isProjective() throws MaltChainedException
DependencyNodeisProjective in interface DependencyNodeMaltChainedExceptionpublic int getDependencyNodeDepth() throws MaltChainedException
DependencyNodegetDependencyNodeDepth in interface DependencyNodeMaltChainedExceptionpublic int getCompareToIndex()
ComparableNodegetCompareToIndex in interface ComparableNodepublic ComparableNode getLeftmostProperDescendant() throws MaltChainedException
ComparableNodegetLeftmostProperDescendant in interface ComparableNodeMaltChainedExceptionpublic ComparableNode getRightmostProperDescendant() throws MaltChainedException
ComparableNodegetRightmostProperDescendant in interface ComparableNodeMaltChainedExceptionpublic int getLeftmostProperDescendantIndex() throws MaltChainedException
ComparableNodegetLeftmostProperDescendantIndex in interface ComparableNodeMaltChainedExceptionpublic int getRightmostProperDescendantIndex() throws MaltChainedException
ComparableNodegetRightmostProperDescendantIndex in interface ComparableNodeMaltChainedExceptionpublic ComparableNode getLeftmostDescendant() throws MaltChainedException
ComparableNodegetLeftmostDescendant in interface ComparableNodeMaltChainedExceptionpublic ComparableNode getRightmostDescendant() throws MaltChainedException
ComparableNodegetRightmostDescendant in interface ComparableNodeMaltChainedExceptionpublic int getLeftmostDescendantIndex() throws MaltChainedException
ComparableNodegetLeftmostDescendantIndex in interface ComparableNodeMaltChainedExceptionpublic int getRightmostDescendantIndex() throws MaltChainedException
ComparableNodegetRightmostDescendantIndex in interface ComparableNodeMaltChainedExceptionpublic java.util.SortedSet<Edge> getIncomingSecondaryEdges() throws MaltChainedException
ComparableNodegetIncomingSecondaryEdges in interface ComparableNodeMaltChainedExceptionpublic java.util.SortedSet<Edge> getOutgoingSecondaryEdges() throws MaltChainedException
ComparableNodegetOutgoingSecondaryEdges in interface ComparableNodeMaltChainedExceptionpublic java.util.Set<Edge> getHeadEdges()
getHeadEdges in interface DependencyNodepublic Edge getHeadEdge()
DependencyNodegetHeadEdge in interface DependencyNodepublic 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 boolean hasHeadEdgeLabel(SymbolTable table) throws MaltChainedException
hasHeadEdgeLabel in interface DependencyNodeMaltChainedExceptionpublic java.lang.String getHeadEdgeLabelSymbol(SymbolTable table) throws MaltChainedException
getHeadEdgeLabelSymbol in interface DependencyNodeMaltChainedExceptionpublic int getHeadEdgeLabelCode(SymbolTable table) throws MaltChainedException
getHeadEdgeLabelCode in interface DependencyNodeMaltChainedExceptionpublic java.util.Set<SymbolTable> getHeadEdgeLabelTypes() throws MaltChainedException
getHeadEdgeLabelTypes in interface DependencyNodeMaltChainedExceptionpublic LabelSet getHeadEdgeLabelSet() throws MaltChainedException
getHeadEdgeLabelSet in interface DependencyNodeMaltChainedExceptionpublic void addIncomingEdge(Edge in) throws MaltChainedException
addIncomingEdge in interface NodeMaltChainedExceptionpublic void addOutgoingEdge(Edge out) throws MaltChainedException
addOutgoingEdge in interface NodeMaltChainedExceptionpublic void removeIncomingEdge(Edge in) throws MaltChainedException
removeIncomingEdge in interface NodeMaltChainedExceptionpublic void removeOutgoingEdge(Edge out) throws MaltChainedException
removeOutgoingEdge in interface NodeMaltChainedExceptionpublic java.util.Iterator<Edge> getIncomingEdgeIterator()
getIncomingEdgeIterator in interface Nodepublic java.util.Iterator<Edge> getOutgoingEdgeIterator()
getOutgoingEdgeIterator in interface Nodepublic void setRank(int r)
setRank in interface DependencyNodepublic DependencyNode getComponent()
getComponent in interface DependencyNodepublic void setComponent(DependencyNode x)
setComponent in interface DependencyNodepublic DependencyNode findComponent()
findComponent in interface DependencyNodepublic int getRank()
getRank in interface DependencyNodepublic boolean isHeadEdgeLabeled()
isHeadEdgeLabeled in interface DependencyNodepublic int nHeadEdgeLabels()
nHeadEdgeLabels in interface DependencyNodepublic void addColumnLabels(java.lang.String[] columnLabels) throws MaltChainedException
MaltChainedExceptionpublic void addColumnLabels(java.lang.String[] columnLabels, boolean addEdges) throws MaltChainedException
MaltChainedExceptionpublic void addLabel(SymbolTable table, java.lang.String symbol) throws MaltChainedException
addLabel in interface Elementtable - the symbol tablesymbol - a label symbolMaltChainedExceptionpublic void addLabel(SymbolTable table, int code) throws MaltChainedException
addLabel in interface Elementtable - the symbol tablecode - a label codeMaltChainedExceptionpublic void addLabel(LabelSet labels) throws MaltChainedException
addLabel in interface Elementlabels - a label set.MaltChainedExceptionpublic boolean hasLabel(SymbolTable table) throws MaltChainedException
hasLabel in interface Elementtable - the symbol tableMaltChainedExceptionpublic java.lang.String getLabelSymbol(SymbolTable table) throws MaltChainedException
getLabelSymbol in interface Elementtable - the symbol tableMaltChainedExceptionpublic int getLabelCode(SymbolTable table) throws MaltChainedException
getLabelCode in interface Elementtable - the symbol tableMaltChainedExceptionpublic int nLabels()
public java.util.Set<SymbolTable> getLabelTypes()
getLabelTypes in interface Elementpublic LabelSet getLabelSet()
getLabelSet in interface Elementpublic void removeLabel(SymbolTable table) throws MaltChainedException
removeLabel in interface ElementMaltChainedExceptionpublic void removeLabels() throws MaltChainedException
removeLabels in interface ElementMaltChainedExceptionpublic LabeledStructure getBelongsToGraph()
getBelongsToGraph in interface Elementpublic void setBelongsToGraph(LabeledStructure belongsToGraph)
ElementsetBelongsToGraph in interface ElementbelongsToGraph - a graph (structure).public void clear() throws MaltChainedException
clear in interface ElementMaltChainedExceptionpublic int compareTo(ComparableNode that)
compareTo in interface java.lang.Comparable<ComparableNode>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.