|
MaltParser 1.4.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.maltparser.core.syntaxgraph.SyntaxGraph
org.maltparser.core.syntaxgraph.Sentence
org.maltparser.core.syntaxgraph.MappablePhraseStructureGraph
public class MappablePhraseStructureGraph
| Field Summary |
|---|
| Fields inherited from class org.maltparser.core.syntaxgraph.Sentence |
|---|
sentenceID, terminalNodes, terminalPool |
| Fields inherited from class org.maltparser.core.syntaxgraph.SyntaxGraph |
|---|
labelSetPool, numberOfComponents, symbolTables |
| Constructor Summary | |
|---|---|
MappablePhraseStructureGraph(SymbolTableHandler symbolTables)
|
|
| Method Summary | |
|---|---|
Edge |
addDependencyEdge(DependencyNode head,
DependencyNode dependent)
|
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)
|
void |
addLabel(Element element,
String labelFunction,
String label)
Adds a label label to the graph element element |
PhraseStructureNode |
addNonTerminalNode()
|
PhraseStructureNode |
addNonTerminalNode(int index)
|
Edge |
addPhraseStructureEdge(PhraseStructureNode parent,
PhraseStructureNode child)
|
Edge |
addSecondaryEdge(ComparableNode source,
ComparableNode target)
|
PhraseStructureNode |
addTerminalNode()
|
PhraseStructureNode |
addTerminalNode(int index)
|
void |
clear()
Resets the structure. |
int |
getDefaultRootEdgeLabelCode(SymbolTable table)
Returns the default edge label of the root as an integer value. |
LabelSet |
getDefaultRootEdgeLabels()
|
String |
getDefaultRootEdgeLabelSymbol(SymbolTable table)
Returns the default edge label of the root as a string value. |
SortedSet<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. |
SortedSet<Edge> |
getEdges()
|
int |
getHighestDependencyNodeIndex()
|
int |
getHighestNonTerminalIndex()
|
LosslessMapping |
getMapping()
|
Set<Integer> |
getNonTerminalIndices()
|
PhraseStructureNode |
getNonTerminalNode(int index)
|
PhraseStructureNode |
getPhraseStructureRoot()
|
PhraseStructureNode |
getTerminalNode(int index)
|
boolean |
hasLabeledDependency(int index)
Returns true if the head edge of the dependency node with index is labeled, otherwise false. |
boolean |
hasNonTerminals()
|
boolean |
isConnected()
Returns true if all nodes in the dependency structure are connected, otherwise false. |
boolean |
isContinuous()
|
boolean |
isContinuousExcludeTerminalsAttachToRoot()
|
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 |
isSingleHeadedConstraint()
|
boolean |
isTree()
Returns true if the dependency structure are a tree (isConnected() && isSingleHeaded()), otherwise false. |
protected DependencyNode |
link(DependencyNode x,
DependencyNode y)
|
void |
linkAllTerminalsToRoot()
|
void |
linkAllTreesToRoot()
Links all subtrees to the root of the dependency structure. |
Edge |
moveDependencyEdge(DependencyNode newHead,
DependencyNode dependent)
|
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. |
int |
nNonTerminals()
|
int |
nTerminalNode()
|
void |
removeDependencyEdge(int headIndex,
int dependentIndex)
Remove an edge from the head to the dependent identified by the indices of the dependency nodes. |
protected void |
removeDependencyEdge(Node head,
Node dependent)
|
void |
removePhraseStructureEdge(PhraseStructureNode parent,
PhraseStructureNode child)
|
void |
removeSecondaryEdge(ComparableNode source,
ComparableNode target)
|
void |
setDefaultRootEdgeLabel(SymbolTable table,
String defaultRootSymbol)
Sets the default edge label of the root. |
void |
setDefaultRootEdgeLabels(String rootLabelOption,
SortedMap<String,SymbolTable> edgeSymbolTables)
Sets the default edge label of the root according to the default root label option |
void |
setMapping(LosslessMapping mapping)
|
void |
setSingleHeadedConstraint(boolean singleHeadedConstraint)
|
String |
toString()
|
String |
toStringNonTerminalNode(NonTerminalNode node)
|
String |
toStringTerminalNode(TokenNode node)
|
void |
update(Observable o,
Object arg)
|
| Methods inherited from class org.maltparser.core.syntaxgraph.Sentence |
|---|
addTokenNode, addTokenNode, getHighestTokenIndex, getOrAddTerminalNode, getSentenceID, getTokenIndices, getTokenNode, hasTokens, nTokenNode, setSentenceID |
| Methods inherited from class org.maltparser.core.syntaxgraph.SyntaxGraph |
|---|
checkInLabelSet, checkOutNewLabelSet, getSymbolTables, setSymbolTables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.maltparser.core.syntaxgraph.TokenStructure |
|---|
addTokenNode, addTokenNode, getHighestTokenIndex, getSentenceID, getTokenIndices, getTokenNode, hasTokens, nTokenNode, setSentenceID |
| Methods inherited from interface org.maltparser.core.syntaxgraph.LabeledStructure |
|---|
checkInLabelSet, checkOutNewLabelSet, getSymbolTables, setSymbolTables |
| Constructor Detail |
|---|
public MappablePhraseStructureGraph(SymbolTableHandler symbolTables)
throws MaltChainedException
MaltChainedException| Method Detail |
|---|
public DependencyNode addDependencyNode()
throws MaltChainedException
addDependencyNode in interface DependencyStructureMaltChainedException
public DependencyNode addDependencyNode(int index)
throws MaltChainedException
addDependencyNode in interface DependencyStructureMaltChainedException
public DependencyNode getDependencyNode(int index)
throws MaltChainedException
DependencyStructure
getDependencyNode in interface DependencyStructureindex - the index of the dependency node
MaltChainedExceptionpublic int nDependencyNode()
nDependencyNode in interface DependencyStructurepublic int getHighestDependencyNodeIndex()
getHighestDependencyNodeIndex in interface DependencyStructure
public Edge addDependencyEdge(int headIndex,
int dependentIndex)
throws MaltChainedException
DependencyStructure
addDependencyEdge in interface DependencyStructureheadIndex - the index of the head dependency nodedependentIndex - the index of the dependent dependency node
MaltChainedException
public Edge addDependencyEdge(DependencyNode head,
DependencyNode dependent)
throws MaltChainedException
MaltChainedException
public Edge moveDependencyEdge(int newHeadIndex,
int dependentIndex)
throws MaltChainedException
DependencyStructure
moveDependencyEdge in interface DependencyStructurenewHeadIndex - the index of the new head dependency nodedependentIndex - the index of the dependent dependency node
MaltChainedException
public Edge moveDependencyEdge(DependencyNode newHead,
DependencyNode dependent)
throws MaltChainedException
MaltChainedException
public void removeDependencyEdge(int headIndex,
int dependentIndex)
throws MaltChainedException
DependencyStructure
removeDependencyEdge in interface DependencyStructureheadIndex - the index of the head dependency nodedependentIndex - the index of the dependent dependency node
MaltChainedException
protected void removeDependencyEdge(Node head,
Node dependent)
throws MaltChainedException
MaltChainedException
public Edge addSecondaryEdge(ComparableNode source,
ComparableNode target)
throws MaltChainedException
addSecondaryEdge in interface SecEdgeStructureMaltChainedException
public void removeSecondaryEdge(ComparableNode source,
ComparableNode target)
throws MaltChainedException
removeSecondaryEdge in interface SecEdgeStructureMaltChainedException
public boolean hasLabeledDependency(int index)
throws MaltChainedException
DependencyStructure
hasLabeledDependency in interface DependencyStructureindex - the index of the dependency node
MaltChainedExceptionpublic boolean isConnected()
DependencyStructure
isConnected in interface DependencyStructure
public boolean isProjective()
throws MaltChainedException
DependencyStructure
isProjective in interface DependencyStructureMaltChainedExceptionpublic boolean isTree()
DependencyStructure
isTree in interface DependencyStructurepublic boolean isSingleHeaded()
DependencyStructure
isSingleHeaded in interface DependencyStructurepublic boolean isSingleHeadedConstraint()
public void setSingleHeadedConstraint(boolean singleHeadedConstraint)
public int nNonProjectiveEdges()
throws MaltChainedException
DependencyStructure
nNonProjectiveEdges in interface DependencyStructureMaltChainedExceptionpublic int nEdges()
DependencyStructure
nEdges in interface DependencyStructurenEdges in interface PhraseStructurepublic SortedSet<Edge> getEdges()
getEdges in interface DependencyStructurepublic SortedSet<Integer> getDependencyIndices()
DependencyStructure
getDependencyIndices in interface DependencyStructure
protected DependencyNode link(DependencyNode x,
DependencyNode y)
public void linkAllTerminalsToRoot()
throws MaltChainedException
MaltChainedException
public void linkAllTreesToRoot()
throws MaltChainedException
DependencyStructure
linkAllTreesToRoot in interface DependencyStructureMaltChainedException
public LabelSet getDefaultRootEdgeLabels()
throws MaltChainedException
getDefaultRootEdgeLabels in interface DependencyStructureMaltChainedException
public String getDefaultRootEdgeLabelSymbol(SymbolTable table)
throws MaltChainedException
DependencyStructure
getDefaultRootEdgeLabelSymbol in interface DependencyStructuretable - the symbol table that identifies the label type.
MaltChainedException
public int getDefaultRootEdgeLabelCode(SymbolTable table)
throws MaltChainedException
DependencyStructure
getDefaultRootEdgeLabelCode in interface DependencyStructuretable - the symbol table that identifies the label type.
MaltChainedException
public void setDefaultRootEdgeLabel(SymbolTable table,
String defaultRootSymbol)
throws MaltChainedException
DependencyStructure
setDefaultRootEdgeLabel in interface DependencyStructuretable - the symbol table that identifies the label type.defaultRootSymbol - the default root edge label
MaltChainedException
public void setDefaultRootEdgeLabels(String rootLabelOption,
SortedMap<String,SymbolTable> edgeSymbolTables)
throws MaltChainedException
DependencyStructure
setDefaultRootEdgeLabels in interface DependencyStructurerootLabelOption - the default root label optionedgeSymbolTables - a sorted map that maps the symbol table name to the symbol table object.
MaltChainedException
public void clear()
throws MaltChainedException
Structure
clear in interface Structureclear in class SentenceMaltChainedExceptionpublic DependencyNode getDependencyRoot()
DependencyStructure
getDependencyRoot in interface DependencyStructure
public PhraseStructureNode addTerminalNode()
throws MaltChainedException
addTerminalNode in interface PhraseStructureMaltChainedException
public PhraseStructureNode addTerminalNode(int index)
throws MaltChainedException
addTerminalNode in interface PhraseStructureMaltChainedExceptionpublic PhraseStructureNode getTerminalNode(int index)
getTerminalNode in interface PhraseStructurepublic int nTerminalNode()
nTerminalNode in interface PhraseStructure
public PhraseStructureNode addNonTerminalNode(int index)
throws MaltChainedException
addNonTerminalNode in interface PhraseStructureMaltChainedException
public PhraseStructureNode addNonTerminalNode()
throws MaltChainedException
addNonTerminalNode in interface PhraseStructureMaltChainedException
public PhraseStructureNode getNonTerminalNode(int index)
throws MaltChainedException
getNonTerminalNode in interface PhraseStructureMaltChainedExceptionpublic int getHighestNonTerminalIndex()
getHighestNonTerminalIndex in interface PhraseStructurepublic Set<Integer> getNonTerminalIndices()
getNonTerminalIndices in interface PhraseStructurepublic boolean hasNonTerminals()
hasNonTerminals in interface PhraseStructurepublic int nNonTerminals()
nNonTerminals in interface PhraseStructurepublic PhraseStructureNode getPhraseStructureRoot()
getPhraseStructureRoot in interface PhraseStructure
public Edge addPhraseStructureEdge(PhraseStructureNode parent,
PhraseStructureNode child)
throws MaltChainedException
addPhraseStructureEdge in interface PhraseStructureMaltChainedException
public void update(Observable o,
Object arg)
update in interface Observerupdate in class Sentencepublic LosslessMapping getMapping()
public void setMapping(LosslessMapping mapping)
public void addLabel(Element element,
String labelFunction,
String label)
throws MaltChainedException
LabeledStructure
addLabel in interface LabeledStructureaddLabel in class SyntaxGraphelement - a graph element element (a node or a edge).labelFunction - the name of the symbol table.label - the string value of the label.
MaltChainedException
public void removePhraseStructureEdge(PhraseStructureNode parent,
PhraseStructureNode child)
throws MaltChainedException
removePhraseStructureEdge in interface PhraseStructureMaltChainedExceptionpublic boolean isContinuous()
isContinuous in interface PhraseStructurepublic boolean isContinuousExcludeTerminalsAttachToRoot()
isContinuousExcludeTerminalsAttachToRoot in interface PhraseStructurepublic String toStringTerminalNode(TokenNode node)
public String toStringNonTerminalNode(NonTerminalNode node)
public String toString()
toString in class Sentence
|
MaltParser 1.4.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||