![JAR search and dependency download from the Maven repository](/logo.png)
edu.stanford.nlp.trees.SimpleTreeFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-parser Show documentation
Show all versions of stanford-parser Show documentation
Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.
The newest version!
package edu.stanford.nlp.trees;
import edu.stanford.nlp.ling.Label;
import java.util.List;
/**
* A {@code SimpleTreeFactory} acts as a factory for creating objects
* of class {@code SimpleTree}.
*
* NB: A SimpleTree stores tree geometries but no node labels. Make sure
* this is what you really want.
*
* @author Christopher Manning
*/
public class SimpleTreeFactory implements TreeFactory {
/**
* Creates a new TreeFactory
. A
* SimpleTree
stores no Label
, so no
* LabelFactory
is built.
*/
public SimpleTreeFactory() {
}
@Override
public Tree newLeaf(final String word) {
return new SimpleTree();
}
@Override
public Tree newLeaf(final Label word) {
return new SimpleTree();
}
@Override
public Tree newTreeNode(final String parent, final List children) {
return new SimpleTree(null, children);
}
@Override
public Tree newTreeNode(final Label parentLabel, final List children) {
return new SimpleTree(parentLabel, children);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy