public class NonTerminal extends GraphNode implements PhraseStructureNode, NonTerminalNode
Modifier and Type | Field and Description |
---|---|
protected java.util.SortedSet<PhraseStructureNode> |
children |
protected int |
index |
static int |
INDEX_OFFSET |
protected PhraseStructureNode |
parent |
incomingEdges, outgoingEdges
Constructor and Description |
---|
NonTerminal() |
getIncomingEdgeIterator, getIncomingSecondaryEdges, getInDegree, getLeftmostDescendantIndex, getLeftmostProperDescendantIndex, getOutDegree, getOutgoingEdgeIterator, getOutgoingSecondaryEdges, getRightmostDescendantIndex, getRightmostProperDescendantIndex
addLabel, addLabel, addLabel, compareTo, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getIncomingSecondaryEdges, getInDegree, getLeftmostDescendantIndex, getLeftmostProperDescendantIndex, getOutDegree, getOutgoingSecondaryEdges, getRightmostDescendantIndex, getRightmostProperDescendantIndex
addLabel, addLabel, addLabel, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph
public static final int INDEX_OFFSET
protected final java.util.SortedSet<PhraseStructureNode> children
protected PhraseStructureNode parent
protected int index
public NonTerminal() throws MaltChainedException
MaltChainedException
public void addIncomingEdge(Edge in) throws MaltChainedException
addIncomingEdge
in interface Node
addIncomingEdge
in class GraphNode
MaltChainedException
public void removeIncomingEdge(Edge in) throws MaltChainedException
removeIncomingEdge
in interface Node
removeIncomingEdge
in class GraphNode
MaltChainedException
public void addOutgoingEdge(Edge out) throws MaltChainedException
addOutgoingEdge
in interface Node
addOutgoingEdge
in class GraphNode
MaltChainedException
public void removeOutgoingEdge(Edge out) throws MaltChainedException
removeOutgoingEdge
in interface Node
removeOutgoingEdge
in class GraphNode
MaltChainedException
public PhraseStructureNode getParent()
getParent
in interface PhraseStructureNode
public Edge getParentEdge() throws MaltChainedException
getParentEdge
in interface PhraseStructureNode
MaltChainedException
public java.lang.String getParentEdgeLabelSymbol(SymbolTable table) throws MaltChainedException
getParentEdgeLabelSymbol
in interface PhraseStructureNode
MaltChainedException
public int getParentEdgeLabelCode(SymbolTable table) throws MaltChainedException
getParentEdgeLabelCode
in interface PhraseStructureNode
MaltChainedException
public boolean hasParentEdgeLabel(SymbolTable table) throws MaltChainedException
hasParentEdgeLabel
in interface PhraseStructureNode
MaltChainedException
public int getHeight()
getHeight
in interface NonTerminalNode
public java.util.SortedSet<PhraseStructureNode> getChildren()
getChildren
in interface NonTerminalNode
public PhraseStructureNode getChild(int index)
getChild
in interface NonTerminalNode
public PhraseStructureNode getLeftChild()
getLeftChild
in interface NonTerminalNode
public PhraseStructureNode getRightChild()
getRightChild
in interface NonTerminalNode
public int nChildren()
nChildren
in interface NonTerminalNode
public boolean hasNonTerminalChildren()
hasNonTerminalChildren
in interface NonTerminalNode
public boolean hasTerminalChildren()
hasTerminalChildren
in interface NonTerminalNode
public TokenNode getLexicalHead(HeadRules headRules) throws MaltChainedException
getLexicalHead
in interface NonTerminalNode
MaltChainedException
public PhraseStructureNode getHeadChild(HeadRules headRules) throws MaltChainedException
getHeadChild
in interface NonTerminalNode
MaltChainedException
public TokenNode getLexicalHead() throws MaltChainedException
getLexicalHead
in interface NonTerminalNode
MaltChainedException
public PhraseStructureNode getHeadChild() throws MaltChainedException
getHeadChild
in interface NonTerminalNode
MaltChainedException
public TokenNode identifyHead(HeadRules headRules) throws MaltChainedException
identifyHead
in interface NonTerminalNode
MaltChainedException
public int getIndex()
ComparableNode
getIndex
in interface ComparableNode
getIndex
in class GraphNode
public int getCompareToIndex()
ComparableNode
getCompareToIndex
in interface ComparableNode
public boolean isContinuous()
isContinuous
in interface NonTerminalNode
public boolean isContinuousExcludeTerminalsAttachToRoot()
isContinuousExcludeTerminalsAttachToRoot
in interface NonTerminalNode
public boolean isRoot()
ComparableNode
isRoot
in interface ComparableNode
isRoot
in class GraphNode
public ComparableNode getLeftmostProperDescendant()
ComparableNode
getLeftmostProperDescendant
in interface ComparableNode
public ComparableNode getRightmostProperDescendant()
ComparableNode
getRightmostProperDescendant
in interface ComparableNode
public ComparableNode getLeftmostDescendant() throws MaltChainedException
ComparableNode
getLeftmostDescendant
in interface ComparableNode
MaltChainedException
public ComparableNode getRightmostDescendant() throws MaltChainedException
ComparableNode
getRightmostDescendant
in interface ComparableNode
MaltChainedException
public void setIndex(int index) throws MaltChainedException
setIndex
in interface Node
setIndex
in class GraphNode
MaltChainedException
public void clear() throws MaltChainedException
GraphElement
clear
in interface Element
clear
in class GraphNode
MaltChainedException
public int compareTo(ComparableNode o)
compareTo
in interface java.lang.Comparable<ComparableNode>
compareTo
in class GraphNode
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.