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;
}
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;
}
Aggregations