Examples of objectIndexOf()


Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

        private void initializeHelper(Stack<Tree> stack, Tree node, Tree root) {
          if (node==root) {
            return;
          }
          Tree parent = matcher.getParent(node);
          int i = parent.objectIndexOf(node);
          while (i == parent.children().length-1 && parent != root) {
            node = parent;
            parent = matcher.getParent(parent);
            i = parent.objectIndexOf(node);
          }
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

          Tree parent = matcher.getParent(node);
          int i = parent.objectIndexOf(node);
          while (i == parent.children().length-1 && parent != root) {
            node = parent;
            parent = matcher.getParent(parent);
            i = parent.objectIndexOf(node);
          }
          Tree followingNode;
          if (i+1 < parent.children().length) {
            followingNode = parent.children()[i+1];
          } else {
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

        private void initializeHelper(Stack<Tree> stack, Tree node, Tree root) {
          if (node==root) {
            return;
          }
          Tree parent = matcher.getParent(node);
          int i = parent.objectIndexOf(node);
          while (i == 0 && parent != root) {
            node = parent;
            parent = matcher.getParent(parent);
            i = parent.objectIndexOf(node);
          }
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

          Tree parent = matcher.getParent(node);
          int i = parent.objectIndexOf(node);
          while (i == 0 && parent != root) {
            node = parent;
            parent = matcher.getParent(parent);
            i = parent.objectIndexOf(node);
          }
          Tree precedingNode;
          if (i > 0) {
            precedingNode = parent.children()[i-1];
          } else {
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

      ft.foot.setChildren(targetNode.getChildrenAsList());
      // replace match with root of auxiliary tree
      if (parent==null) {
        return ft.tree;
      } else {
        int i = parent.objectIndexOf(targetNode);
        parent.setChild(i,ft.tree);
        return tree;
      }
    }
  }
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

    if (footNode != null) {
      Tree newFootNode = footNode.treeFactory().newTreeNode(footNode.label(), new ArrayList<Tree>());

      Tree parent = footNode.parent(t);
      if (parent != null) {
        int i = parent.objectIndexOf(footNode);
        parent.setChild(i, newFootNode);
      }

      result = newFootNode;
    }
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

      Tree parentOfFoot = ft.foot.parent(ft.tree);
      if (parentOfFoot == null) {
        System.err.println("Warning: adjoin to foot for depth-1 auxiliary tree has no effect.");
        return tree;
      }
      int i = parentOfFoot.objectIndexOf(ft.foot);
      if (parent==null) {
        parentOfFoot.setChild(i,targetNode);
        return ft.tree;
      } else {
        int j = parent.objectIndexOf(targetNode);
View Full Code Here

Examples of edu.stanford.nlp.trees.Tree.objectIndexOf()

          throw new TsurgeonRuntimeException("Attempted to replace a root node with more than one node, unable to proceed");
        }
        return childMatcher[1].evaluate(tree, tregex);
      }
      Tree parent = oldNode.parent(tree);
      int i = parent.objectIndexOf(oldNode);
      parent.removeChild(i);
      for (int j = 1; j < children.length; ++j) {
        Tree newNode = childMatcher[j].evaluate(tree, tregex);
        parent.insertDtr(newNode.deepCopy(), i + j - 1);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.