Search in sources :

Example 1 with NPTmpRetainingTreeNormalizer

use of edu.stanford.nlp.trees.NPTmpRetainingTreeNormalizer in project CoreNLP by stanfordnlp.

the class UniversalDependenciesFeatureAnnotator method treebankIterator.

private static Iterator<Tree> treebankIterator(String path) {
    /* Remove empty nodes and strip indices from internal nodes but keep
       functional tags. */
    Treebank tb = new MemoryTreebank(new NPTmpRetainingTreeNormalizer(0, false, 1, false));
    tb.loadPath(path);
    return tb.iterator();
}
Also used : Treebank(edu.stanford.nlp.trees.Treebank) MemoryTreebank(edu.stanford.nlp.trees.MemoryTreebank) MemoryTreebank(edu.stanford.nlp.trees.MemoryTreebank) NPTmpRetainingTreeNormalizer(edu.stanford.nlp.trees.NPTmpRetainingTreeNormalizer)

Aggregations

MemoryTreebank (edu.stanford.nlp.trees.MemoryTreebank)1 NPTmpRetainingTreeNormalizer (edu.stanford.nlp.trees.NPTmpRetainingTreeNormalizer)1 Treebank (edu.stanford.nlp.trees.Treebank)1