Package edu.stanford.nlp.trees

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


    @Override
    public Tree evaluate(Tree tree, TregexMatcher tregex) {
      Tree nodeToInsert = childMatcher[0].evaluate(tree, tregex);
      Pair<Tree,Integer> position = locationMatcher.evaluate(tree, tregex);
      position.first().insertDtr(needsCopy ? nodeToInsert.deepCopy() : nodeToInsert,
                                 position.second());
      return tree;
    }
  }
View Full Code Here


      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);
      }
      return tree;
    }
  }
}
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.