public class PhraseStructureGraph extends Sentence implements PhraseStructure
Modifier and Type | Field and Description |
---|---|
protected ObjectPoolList<Edge> |
edgePool |
protected java.util.SortedSet<Edge> |
graphEdges |
protected java.util.SortedMap<java.lang.Integer,NonTerminal> |
nonTerminalNodes |
protected ObjectPoolList<NonTerminal> |
nonTerminalPool |
protected Root |
root |
comments, sentenceID, terminalNodes, terminalPool
labelSetPool, numberOfComponents, symbolTables
Constructor and Description |
---|
PhraseStructureGraph(SymbolTableHandler symbolTables) |
addComment, addTokenNode, addTokenNode, getComment, getHighestTokenIndex, getOrAddTerminalNode, getSentenceID, getTokenIndices, getTokenNode, hasComments, hasTokens, nTokenNode, setSentenceID, update
addLabel, checkInLabelSet, checkOutNewLabelSet, getSymbolTables, setSymbolTables
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addComment, addTokenNode, addTokenNode, getComment, getHighestTokenIndex, getSentenceID, getTokenIndices, getTokenNode, hasComments, hasTokens, nTokenNode, setSentenceID
addLabel, checkInLabelSet, checkOutNewLabelSet, getSymbolTables, setSymbolTables
protected final ObjectPoolList<Edge> edgePool
protected final java.util.SortedSet<Edge> graphEdges
protected final java.util.SortedMap<java.lang.Integer,NonTerminal> nonTerminalNodes
protected final ObjectPoolList<NonTerminal> nonTerminalPool
public PhraseStructureGraph(SymbolTableHandler symbolTables) throws MaltChainedException
MaltChainedException
public PhraseStructureNode addTerminalNode() throws MaltChainedException
addTerminalNode
in interface PhraseStructure
MaltChainedException
public PhraseStructureNode addTerminalNode(int index) throws MaltChainedException
addTerminalNode
in interface PhraseStructure
MaltChainedException
public PhraseStructureNode getTerminalNode(int index)
getTerminalNode
in interface PhraseStructure
public int nTerminalNode()
nTerminalNode
in interface PhraseStructure
public PhraseStructureNode addNonTerminalNode(int index) throws MaltChainedException
addNonTerminalNode
in interface PhraseStructure
MaltChainedException
public PhraseStructureNode addNonTerminalNode() throws MaltChainedException
addNonTerminalNode
in interface PhraseStructure
MaltChainedException
public PhraseStructureNode getNonTerminalNode(int index) throws MaltChainedException
getNonTerminalNode
in interface PhraseStructure
MaltChainedException
public int getHighestNonTerminalIndex()
getHighestNonTerminalIndex
in interface PhraseStructure
public java.util.Set<java.lang.Integer> getNonTerminalIndices()
getNonTerminalIndices
in interface PhraseStructure
public boolean hasNonTerminals()
hasNonTerminals
in interface PhraseStructure
public int nNonTerminals()
nNonTerminals
in interface PhraseStructure
public PhraseStructureNode getPhraseStructureRoot()
getPhraseStructureRoot
in interface PhraseStructure
public Edge addPhraseStructureEdge(PhraseStructureNode parent, PhraseStructureNode child) throws MaltChainedException
addPhraseStructureEdge
in interface PhraseStructure
MaltChainedException
public void removePhraseStructureEdge(PhraseStructureNode parent, PhraseStructureNode child) throws MaltChainedException
removePhraseStructureEdge
in interface PhraseStructure
MaltChainedException
public Edge addSecondaryEdge(ComparableNode source, ComparableNode target) throws MaltChainedException
addSecondaryEdge
in interface SecEdgeStructure
MaltChainedException
public void removeSecondaryEdge(ComparableNode source, ComparableNode target) throws MaltChainedException
removeSecondaryEdge
in interface SecEdgeStructure
MaltChainedException
public int nEdges()
nEdges
in interface PhraseStructure
public boolean isContinuous()
isContinuous
in interface PhraseStructure
public boolean isContinuousExcludeTerminalsAttachToRoot()
isContinuousExcludeTerminalsAttachToRoot
in interface PhraseStructure
public void clear() throws MaltChainedException
LabeledStructure
clear
in interface LabeledStructure
clear
in class Sentence
MaltChainedException
public java.lang.String toStringTerminalNode(TokenNode node)
public java.lang.String toStringNonTerminalNode(NonTerminalNode node)
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.