public void linkAllTreesToRoot() throws MaltChainedException { for (int i : terminalNodes.keySet()) { if (!terminalNodes.get(i).hasHead()) { addDependencyEdge(root,terminalNodes.get(i)); } } }
public void linkAllTreesToRoot() throws MaltChainedException { for (int i : terminalNodes.keySet()) { if (!terminalNodes.get(i).hasHead()) { Edge e = addDependencyEdge(root,terminalNodes.get(i)); mapping.updatePhraseStructureGraph(this, e, false); } } }
public boolean isHeadEdgeLabeled() throws MaltChainedException { if (!hasHead()) { return false; } return getHeadEdge().isLabeled(); }
public DependencyNode getAncestor() throws MaltChainedException { if (!this.hasHead()) { return this; } DependencyNode tmp = this; while (tmp.hasHead()) { tmp = tmp.getHead(); } return tmp; }
public void addHeadEdgeLabel(SymbolTable table, String symbol) throws MaltChainedException { if (hasHead()) { getHeadEdge().addLabel(table, symbol); } }
public void addHeadEdgeLabel(SymbolTable table, int code) throws MaltChainedException { if (hasHead()) { getHeadEdge().addLabel(table, code); } }
public boolean hasHeadEdgeLabel(SymbolTable table) throws MaltChainedException { if (!hasHead()) { return false; } return getHeadEdge().hasLabel(table); }
public int getHeadEdgeLabelCode(SymbolTable table) throws MaltChainedException { if (!hasHead()) { return 0; } return getHeadEdge().getLabelCode(table); }
public int nHeadEdgeLabels() throws MaltChainedException { if (!hasHead()) { return 0; } return getHeadEdge().nLabels(); }
public DependencyNode getProperAncestor() throws MaltChainedException { if (!this.hasHead()) { return null; } DependencyNode tmp = this; while (tmp.hasHead()) { tmp = tmp.getHead(); } return tmp; }
public void addHeadEdgeLabel(LabelSet labelSet) throws MaltChainedException { if (hasHead()) { getHeadEdge().addLabel(labelSet); } }
public boolean isProjective() throws MaltChainedException { if (hasHead() && !getHead().isRoot()) { final DependencyNode head = getHead(); if (getHead().getIndex() < this.getIndex()) {