-1
で強化された++依存認識私が直接nmodを探していることができます:とnmodから:のJavaコードで強化++の依存関係の?スタンフォードCoreNLP:Javaの
semanticGraph.getChildrenWithReln(rootToken, UniversalEnglishGrammaticalRelations.NOMINAL_MODIFIER);
getChildrenWithReln
方法の第2のパラメータはGrammaticalRelation
を必要とします。 Unfortunatelly、私はのようなものではなく、UniversalEnglishGrammaticalRelations.NOMINAL_MODIFIER
しか見つけません。
私の一時的な解決策:
public List<IndexedWord> getChildrenByRelation(IndexedWord root, String shortName, String specific) {
final List<SemanticGraphEdge> outputEdges = semanticGraphWrapper.get().getOutEdgesSorted(root);
final List<IndexedWord> tokens = new ArrayList<>();
GrammaticalRelation relation;
for (SemanticGraphEdge edge : outputEdges) {
relation = edge.getRelation();
if (relation.getShortName().equals(shortName) && relation.getSpecific().equals(specific))
tokens.add(edge.getTarget());
}
return tokens;
}