Token china = sentence.addToken(chinaStartIdx, chinaStartIdx + "China".length());
GrammaticalRelationTag nSubjGrammRelTag = new GrammaticalRelationTag(
"nsubj", GrammaticalRelation.NominalSubject);
obama.addAnnotation(NlpAnnotations.DEPENDENCY_ANNOTATION,
Value.value(new DependencyRelation(nSubjGrammRelTag, true, visited)));
GrammaticalRelationTag rootGrammRelTag = new GrammaticalRelationTag(
"root", GrammaticalRelation.Root);
GrammaticalRelationTag dobjGrammRelTag = new GrammaticalRelationTag(
"dobj", GrammaticalRelation.DirectObject);
visited.addAnnotation(NlpAnnotations.DEPENDENCY_ANNOTATION,
Value.value(new DependencyRelation(rootGrammRelTag, true, null)));
visited.addAnnotation(NlpAnnotations.DEPENDENCY_ANNOTATION,
Value.value(new DependencyRelation(nSubjGrammRelTag, false, obama)));
visited.addAnnotation(NlpAnnotations.DEPENDENCY_ANNOTATION,
Value.value(new DependencyRelation(dobjGrammRelTag, false, china)));
china.addAnnotation(NlpAnnotations.DEPENDENCY_ANNOTATION,
Value.value(new DependencyRelation(dobjGrammRelTag, true, visited)));
}