Search in sources :

Example 6 with Options

use of edu.stanford.nlp.parser.lexparser.Options in project CoreNLP by stanfordnlp.

the class OracleTest method buildTestTreebank.

public List<Tree> buildTestTreebank() {
    MemoryTreebank treebank = new MemoryTreebank();
    for (String text : TEST_TREES) {
        Tree tree = Tree.valueOf(text);
        treebank.add(tree);
    }
    List<Tree> binarizedTrees = ShiftReduceParser.binarizeTreebank(treebank, new Options());
    return binarizedTrees;
}
Also used : Options(edu.stanford.nlp.parser.lexparser.Options) Tree(edu.stanford.nlp.trees.Tree) MemoryTreebank(edu.stanford.nlp.trees.MemoryTreebank)

Example 7 with Options

use of edu.stanford.nlp.parser.lexparser.Options in project CoreNLP by stanfordnlp.

the class ShiftReduceParserTest method convertTree.

Tree convertTree(String treeText) {
    Options op = new Options();
    HeadFinder binaryHeadFinder = new BinaryHeadFinder(op.tlpParams.headFinder());
    Tree tree = Tree.valueOf(treeText);
    Trees.convertToCoreLabels(tree);
    tree.percolateHeadAnnotations(binaryHeadFinder);
    return tree;
}
Also used : BinaryHeadFinder(edu.stanford.nlp.parser.lexparser.BinaryHeadFinder) Options(edu.stanford.nlp.parser.lexparser.Options) BinaryHeadFinder(edu.stanford.nlp.parser.lexparser.BinaryHeadFinder) HeadFinder(edu.stanford.nlp.trees.HeadFinder) Tree(edu.stanford.nlp.trees.Tree)

Aggregations

Options (edu.stanford.nlp.parser.lexparser.Options)7 Tree (edu.stanford.nlp.trees.Tree)3 LexicalizedParser (edu.stanford.nlp.parser.lexparser.LexicalizedParser)2 Treebank (edu.stanford.nlp.trees.Treebank)2 ArrayList (java.util.ArrayList)2 Language (edu.stanford.nlp.international.Language)1 NumberRangesFileFilter (edu.stanford.nlp.io.NumberRangesFileFilter)1 Label (edu.stanford.nlp.ling.Label)1 BinaryHeadFinder (edu.stanford.nlp.parser.lexparser.BinaryHeadFinder)1 ChineseTreebankParserParams (edu.stanford.nlp.parser.lexparser.ChineseTreebankParserParams)1 EnglishTreebankParserParams (edu.stanford.nlp.parser.lexparser.EnglishTreebankParserParams)1 EvaluateTreebank (edu.stanford.nlp.parser.lexparser.EvaluateTreebank)1 Lexicon (edu.stanford.nlp.parser.lexparser.Lexicon)1 Reranker (edu.stanford.nlp.parser.lexparser.Reranker)1 TreebankLangParserParams (edu.stanford.nlp.parser.lexparser.TreebankLangParserParams)1 ClassicCounter (edu.stanford.nlp.stats.ClassicCounter)1 EquivalenceClassEval (edu.stanford.nlp.stats.EquivalenceClassEval)1 DiskTreebank (edu.stanford.nlp.trees.DiskTreebank)1 HeadFinder (edu.stanford.nlp.trees.HeadFinder)1 MemoryTreebank (edu.stanford.nlp.trees.MemoryTreebank)1