@Override public int getRightmostProperDescendantIndex() throws MaltChainedException { ComparableNode node = getRightmostProperDescendant(); return (node != null)?node.getIndex():-1; }
@Override public int getLeftmostProperDescendantIndex() throws MaltChainedException { ComparableNode node = getLeftmostProperDescendant(); return (node != null)?node.getIndex():-1; } @Override
public int getLeftmostProperDescendantIndex() throws MaltChainedException { ComparableNode node = getLeftmostProperDescendant(); return (node != null)?node.getIndex():-1; }
public int getRightmostProperDescendantIndex() throws MaltChainedException { ComparableNode node = getRightmostProperDescendant(); return (node != null)?node.getIndex():-1; }
if (candidate == null) { candidate = ldep; } else if (ldep.getIndex() < candidate.getIndex() ) { candidate = ldep; } else if (tmp.getIndex() < candidate.getIndex() ) { candidate = tmp; if (candidate.getIndex() == 1) { return candidate; if (candidate == null) { candidate = rdep; } else if (rdep.getIndex() < candidate.getIndex() ) { candidate = rdep; } else if (tmp.getIndex() < candidate.getIndex() ) { candidate = tmp; if (candidate.getIndex() == 1) { return candidate;
if (candidate == null) { candidate = ldep; } else if (ldep.getIndex() < candidate.getIndex() ) { candidate = ldep; } else if (tmp.getIndex() < candidate.getIndex() ) { candidate = tmp; if (candidate.getIndex() == 1) { return candidate; if (candidate == null) { candidate = rdep; } else if (rdep.getIndex() < candidate.getIndex() ) { candidate = rdep; } else if (tmp.getIndex() < candidate.getIndex() ) { candidate = tmp; if (candidate.getIndex() == 1) { return candidate;
@Override public ComparableNode getLeftmostProperDescendant() throws MaltChainedException { ComparableNode candidate = null; List<DependencyNode> dependents = graph.getListOfDependents(index); for (int i = 0; i < dependents.size(); i++) { final DependencyNode dep = dependents.get(i); if (candidate == null || dep.getIndex() < candidate.getIndex()) { candidate = dep; } final ComparableNode tmp = dep.getLeftmostProperDescendant(); if (tmp == null) { continue; } if (candidate == null || tmp.getIndex() < candidate.getIndex()) { candidate = tmp; } if (candidate.getIndex() == 1) { return candidate; } } return candidate; }
@Override public ComparableNode getLeftmostDescendant() throws MaltChainedException { ComparableNode candidate = this; List<DependencyNode> dependents = graph.getListOfDependents(index); for (int i = 0; i < dependents.size(); i++) { final DependencyNode dep = dependents.get(i); if (dep.getIndex() < candidate.getIndex()) { candidate = dep; } final ComparableNode tmp = dep.getLeftmostDescendant(); if (tmp == null) { continue; } if (tmp.getIndex() < candidate.getIndex()) { candidate = tmp; } if (candidate.getIndex() == 1) { return candidate; } } return candidate; }
@Override public ComparableNode getRightmostDescendant() throws MaltChainedException { ComparableNode candidate = this; List<DependencyNode> dependents = graph.getListOfDependents(index); for (int i = 0; i < dependents.size(); i++) { final DependencyNode dep = dependents.get(i); if (dep.getIndex() > candidate.getIndex() ) { candidate = dep; } final ComparableNode tmp = dep.getRightmostDescendant(); if (tmp == null) { continue; } if (tmp.getIndex() > candidate.getIndex() ) { candidate = tmp; } } return candidate; }
if (candidate == null) { candidate = ldep; } else if (ldep.getIndex() > candidate.getIndex() ) { candidate = ldep; } else if (tmp.getIndex() > candidate.getIndex() ) { candidate = tmp; if (candidate == null) { candidate = rdep; } else if (rdep.getIndex() > candidate.getIndex() ) { candidate = rdep; } else if (tmp.getIndex() > candidate.getIndex() ) { candidate = tmp;
@Override public ComparableNode getRightmostProperDescendant() throws MaltChainedException { ComparableNode candidate = null; List<DependencyNode> dependents = graph.getListOfDependents(index); for (int i = 0; i < dependents.size(); i++) { final DependencyNode dep = dependents.get(i); if (candidate == null || dep.getIndex() > candidate.getIndex()) { candidate = dep; } final ComparableNode tmp = dep.getRightmostProperDescendant(); if (tmp == null) { continue; } if (candidate == null || tmp.getIndex() > candidate.getIndex()) { candidate = tmp; } } return candidate; } @Override
if (candidate == null) { candidate = ldep; } else if (ldep.getIndex() > candidate.getIndex() ) { candidate = ldep; } else if (tmp.getIndex() > candidate.getIndex() ) { candidate = tmp; if (candidate == null) { candidate = rdep; } else if (rdep.getIndex() > candidate.getIndex() ) { candidate = rdep; } else if (tmp.getIndex() > candidate.getIndex() ) { candidate = tmp;
@Override public int getLeftmostDescendantIndex() throws MaltChainedException { ComparableNode node = getLeftmostDescendant(); return (node != null)?node.getIndex():this.getIndex(); } @Override
@Override public int getRightmostDescendantIndex() throws MaltChainedException { ComparableNode node = getRightmostDescendant(); return (node != null)?node.getIndex():this.getIndex(); }
public int getLeftmostDescendantIndex() throws MaltChainedException { ComparableNode node = getLeftmostProperDescendant(); return (node != null)?node.getIndex():this.getIndex(); }
public int getRightmostDescendantIndex() throws MaltChainedException { ComparableNode node = getRightmostProperDescendant(); return (node != null)?node.getIndex():this.getIndex(); }
public boolean isContinuous() { int lcorner = getLeftmostProperDescendant().getIndex(); int rcorner = getRightmostProperDescendant().getIndex(); if (lcorner == rcorner) { return true; } TokenNode terminal = ((TokenStructure)getBelongsToGraph()).getTokenNode(lcorner); while (terminal.getIndex() != rcorner) { PhraseStructureNode tmp = terminal.getParent(); while (true) { if (tmp == this) { break; } if (tmp == null) { return false; } tmp = tmp.getParent(); } terminal = terminal.getTokenNodeSuccessor(); } return true; }
public boolean isContinuousExcludeTerminalsAttachToRoot() { int lcorner = getLeftmostProperDescendant().getIndex(); int rcorner = getRightmostProperDescendant().getIndex(); if (lcorner == rcorner) { return true; } TokenNode terminal = ((TokenStructure)getBelongsToGraph()).getTokenNode(lcorner); while (terminal.getIndex() != rcorner) { if (terminal.getParent() != null && terminal.getParent().isRoot()) { terminal = terminal.getTokenNodeSuccessor(); continue; } PhraseStructureNode tmp = terminal.getParent(); while (true) { if (tmp == this) { break; } if (tmp == null) { return false; } tmp = tmp.getParent(); } terminal = terminal.getTokenNodeSuccessor(); } return true; }