Examples of CategoryWordTag


Examples of edu.stanford.nlp.ling.CategoryWordTag

    public Tree helper(Tree t) {
      if (t == null) {
        return null;
      } else if (t.isLeaf()) {
        return tf.newLeaf(new CategoryWordTag(t.label().value()));
      } else if (t.isPreTerminal()) {
        return tf.newTreeNode(new CategoryWordTag(t.label().value()), Collections.singletonList(helper(t.children()[0])));
      } else {
        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 CategoryWordTag(t.label().value()), 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.