MaltParser 1.4.1

org.maltparser.core.syntaxgraph.node
Class NonTerminal

java.lang.Object
  extended by java.util.Observable
      extended by org.maltparser.core.syntaxgraph.GraphElement
          extended by org.maltparser.core.syntaxgraph.node.GraphNode
              extended by org.maltparser.core.syntaxgraph.node.NonTerminal
All Implemented Interfaces:
Comparable<ComparableNode>, Element, ComparableNode, Node, NonTerminalNode, PhraseStructureNode

public class NonTerminal
extends GraphNode
implements PhraseStructureNode, NonTerminalNode


Field Summary
protected  SortedSet<PhraseStructureNode> children
           
protected  int index
           
static int INDEX_OFFSET
           
protected  PhraseStructureNode parent
           
 
Fields inherited from class org.maltparser.core.syntaxgraph.node.GraphNode
incomingEdges, outgoingEdges
 
Constructor Summary
NonTerminal()
           
 
Method Summary
 void addIncomingEdge(Edge in)
           
 void addOutgoingEdge(Edge out)
           
 void clear()
          Resets the graph element.
 int compareTo(ComparableNode o)
           
 boolean equals(Object obj)
           
 PhraseStructureNode getChild(int index)
           
 SortedSet<PhraseStructureNode> getChildren()
           
 int getCompareToIndex()
          Returns the index of the node (only used internal by compareTo).
 PhraseStructureNode getHeadChild()
           
 PhraseStructureNode getHeadChild(HeadRules headRules)
           
 int getHeight()
           
 int getIndex()
          Returns the index of the node.
 PhraseStructureNode getLeftChild()
           
 ComparableNode getLeftmostDescendant()
          Returns the left-most terminal descendant node.
 ComparableNode getLeftmostProperDescendant()
          Returns the left-most proper terminal descendant node (excluding itself).
 TokenNode getLexicalHead()
           
 TokenNode getLexicalHead(HeadRules headRules)
           
 PhraseStructureNode getParent()
           
 Edge getParentEdge()
           
 int getParentEdgeLabelCode(SymbolTable table)
           
 String getParentEdgeLabelSymbol(SymbolTable table)
           
 PhraseStructureNode getRightChild()
           
 ComparableNode getRightmostDescendant()
          Returns the right-most terminal descendant node.
 ComparableNode getRightmostProperDescendant()
          Returns the right-most proper terminal descendant node (excluding itself).
 int hashCode()
           
 boolean hasNonTerminalChildren()
           
 boolean hasParentEdgeLabel(SymbolTable table)
           
 boolean hasTerminalChildren()
           
 TokenNode identifyHead(HeadRules headRules)
           
 boolean isContinuous()
           
 boolean isContinuousExcludeTerminalsAttachToRoot()
           
 boolean isRoot()
          Returns true if the node is a root node, otherwise false.
 int nChildren()
           
 void removeIncomingEdge(Edge in)
           
 void removeOutgoingEdge(Edge out)
           
 void setIndex(int index)
           
 String toString()
           
 
Methods inherited from class org.maltparser.core.syntaxgraph.node.GraphNode
getIncomingEdgeIterator, getIncomingSecondaryEdges, getInDegree, getLeftmostDescendantIndex, getLeftmostProperDescendantIndex, getOutDegree, getOutgoingEdgeIterator, getOutgoingSecondaryEdges, getRightmostDescendantIndex, getRightmostProperDescendantIndex
 
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 class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.maltparser.core.syntaxgraph.node.ComparableNode
getIncomingSecondaryEdges, getInDegree, getLeftmostDescendantIndex, getLeftmostProperDescendantIndex, getOutDegree, getOutgoingSecondaryEdges, getRightmostDescendantIndex, getRightmostProperDescendantIndex
 
Methods inherited from interface org.maltparser.core.syntaxgraph.Element
addLabel, addLabel, addLabel, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph
 

Field Detail

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
Constructor Detail

NonTerminal

public NonTerminal()
            throws MaltChainedException
Throws:
MaltChainedException
Method Detail

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

MaltParser 1.4.1

Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.