public interface DependencyStructure extends TokenStructure, SecEdgeStructure
| Modifier and Type | Method and Description |
|---|---|
Edge |
addDependencyEdge(int headIndex,
int dependentIndex)
Adds an edge from the head to the dependent identified by the indices of the dependency nodes.
|
DependencyNode |
addDependencyNode() |
DependencyNode |
addDependencyNode(int index) |
int |
getDefaultRootEdgeLabelCode(SymbolTable table)
Returns the default edge label of the root as an integer value.
|
LabelSet |
getDefaultRootEdgeLabels() |
java.lang.String |
getDefaultRootEdgeLabelSymbol(SymbolTable table)
Returns the default edge label of the root as a string value.
|
java.util.SortedSet<java.lang.Integer> |
getDependencyIndices()
Returns a sorted set of integers {0,s,..n} , where each index i identifies a dependency node.
|
DependencyNode |
getDependencyNode(int index)
Returns the dependency node identified by index if it exists, otherwise null.
|
DependencyNode |
getDependencyRoot()
Returns the root of the dependency structure.
|
java.util.SortedSet<Edge> |
getEdges() |
int |
getHighestDependencyNodeIndex() |
boolean |
hasLabeledDependency(int index)
Returns true if the head edge of the dependency node with index is labeled, otherwise false.
|
boolean |
isConnected()
Returns true if all nodes in the dependency structure are connected, otherwise false.
|
boolean |
isProjective()
Returns true if all edges in the dependency structure are projective, otherwise false.
|
boolean |
isSingleHeaded()
Returns true if all dependency nodes have at most one incoming edge, otherwise false.
|
boolean |
isTree()
Returns true if the dependency structure are a tree (isConnected() && isSingleHeaded()), otherwise false.
|
void |
linkAllTreesToRoot()
Links all subtrees to the root of the dependency structure.
|
Edge |
moveDependencyEdge(int newHeadIndex,
int dependentIndex)
Replace the head of the dependent with a new head.
|
int |
nDependencyNode() |
int |
nEdges()
Returns the number of edges
|
int |
nNonProjectiveEdges()
Returns the number of non-projective edges in the dependency structure.
|
void |
removeDependencyEdge(int headIndex,
int dependentIndex)
Remove an edge from the head to the dependent identified by the indices of the dependency nodes.
|
void |
setDefaultRootEdgeLabel(SymbolTable table,
java.lang.String defaultRootSymbol)
Sets the default edge label of the root.
|
void |
setDefaultRootEdgeLabels(java.lang.String rootLabelOption,
java.util.SortedMap<java.lang.String,SymbolTable> edgeSymbolTables)
Sets the default edge label of the root according to the default root label option
|
addComment, addTokenNode, addTokenNode, getComment, getHighestTokenIndex, getSentenceID, getTokenIndices, getTokenNode, hasComments, hasTokens, nTokenNode, setSentenceIDaddLabel, checkInLabelSet, checkOutNewLabelSet, clear, getSymbolTables, setSymbolTablesaddSecondaryEdge, removeSecondaryEdgeDependencyNode addDependencyNode() throws MaltChainedException
MaltChainedExceptionDependencyNode addDependencyNode(int index) throws MaltChainedException
MaltChainedExceptionDependencyNode getDependencyNode(int index) throws MaltChainedException
index - the index of the dependency nodeMaltChainedExceptionint nDependencyNode()
int getHighestDependencyNodeIndex()
Edge addDependencyEdge(int headIndex, int dependentIndex) throws MaltChainedException
headIndex - the index of the head dependency nodedependentIndex - the index of the dependent dependency nodeMaltChainedExceptionEdge moveDependencyEdge(int newHeadIndex, int dependentIndex) throws MaltChainedException
newHeadIndex - the index of the new head dependency nodedependentIndex - the index of the dependent dependency nodeMaltChainedExceptionvoid removeDependencyEdge(int headIndex, int dependentIndex) throws MaltChainedException
headIndex - the index of the head dependency nodedependentIndex - the index of the dependent dependency nodeMaltChainedExceptionint nEdges()
java.util.SortedSet<java.lang.Integer> getDependencyIndices()
DependencyNode getDependencyRoot()
boolean hasLabeledDependency(int index) throws MaltChainedException
index - the index of the dependency nodeMaltChainedExceptionboolean isConnected()
boolean isProjective() throws MaltChainedException
MaltChainedExceptionboolean isSingleHeaded()
boolean isTree()
int nNonProjectiveEdges() throws MaltChainedException
MaltChainedExceptionvoid linkAllTreesToRoot() throws MaltChainedException
MaltChainedExceptionLabelSet getDefaultRootEdgeLabels() throws MaltChainedException
MaltChainedExceptionjava.lang.String getDefaultRootEdgeLabelSymbol(SymbolTable table) throws MaltChainedException
table - the symbol table that identifies the label type.MaltChainedExceptionint getDefaultRootEdgeLabelCode(SymbolTable table) throws MaltChainedException
table - the symbol table that identifies the label type.MaltChainedExceptionvoid setDefaultRootEdgeLabel(SymbolTable table, java.lang.String defaultRootSymbol) throws MaltChainedException
table - the symbol table that identifies the label type.defaultRootSymbol - the default root edge labelMaltChainedExceptionvoid setDefaultRootEdgeLabels(java.lang.String rootLabelOption, java.util.SortedMap<java.lang.String,SymbolTable> edgeSymbolTables) throws MaltChainedException
rootLabelOption - the default root label optionedgeSymbolTables - a sorted map that maps the symbol table name to the symbol table object.MaltChainedExceptionCopyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.