if ( !relation.equals(StanfordDepedencyRelationType.prep) || !SimplerPosTagConvertor.simplerPos(ExtendedInfoGetFields.getCanonicalPartOfSpeech(node.getInfo())).equals(SimplerCanonicalPosTag.PREPOSITION) || !node.hasChildren()) if (ComplementRelations.PREP_RELATIONS.contains(relationToChild) || ExtendedInfoGetFields.getPredicateSignatureObj(child.getInfo()) != null) ret = child; else if (relationToChild.equals(StanfordDepedencyRelationType.prep))
if (StanfordDepedencyRelationType.nsubj.equals(relation)) if (EXPLATIVE.equalsIgnoreCase(ExtendedInfoGetFields.getLemma(siblingInfo)) && ExtendedInfoGetFields.getPartOfSpeechObject(siblingInfo).getStringRepresentation().equals(PennPosTag.EX.name()) && ExtendedInfoGetFields.getRelation(siblingInfo).equals(StanfordDepedencyRelationType.expl.name())) isExplative = true;
/** * get the relation from this node to its parent * @param node * @return * @throws AnnotatorException */ public static StanfordDepedencyRelationType getRelation(ExtendedConstructionNode node) throws AnnotatorException { StanfordDepedencyRelationType relation; try { relation = StanfordDepedencyRelationType.valueOf(ExtendedInfoGetFields.getRelation(node.getInfo())); } catch (Exception e) { throw new AnnotatorException("Bug. This node has a dependancy relation that isn't a StanfordDepedencyRelationType: " + node); } if (relation == null) throw new AnnotatorException("Bug. This node has no dependancy relation: " + node); return relation; }
/** * Ctor * @throws EntailmentCompilationException */ private DefaultEntailmentRuleCompileServices() throws EntailmentCompilationException { try { PERIOD_NODE = new BasicNode(new DefaultInfo("", new DefaultNodeInfo(PERIOD, PERIOD, -1, null, new DefaultSyntacticInfo(new BySimplerCanonicalPartOfSpeech(SimplerCanonicalPosTag.PUNCTUATION))), new DefaultEdgeInfo(new DependencyRelation(StanfordDepedencyRelationType.punct.name(), null)))); } catch (UnsupportedPosTagStringException e) { throw new EntailmentCompilationException("Internal bug! could not instantiate a new UnspecifiedPartOfSpeech(SimplerCanonicalPosTag.PUNCTUATION)", e); } }