Examples of newLabel()


Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

            }
            // Note: this next bit changes the tree label, rather
            // than creating a new tree node.  Beware!
            if (ht.isPreTerminal() || ht.value().startsWith("NP")) {
              LabelFactory lf = ht.labelFactory();
              ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
            }
            oldT = ht;
          } while (oldT.value().startsWith("NP"));
        }
      } else if (temporalAnnotation == TEMPORAL_9) {
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

          } while (!ht.isPreTerminal());
          if ( ! onlyTagAnnotateNstar || ht.label().value().startsWith("N")) {
            LabelFactory lf = ht.label().labelFactory();
            // Note: this changes the tree label, rather than
            // creating a new tree node.  Beware!
            ht.setLabel(lf.newLabel(ht.label().value() + "-TMP"));
          }
        }
      }
      if (doAdverbialNP) {
        String lab = t.value();
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

            }
            if (ht.isPreTerminal() || ht.value().startsWith("NP")) {
              LabelFactory lf = ht.labelFactory();
              // Note: this changes the tree label, rather than
              // creating a new tree node.  Beware!
              ht.setLabel(lf.newLabel(ht.label().value() + "-ADV"));
              oldT = ht;
            }
          } while (ht.value().startsWith("NP"));
        }
      }
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

        ht.value().startsWith("PP") || ht.value().startsWith("ADVP")) {
      if (!TmpPattern.matcher(ht.value()).matches()) {
        LabelFactory lf = ht.labelFactory();
        // System.err.println("TMP: Changing " + ht.value() + " to " +
        //                   ht.value() + "-TMP");
        ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
      }
      if (ht.value().startsWith("NP") || ht.value().startsWith("PP") ||
          ht.value().startsWith("ADVP")) {
        addTMP9(ht);
      }
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

        // System.err.println("TMP: Changing " + ht.value() + " to " +
        //                   ht.value() + "-TMP");
        lf = ht.labelFactory();
        // Note: this next bit changes the tree label, rather
        // than creating a new tree node.  Beware!
        ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
      } else if (ht.value().startsWith("NP")) {
        // don't add -TMP twice!
        if (!TmpPattern.matcher(ht.value()).matches()) {
          lf = ht.labelFactory();
          // System.err.println("TMP: Changing " + ht.value() + " to " +
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

          lf = ht.labelFactory();
          // System.err.println("TMP: Changing " + ht.value() + " to " +
          //                   ht.value() + "-TMP");
          // Note: this next bit changes the tree label, rather
          // than creating a new tree node.  Beware!
          ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
        }
        addTMP9(ht);
      }
    }
  }
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

    if (ccIndex == 1 && (beforeSibling.equals("DT") || beforeSibling.equals("JJ") || beforeSibling.equals("RB") || ! (ccSiblings[ccIndex + 1].value().equals("DT"))) && ! (beforeSibling.startsWith("NP")
            || beforeSibling.equals("ADJP")
            || beforeSibling.equals("NNS"))) { // && (ccSiblings.length == ccIndex + 3 || !ccPositions.isEmpty())) {  // something like "soya or maize oil"
      String leftHead = getHeadTag(ccSiblings[ccIndex - 1]);
      //create a new tree to be inserted as first child of t
      Tree left = tf.newTreeNode(lf.newLabel(leftHead), null);
      for (int i = 0; i < ccIndex + 2; i++) {
        left.addChild(ccSiblings[i]);
      }
      if (VERBOSE) {
        System.out.println("print left tree");
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

        }
        if (VERBOSE) {System.err.println("more CC index " +  index);}
        String head = getHeadTag(ccSiblings[index - 1]);

        if (ccIndex + 2 < index) {
          Tree tree = tf.newTreeNode(lf.newLabel(head), null);
          tree.addChild(0, left);

          int k = 1;
          for (int j = ccIndex+2; j<index; j++) {
            if (VERBOSE) ccSiblings[j].pennPrint();
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

          t.addChild(0, tree);
        } else {
          t.addChild(0, left);
        }

        Tree rightTree = tf.newTreeNode(lf.newLabel("NP"), null);
        int start = 2;
        if (comma) {
          start++;
        }
        while (start < t.numChildren()) {
View Full Code Here

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()

    }
    // DT a CC b c -> DT (a CC b) c
    else if (ccIndex == 2 && ccSiblings[0].value().startsWith("DT") && !ccSiblings[ccIndex - 1].value().equals("NNS") && (ccSiblings.length == 5 || (!ccPositions.isEmpty() && ccPositions.get(0) == 5))) {
      String head = getHeadTag(ccSiblings[ccIndex - 1]);
      //create a new tree to be inserted as second child of t (after the determiner
      Tree child = tf.newTreeNode(lf.newLabel(head), null);

      for (int i = 1; i < ccIndex + 2; i++) {
        child.addChild(ccSiblings[i]);
      }
      if (VERBOSE) { if (child.numChildren() == 0) { System.out.println("Youch! No child children"); } }
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.