lemma = UNDERSCORE; PartOfSpeech pos = InfoGetFields.getPartOfSpeechObject(info); String canonicalPos = WildcardPartOfSpeech.isWildCardPOS(pos) ? pos.getStringRepresentation() : pos != null ? simplerPos(pos.getCanonicalPosTag()).name() : UNDERSCORE; int antecedentId = mapNodeToId.get(node.getAntecedent());
/** * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { return (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech) || simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag()) ); }
lemma = UNDERSCORE; PartOfSpeech pos = ExtendedInfoGetFields.getPartOfSpeechObject(info); String canonicalPos = WildcardPartOfSpeech.isWildCardPOS(pos) ? pos.getStringRepresentation() : pos != null ? simplerPos(pos.getCanonicalPosTag()).name() : UNDERSCORE; int antecedentId = mapNodeToId.get(antecedent);
/** * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { return (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech) || simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag()) ); }
/** * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { return (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech) || simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag()) ); }
(node.getInfo()!=null) && (!(WildcardPartOfSpeech.isWildCardPOS(InfoGetFields.getPartOfSpeechObject(node.getInfo()))))
/** * Check for wildcard POS, then compare canonical POSs, then compare normal (Penn) POSs!<br> * This method differs from other <code>posMatch()</code> methods by comparing the regular POSs as well. * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { if (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech)) return true; if (textPartOfSpeech.equals(rulePartOfSpeech)) // this covers cases where the rule's and text's POSs are of the same subclass and match return true; // this covers all other cases where the rule uses a canonical POS (and the text may use any other POS type) if (isUnspecifiedPos(rulePartOfSpeech) && simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag())) return true; return false; }
/** * If rhsInfo has a POS (not {@link WildcardPartOfSpeech}), copy it to treeInfo. Return treeInfo * @param treeInfo * @param rhsInfo * @return */ public static NodeInfo combineNodeInfo(Info treeInfo, Info rhsInfo) { NodeInfo treeNodeInfo = treeInfo.getNodeInfo(); if (rhsInfo != null && rhsInfo.getNodeInfo() != null && rhsInfo.getNodeInfo().getSyntacticInfo() != null && rhsInfo.getNodeInfo().getSyntacticInfo().getPartOfSpeech() != null && !WildcardPartOfSpeech.isWildCardPOS(rhsInfo.getNodeInfo().getSyntacticInfo().getPartOfSpeech())) { // treeInfo with rhsInfo's syntactic info return new DefaultNodeInfo(treeNodeInfo.getWord(), treeNodeInfo.getWordLemma(), treeNodeInfo.getSerial(), treeNodeInfo.getNamedEntityAnnotation(), rhsInfo.getNodeInfo().getSyntacticInfo()); } else return treeNodeInfo; } }