Package edu.stanford.nlp.trees

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


    production.setValue(label);
    production.set(TreeCoreAnnotations.HeadWordAnnotation.class, headLabel.get(TreeCoreAnnotations.HeadWordAnnotation.class));
    production.set(TreeCoreAnnotations.HeadTagAnnotation.class, headLabel.get(TreeCoreAnnotations.HeadTagAnnotation.class));
    Tree newTop = new LabeledScoredTreeNode(production);
    for (Tree child : children) {
      newTop.addChild(child);
    }
    return newTop;
  }

  /**
 
View Full Code Here


    CoreLabel production = new CoreLabel();
    production.setValue(label);
    production.set(TreeCoreAnnotations.HeadWordAnnotation.class, headLabel.get(TreeCoreAnnotations.HeadWordAnnotation.class));
    production.set(TreeCoreAnnotations.HeadTagAnnotation.class, headLabel.get(TreeCoreAnnotations.HeadTagAnnotation.class));
    Tree newTop = new LabeledScoredTreeNode(production);
    newTop.addChild(left);
    newTop.addChild(right);

    stack = stack.push(newTop);

    return new State(stack, state.transitions.push(this), state.separators, state.sentence, state.tokenPosition, state.score + scoreDelta, false);   
View Full Code Here

    production.setValue(label);
    production.set(TreeCoreAnnotations.HeadWordAnnotation.class, headLabel.get(TreeCoreAnnotations.HeadWordAnnotation.class));
    production.set(TreeCoreAnnotations.HeadTagAnnotation.class, headLabel.get(TreeCoreAnnotations.HeadTagAnnotation.class));
    Tree newTop = new LabeledScoredTreeNode(production);
    newTop.addChild(left);
    newTop.addChild(right);

    stack = stack.push(newTop);

    return new State(stack, state.transitions.push(this), state.separators, state.sentence, state.tokenPosition, state.score + scoreDelta, false);   
  }
View Full Code Here

      if(Tsurgeon.verbose)
        System.err.println("Parent: " + parent);
      int i = Trees.objectEqualityIndexOf(parent,topNode);
      parent.removeChild(i);
      for(Tree child : bottomNode.children()) {
        parent.addChild(i,child);
        i++;
      }
      if(Tsurgeon.verbose)
        tree.pennPrint(System.err);
      return tree;
View Full Code Here

    if(Tsurgeon.verbose)
      System.err.println("Parent: " + parent);
    int i = Trees.objectEqualityIndexOf(parent,topNode);
    parent.removeChild(i);
    for(Tree child : bottomNode.children()) {
      parent.addChild(i,child);
      i++;
    }
    if(Tsurgeon.verbose)
      t.pennPrint(System.err);
    return t;
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.