/** * @param info an edge information (including dependency type) * @return a DIRT-like dependency path component for the given parse tree edge. * The component is made of the relation, for example: ">pobj>" or "<prep<". */ protected static String toDependencyPathComponent(EdgeInfo info, Direction arrowDirection) { String relation = InfoGetFields.getRelation(info); if (arrowDirection==Direction.RIGHT_TO_LEFT) return "<"+relation+"<"; else return ">"+relation+">"; } }
public boolean edgesMatch(ExtendedInfo mainInfo, ExtendedInfo testInfo) { if (InfoGetFields.getRelation(testInfo).equals(ExtendedMatchCriteria.WILDCARD_RELATION)) return true; // wildcard in the rule! return defaultMatchCriteria.edgesMatch(mainInfo, testInfo); }
public static boolean edgesEqual(ExtendedNode textNode, ExtendedNode hypothesisNode) { String textRelation = InfoGetFields.getRelation(textNode.getInfo()); String hypothesisRelation = InfoGetFields.getRelation(hypothesisNode.getInfo()); return textRelation.equals(hypothesisRelation); }
@Override public boolean edgesAligned( TreeAndParentMap<ExtendedInfo, ExtendedNode> textTree, TreeAndParentMap<ExtendedInfo, ExtendedNode> hypothesisTree, ExtendedNode textEdge, ExtendedNode hypothesisEdge) { return InfoGetFields.getRelation(textEdge.getInfo()).equalsIgnoreCase( InfoGetFields.getRelation(hypothesisEdge.getInfo()) ); }
public boolean edgesMatch(ExtendedInfo mainInfo, ExtendedInfo testInfo) { if (InfoGetFields.getRelation(testInfo).equals(ExtendedMatchCriteria.WILDCARD_RELATION)) return true; // wildcard in the rule! return defaultMatchCriteria.edgesMatch(mainInfo, testInfo); }
public boolean edgesMatch(ExtendedInfo mainInfo, ExtendedInfo testInfo) { if (InfoGetFields.getRelation(testInfo).equals(ExtendedMatchCriteria.WILDCARD_RELATION)) return true; // wildcard in the rule! return defaultMatchCriteria.edgesMatch(mainInfo, testInfo); }
@Override public boolean edgesMatch(TM mainInfo, TT testInfo) { if (InfoGetFields.getRelation(testInfo).equals(WILDCARD_RELATION)) return true; // wildcard in the rule! return defaultMatchCriteria.edgesMatch(mainInfo, testInfo); }
public String getEdgeStringRepresentation() { return InfoGetFields.getRelation(node.getInfo()); }
public String getEdgeStringRepresentation() { return InfoGetFields.getRelation(node.getInfo()); }
public String getEdgeStringRepresentation() { return InfoGetFields.getRelation(node.getInfo()); }
public String getEdgeStringRepresentation() { return InfoGetFields.getRelation(node.getInfo()); }
private String relationToPrint(S node) { String relation = InfoGetFields.getRelation(node.getInfo()); if (relation.equalsIgnoreCase("conj")) { S parent = parentMap.get(node); if (parentMap.get(parent)!=null) { relation = InfoGetFields.getRelation(parent.getInfo()); } } return relation; }
private boolean filterConjEndpoint(S begin, S end, S common) { boolean ret = false; List<S> endpoints = new ArrayList<>(1+1); if (begin!=common) {endpoints.add(begin);} if (end != common) {endpoints.add(end);} for (S endpoint : endpoints) { String relation = InfoGetFields.getRelation(endpoint.getInfo()); if ("conj".equalsIgnoreCase(relation)) { ret = true; break; } } return ret; }
public static boolean introduceOnlySurfaceRelation(MoveNodeSpecification spec, PARSER parser) { if (parser.equals(PARSER.MINIPAR)) { if (InfoGetFields.getRelation(spec.getNewEdgeInfo()).equalsIgnoreCase("s")) return true; } return false; }
@Override public String toString() { return "ExtendedInfo [nodeInfo=" + InfoGetFields.getLemma(nodeInfo) + "/" + InfoGetFields.getPartOfSpeech(nodeInfo) + ", edgeInfo=" + InfoGetFields.getRelation(edgeInfo) + ", id=" + id + ", additionalNodeInformation=" + additionalNodeInformation + "]"; }
public static boolean moveChangeRelationStrong(MoveNodeSpecification spec, PathInTree path, TreeAndParentMap<ExtendedInfo,ExtendedNode> tree, PARSER parser) throws TeEngineMlException { boolean ret = false; if (pathOnlyChangeRelation(path, tree)) { String originalRelation = InfoGetFields.getRelation(spec.getTextNodeToMove().getInfo()); String destinationRelation = InfoGetFields.getRelation(spec.getNewEdgeInfo()); ret = relationStrongChange(originalRelation,destinationRelation,parser); } return ret; }
private boolean hasCopula(S node) { if (node.hasChildren()) { for (S child : node.getChildren()) { String relation = InfoGetFields.getRelation(child.getInfo()); if (COPULA_RELATION.equals(relation)) { return true; } } } return false; }
@Override public String toShortString() { StringBuffer sb = new StringBuffer(); sb.append("Insert "); sb.append(NodePrintUtilities.nodeDetailsToString( hypothesisNodeToInsert.getInfo().getId(), InfoGetFields.getLemma(hypothesisNodeToInsert.getInfo()), InfoGetFields.getPartOfSpeech(hypothesisNodeToInsert.getInfo()), InfoGetFields.getRelation(hypothesisNodeToInsert.getInfo()))); return sb.toString(); }
private Set<S> getPredicateInternalNodes(S node) { Set<S> ret = new LinkedHashSet<S>(); ret.add(node); if (node.hasChildren()) { for (S child : node.getChildren()) { String relation = InfoGetFields.getRelation(child.getInfo()); if (RelationTypes.getSemanticInternalFacetRelations().contains(relation)) { ret.addAll(getPredicateInternalNodes(child)); } } } return ret; }
private Set<S> findVerbPredicateHeads() { Set<S> verbPredicateHeads = new LinkedHashSet<S>(); for (S node : TreeIterator.iterableTree(tree.getTree())) { if (SimplerCanonicalPosTag.VERB.equals(SimplerPosTagConvertor.simplerPos(InfoGetFields.getCanonicalPartOfSpeech(node.getInfo())))) { String relation = InfoGetFields.getRelation(node.getInfo()); if (!RelationTypes.getSemanticAuxiliaryVerbRelations().contains(relation)) { verbPredicateHeads.add(node); } } } return verbPredicateHeads; }