Package edu.stanford.nlp.trees

Examples of edu.stanford.nlp.trees.LabeledScoredTreeFactory


  private static SemanticGraph makeGraph() {
    Tree tree;

    try {
      tree = new PennTreeReader(new StringReader("(S1 (S (S (S (NP (DT The) (NN CD14) (NN LPS) (NN receptor)) (VP (VBZ is) (, ,) (ADVP (RB however)) (, ,) (ADVP (RB up)) (VP (VBN regulated) (PRN (-LRB- -LRB-) (FRAG (RB not) (ADJP (RB down) (VBN regulated))) (-RRB- -RRB-)) (PP (IN in) (NP (JJ tolerant) (NNS cells)))))) (, ,) (CC and) (S (NP (NN LPS)) (VP (MD can) (, ,) (PP (IN in) (NP (NN fact))) (, ,) (ADVP (RB still)) (VP (VB lead) (PP (TO to) (NP (NP (NN activation)) (PP (IN of) (NP (JJ tolerant) (NNS cells))))) (SBAR (IN as) (S (VP (VBN evidenced) (PP (IN by) (NP (NP (NN mobilization)) (PP (IN of) (NP (DT the) (NN transcription) (NN factor) (NP (NP (JJ nuclear) (NN factor) (NN kappa) (NN B)) (PRN (-LRB- -LRB-) (NP (NN NF-kappa) (NN B)) (-RRB- -RRB-)))))))))))))) (. .)))"),
                                new LabeledScoredTreeFactory()).readTree();
    } catch (IOException e) {
      // the tree should parse correctly
      throw new RuntimeException(e);
    }
View Full Code Here


    this(forceCNF, CoreLabel.factory());
  }

  public Debinarizer(boolean forceCNF, LabelFactory lf) {
    this.forceCNF = forceCNF;
    tf = new LabeledScoredTreeFactory(lf);
    boundaryRemover = new BoundaryRemover();
  }
View Full Code Here

   * leaf out of which the treeFactory is vended.
   */
  @Override
  public TreeFactory treeFactory() {
    return new TreeFactory() {
      TreeFactory lstf = new LabeledScoredTreeFactory();

      public Tree newLeaf(Label l) {
        return new EmptyTreeLeaf<EmptyType>(l, emptyType(), traceTo());
      }

      public Tree newLeaf(String str) {
        return new EmptyTreeLeaf<EmptyType>(new StringLabel(str), emptyType(), traceTo());
      }

      public Tree newTreeNode(Label l, List<Tree> kids) {
        return lstf.newTreeNode(l, kids);
      }

      public Tree newTreeNode(String str, List<Tree> kids) {
        return lstf.newTreeNode(str, kids);
      }


    };
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.trees.LabeledScoredTreeFactory

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.