Package edu.stanford.nlp.ling

Examples of edu.stanford.nlp.ling.StringLabel


    this.label = label;
  }

  @Override
  public void setFromString(String labelStr) {
    this.label = new StringLabel(labelStr);
  }
View Full Code Here


     *
     * @param labelStr A string.
     * @return The created label
     */
    public Label newLabel(final String labelStr) {
      return new LabeledConstituent(0, 0, new StringLabel(labelStr));
    }
View Full Code Here

          if (numNullLabel == 0) {
            nullLabelEg = subtree;
          }
          numNullLabel++;
          if (lab == null) {
            subtree.setLabel(new StringLabel(""));
          } else if (lab.value() == null) {
            subtree.label().setValue("");
          }
        }
        if (subtree.isLeaf()) {
View Full Code Here

    public Tree helper(Tree t) {
      if (t == null) {
        return null;
      }
      if (t.isLeaf()) {
        return tf.newLeaf(new StringLabel(t.label().value()));
      }
      if (t.isPreTerminal()) {
        return tf.newTreeNode(new StringLabel(t.label().value()), Collections.singletonList(helper(t.children()[0])));
      }
      int numKids = t.numChildren();
      List<Tree> children = new ArrayList<Tree>(numKids);
      for (int k = 0; k < numKids; k++) {
        children.add(helper(t.children()[k]));
      }
      return tf.newTreeNode(new StringLabel(t.label().value()), children);
    }
View Full Code Here

    }
  }


  public UnnamedDependency(String regent, String dependent) {
    this(new StringLabel(regent), new StringLabel(dependent));
  }
View Full Code Here

    }
  }


  public NamedDependency(String regent, String dependent, Object name) {
    this(new StringLabel(regent), new StringLabel(dependent), name);
  }
View Full Code Here

  private Tree transformQP(Tree t) {

    List<Tree> children = t.getChildrenAsList();

    //create the new XS having the first two children of the QP
    Tree left = new LabeledScoredTreeNode(new StringLabel("XS"), null);
    for (int i = 0; i < 2; i++) {
      left.addChild(children.get(i));
    }

    // remove all the two first children of t before
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.ling.StringLabel

Copyright © 2018 www.massapicom. 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.