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; }
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; }