Collection<TypedDependency> tdl = gs.allTypedDependencies();
// TreeGraphNode tsn = gs.root();
for(TypedDependency i: tdl){
//reln表示节点的关系,dep表示依赖指向的节点
if(i.reln() == GrammaticalRelation.ROOT){
LOG.info("输出root: " + i.dep().toString());
;
}
}
![](https://images2017.cnblogs.com/blog/833465/201801/833465-20180116181049928-802608951.png)