relation = node.getInfo().getEdgeInfo().getDependencyRelation().getStringRepresentation(); sbRelations.append(relation); sbPosRelations.append(">" + relation + ">" + pos);
relation = node.getInfo().getEdgeInfo().getDependencyRelation().getStringRepresentation(); sbRelations.append(relation); sbPosRelations.append(">" + relation + ">" + pos);
/** * for tracing. */ private static String outNode(BasicNode node) { String result = String.format("id=%s:ser=%d:%s:%s", node.getInfo().getId(), node.getInfo().getNodeInfo().getSerial(), node.getInfo().getNodeInfo().getWord(), node.getInfo().getEdgeInfo().getDependencyRelation()!=null?node.getInfo().getEdgeInfo().getDependencyRelation().getStringRepresentation():"null"); if (node.getAntecedent() != null) { result += String.format("(^%s)", outNode(node.getAntecedent())); } return result; }
String relationName = node.getInfo().getEdgeInfo().getDependencyRelation().getStringRepresentation(); String relationName = node.getInfo().getEdgeInfo().getDependencyRelation().getStringRepresentation(); processDependency(jcas, dependencyChildToken, dependencyParentNode, relationName, tokenAnnotations, sentenceAnno);
LemmaPosTextUnit parent = new LemmaPosTextUnit(parentNode.getInfo().getNodeInfo().getWordLemma(),parentNode.getInfo().getNodeInfo().getSyntacticInfo().getPartOfSpeech().getCanonicalPosTag()); Relation<String> rel = new DefaultRelation<String>(childNode.getInfo().getEdgeInfo().getDependencyRelation().getStringRepresentation()); textUnints.add(parent); textUnints.add(child);
@Override public Info supplementRightInfoWithLeftInfo(Info leftInfo, Info rightInfo) throws EntailmentCompilationException { if (leftInfo == null) throw new EntailmentCompilationException("got null left info"); if (rightInfo == null) throw new EntailmentCompilationException("got null right info"); Info alphaAnnotatedInfo = rightInfo; Info betaAnnotatedInfo = leftInfo; // choose args: alphaObj != null ? alphaObj : betaObj String lemma = (String) RuleBuildingUtils.chooseAlphaBeta(alphaAnnotatedInfo.getNodeInfo().getWordLemma(), betaAnnotatedInfo.getNodeInfo().getWordLemma()); EdgeInfo newEdgeAnnotatedInfo = new DefaultEdgeInfo( (DependencyRelation) RuleBuildingUtils.chooseAlphaBeta(alphaAnnotatedInfo.getEdgeInfo().getDependencyRelation(), betaAnnotatedInfo.getEdgeInfo().getDependencyRelation())); SyntacticInfo syntacticInfo = (SyntacticInfo) RuleBuildingUtils.chooseAlphaBeta(alphaAnnotatedInfo.getNodeInfo().getSyntacticInfo(), betaAnnotatedInfo.getNodeInfo().getSyntacticInfo()); // decide if to construct a NodeInfo or a VariableNodeAnnotatedInfo by the type of the betaNode? NodeInfo newAnnotatedNodeInfo; if (betaAnnotatedInfo.getNodeInfo().isVariable()) // copied variable nodes get the word and lemma of their lhs originals newAnnotatedNodeInfo = DefaultNodeInfo.newVariableDefaultNodeInfo (betaAnnotatedInfo.getNodeInfo().getVariableId(), null, -1, null, syntacticInfo); else { String word = (String) RuleBuildingUtils.chooseAlphaBeta(alphaAnnotatedInfo.getNodeInfo().getWord(), betaAnnotatedInfo.getNodeInfo().getWord()); newAnnotatedNodeInfo = new DefaultNodeInfo(word, lemma, -1, null, syntacticInfo); } Info newAnnotatedInfo = new DefaultInfo(betaAnnotatedInfo.getId(), newAnnotatedNodeInfo, newEdgeAnnotatedInfo); return newAnnotatedInfo; }
DependencyRelation relation = rightInfo.getEdgeInfo().getDependencyRelation(); String word = InfoGetFields.getWord(rightInfo); break; case COPY_REL: relation = leftInfo.getEdgeInfo().getDependencyRelation(); break; case DEL_LY_FROM_LEMMA: