本文整理汇总了Java中edu.stanford.nlp.trees.TreeReader类的典型用法代码示例。如果您正苦于以下问题:Java TreeReader类的具体用法?Java TreeReader怎么用?Java TreeReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeReader类属于edu.stanford.nlp.trees包,在下文中一共展示了TreeReader类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: readTreeFromString
import edu.stanford.nlp.trees.TreeReader; //导入依赖的package包/类
/**
* Read tree from a string
*
* @param parseStr
* input tree in form a string
* @return tree
*/
public Tree readTreeFromString(String parseStr) {
// read in the input into a Tree data structure
TreeReader treeReader = new PennTreeReader(new StringReader(parseStr),
tree_factory);
Tree inputTree = null;
try {
inputTree = treeReader.readTree();
treeReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return inputTree;
}
开发者ID:sanjaymeena,项目名称:SyntacticParsing,代码行数:21,代码来源:ParserUtilities.java
示例2: getStanfordContituencyTree
import edu.stanford.nlp.trees.TreeReader; //导入依赖的package包/类
public Tree getStanfordContituencyTree() {
TreeFactory tf = new LabeledScoredTreeFactory();
StringReader r = new StringReader(getParseText());
TreeReader tr = new PennTreeReader(r, tf);
try {
return tr.readTree();
} catch (IOException e) {
throw new RuntimeException("Error: IOException should not be thrown by StringReader");
}
}
开发者ID:mgormley,项目名称:agiga,代码行数:11,代码来源:StanfordAgigaSentence.java
示例3: newTreeReader
import edu.stanford.nlp.trees.TreeReader; //导入依赖的package包/类
public TreeReader newTreeReader(Reader in) {
final NegraPennTreeNormalizer tn = new NegraPennTreeNormalizer(tlp, nodeCleanup);
if (treeNormalizerInsertNPinPP) {
tn.setInsertNPinPP(true);
}
return new PennTreeReader(in, new LabeledScoredTreeFactory(new StringLabelFactory()), tn, new NegraPennTokenizer(in));
}
开发者ID:FabianFriedrich,项目名称:Text2Process,代码行数:9,代码来源:NegraPennTreeReaderFactory.java
示例4: newTreeReader
import edu.stanford.nlp.trees.TreeReader; //导入依赖的package包/类
public TreeReader newTreeReader(Reader in) {
final NegraPennTreeNormalizer tn = new NegraPennTreeNormalizer(tlp, nodeCleanup);
if (treeNormalizerInsertNPinPP)
tn.setInsertNPinPP(true);
return new PennTreeReader(in, new LabeledScoredTreeFactory(), tn, new NegraPennTokenizer(in));
}
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:8,代码来源:NegraPennTreeReaderFactory.java
示例5: newTreeReader
import edu.stanford.nlp.trees.TreeReader; //导入依赖的package包/类
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in, new LabeledScoredTreeFactory());
}
开发者ID:zhangcongle,项目名称:NewsSpikeRe,代码行数:4,代码来源:Preprocessing.java
示例6: newTreeReader
import edu.stanford.nlp.trees.TreeReader; //导入依赖的package包/类
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in, new LabeledScoredTreeFactory(), new HebrewTreeNormalizer(),new PennTreebankTokenizer(in));
}
开发者ID:benblamey,项目名称:stanford-nlp,代码行数:4,代码来源:HebrewTreeReaderFactory.java
注:本文中的edu.stanford.nlp.trees.TreeReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论