Tree tree = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);
TreebankLanguagePack tlp = new PennTreebankLanguagePack();
GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
GrammaticalStructure gs = gsf.newGrammaticalStructure(tree);
Collection<TypedDependency> td = gs.typedDependenciesCollapsedTree();
System.out.println(td);
Object[] list = td.toArray();
TypedDependency typedDependency;
for (Object object : list)
{
typedDependency = (TypedDependency) object;
System.out.println(typedDependency.reln()+ " \t "+typedDependency.dep().word()+ " \t "+typedDependency.gov().word()+ " \n ");
}
这是代码。正确生成类型化的依赖项。有没有办法以引理形式打印那些类型化的依赖对象?