org.maltparser.core.syntaxgraph.node
Class NonTerminal
java.lang.Object
java.util.Observable
org.maltparser.core.syntaxgraph.GraphElement
org.maltparser.core.syntaxgraph.node.GraphNode
org.maltparser.core.syntaxgraph.node.NonTerminal
- All Implemented Interfaces:
- Comparable<ComparableNode>, Element, ComparableNode, Node, NonTerminalNode, PhraseStructureNode
public class NonTerminal
- extends GraphNode
- implements PhraseStructureNode, NonTerminalNode
Methods inherited from class org.maltparser.core.syntaxgraph.GraphElement |
addLabel, addLabel, addLabel, compareTo, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph |
Methods inherited from interface org.maltparser.core.syntaxgraph.Element |
addLabel, addLabel, addLabel, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph |
INDEX_OFFSET
public static final int INDEX_OFFSET
- See Also:
- Constant Field Values
children
protected final SortedSet<PhraseStructureNode> children
parent
protected PhraseStructureNode parent
index
protected int index
NonTerminal
public NonTerminal()
throws MaltChainedException
- Throws:
MaltChainedException
addIncomingEdge
public void addIncomingEdge(Edge in)
throws MaltChainedException
- Specified by:
addIncomingEdge
in interface Node
- Overrides:
addIncomingEdge
in class GraphNode
- Throws:
MaltChainedException
removeIncomingEdge
public void removeIncomingEdge(Edge in)
throws MaltChainedException
- Specified by:
removeIncomingEdge
in interface Node
- Overrides:
removeIncomingEdge
in class GraphNode
- Throws:
MaltChainedException
addOutgoingEdge
public void addOutgoingEdge(Edge out)
throws MaltChainedException
- Specified by:
addOutgoingEdge
in interface Node
- Overrides:
addOutgoingEdge
in class GraphNode
- Throws:
MaltChainedException
removeOutgoingEdge
public void removeOutgoingEdge(Edge out)
throws MaltChainedException
- Specified by:
removeOutgoingEdge
in interface Node
- Overrides:
removeOutgoingEdge
in class GraphNode
- Throws:
MaltChainedException
getParent
public PhraseStructureNode getParent()
- Specified by:
getParent
in interface PhraseStructureNode
getParentEdge
public Edge getParentEdge()
throws MaltChainedException
- Specified by:
getParentEdge
in interface PhraseStructureNode
- Throws:
MaltChainedException
getParentEdgeLabelSymbol
public String getParentEdgeLabelSymbol(SymbolTable table)
throws MaltChainedException
- Specified by:
getParentEdgeLabelSymbol
in interface PhraseStructureNode
- Throws:
MaltChainedException
getParentEdgeLabelCode
public int getParentEdgeLabelCode(SymbolTable table)
throws MaltChainedException
- Specified by:
getParentEdgeLabelCode
in interface PhraseStructureNode
- Throws:
MaltChainedException
hasParentEdgeLabel
public boolean hasParentEdgeLabel(SymbolTable table)
throws MaltChainedException
- Specified by:
hasParentEdgeLabel
in interface PhraseStructureNode
- Throws:
MaltChainedException
getHeight
public int getHeight()
- Specified by:
getHeight
in interface NonTerminalNode
getChildren
public SortedSet<PhraseStructureNode> getChildren()
- Specified by:
getChildren
in interface NonTerminalNode
getChild
public PhraseStructureNode getChild(int index)
- Specified by:
getChild
in interface NonTerminalNode
getLeftChild
public PhraseStructureNode getLeftChild()
- Specified by:
getLeftChild
in interface NonTerminalNode
getRightChild
public PhraseStructureNode getRightChild()
- Specified by:
getRightChild
in interface NonTerminalNode
nChildren
public int nChildren()
- Specified by:
nChildren
in interface NonTerminalNode
hasNonTerminalChildren
public boolean hasNonTerminalChildren()
- Specified by:
hasNonTerminalChildren
in interface NonTerminalNode
hasTerminalChildren
public boolean hasTerminalChildren()
- Specified by:
hasTerminalChildren
in interface NonTerminalNode
getLexicalHead
public TokenNode getLexicalHead(HeadRules headRules)
throws MaltChainedException
- Specified by:
getLexicalHead
in interface NonTerminalNode
- Throws:
MaltChainedException
getHeadChild
public PhraseStructureNode getHeadChild(HeadRules headRules)
throws MaltChainedException
- Specified by:
getHeadChild
in interface NonTerminalNode
- Throws:
MaltChainedException
getLexicalHead
public TokenNode getLexicalHead()
throws MaltChainedException
- Specified by:
getLexicalHead
in interface NonTerminalNode
- Throws:
MaltChainedException
getHeadChild
public PhraseStructureNode getHeadChild()
throws MaltChainedException
- Specified by:
getHeadChild
in interface NonTerminalNode
- Throws:
MaltChainedException
identifyHead
public TokenNode identifyHead(HeadRules headRules)
throws MaltChainedException
- Specified by:
identifyHead
in interface NonTerminalNode
- Throws:
MaltChainedException
getIndex
public int getIndex()
- Description copied from interface:
ComparableNode
- Returns the index of the node.
- Specified by:
getIndex
in interface ComparableNode
- Specified by:
getIndex
in class GraphNode
- Returns:
- the index of the node.
getCompareToIndex
public int getCompareToIndex()
- Description copied from interface:
ComparableNode
- Returns the index of the node (only used internal by compareTo).
- Specified by:
getCompareToIndex
in interface ComparableNode
- Returns:
- the index of the node (only used internal by compareTo).
isContinuous
public boolean isContinuous()
- Specified by:
isContinuous
in interface NonTerminalNode
isContinuousExcludeTerminalsAttachToRoot
public boolean isContinuousExcludeTerminalsAttachToRoot()
- Specified by:
isContinuousExcludeTerminalsAttachToRoot
in interface NonTerminalNode
isRoot
public boolean isRoot()
- Description copied from interface:
ComparableNode
- Returns true if the node is a root node, otherwise false.
- Specified by:
isRoot
in interface ComparableNode
- Specified by:
isRoot
in class GraphNode
- Returns:
- true if the node is a root node, otherwise false.
getLeftmostProperDescendant
public ComparableNode getLeftmostProperDescendant()
- Description copied from interface:
ComparableNode
- Returns the left-most proper terminal descendant node (excluding itself).
- Specified by:
getLeftmostProperDescendant
in interface ComparableNode
- Returns:
- the left-most proper terminal descendant node.
getRightmostProperDescendant
public ComparableNode getRightmostProperDescendant()
- Description copied from interface:
ComparableNode
- Returns the right-most proper terminal descendant node (excluding itself).
- Specified by:
getRightmostProperDescendant
in interface ComparableNode
- Returns:
- the right-most proper terminal descendant node.
getLeftmostDescendant
public ComparableNode getLeftmostDescendant()
throws MaltChainedException
- Description copied from interface:
ComparableNode
- Returns the left-most terminal descendant node.
- Specified by:
getLeftmostDescendant
in interface ComparableNode
- Returns:
- the left-most terminal descendant node.
- Throws:
MaltChainedException
getRightmostDescendant
public ComparableNode getRightmostDescendant()
throws MaltChainedException
- Description copied from interface:
ComparableNode
- Returns the right-most terminal descendant node.
- Specified by:
getRightmostDescendant
in interface ComparableNode
- Returns:
- the right-most terminal descendant node.
- Throws:
MaltChainedException
setIndex
public void setIndex(int index)
throws MaltChainedException
- Specified by:
setIndex
in interface Node
- Specified by:
setIndex
in class GraphNode
- Throws:
MaltChainedException
clear
public void clear()
throws MaltChainedException
- Description copied from class:
GraphElement
- Resets the graph element.
- Specified by:
clear
in interface Element
- Overrides:
clear
in class GraphNode
- Throws:
MaltChainedException
compareTo
public int compareTo(ComparableNode o)
- Specified by:
compareTo
in interface Comparable<ComparableNode>
- Overrides:
compareTo
in class GraphNode
equals
public boolean equals(Object obj)
- Overrides:
equals
in class GraphNode
hashCode
public int hashCode()
- Overrides:
hashCode
in class GraphNode
toString
public String toString()
- Overrides:
toString
in class GraphNode
Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.