private static boolean isContentVerb(Info info) { boolean ret = false; if (isVerb(info)) { String lemma = InfoGetFields.getLemma(info); if (!StringUtil.setContainsIgnoreCase(NON_CONTENT_VERBS, lemma)) ret = true; } return ret; }
public Map<Integer,Double> forSubstitutionMultiWord(Map<Integer,Double> originalFeatureVector, SubstituteNodeSpecificationMultiWord spec) throws TeEngineMlException { Map<Integer,Double> featureVector = new LinkedHashMap<Integer, Double>(); featureVector.putAll(originalFeatureVector); spec.addDescription("Multi-Word"); Set<String> addedHypothesisWord = new LinkedHashSet<String>(); for (String hypothesisWord : spec.getHypothesisWords()) { if (!StringUtil.setContainsIgnoreCase(spec.getTextWords(), hypothesisWord)) { addedHypothesisWord.add(hypothesisWord); } } return updateFeatureVectorForSubstitutionMultiWord(featureVector,spec,spec.getNewNodeInfo().getNamedEntityAnnotation()!=null,addedHypothesisWord); }
public static boolean infoIsContentVerb(Info info) { boolean ret = false; if (infoHasLemma(info)) { PartOfSpeech posObject = InfoGetFields.getPartOfSpeechObject(info); if (simplerPos(posObject.getCanonicalPosTag())==SimplerCanonicalPosTag.VERB) { String lemma = InfoGetFields.getLemma(info); if (!StringUtil.setContainsIgnoreCase(NON_CONTENT_VERBS, lemma)) { if (!StringUtil.setContainsIgnoreCase(NON_CONTENT_VERBS_VERBS_ONLY, lemma)) { ret = true; } } } } return ret; }
protected boolean isRelevantRule(T rule) throws RuleBaseException { boolean ret = false; try { if (super.isRelevantRule(rule)) { if (StringUtil.setContainsIgnoreCase(hypothesisLemmasOnly, rule.getRhsLemma())) // if it is in the hypothesis { CanonicalLemmaAndPos original = new CanonicalLemmaAndPos(rule.getLhsLemma(), rule.getLhsPos()); // old if (!DsUtils.containsCanonical(hypothesisLemmasAndPoses, original)) // (old) if (!hypothesisLemmasAndPoses.contains(original)) // if the left hand side is not in the hypothesis if (!hypothesisLemmasAndPoses.contains(original)) { ret = true; } } } } catch(TeEngineMlException e) { throw new RuleBaseException("Problem with the given lemma and part-of-speech",e); } return ret; }
if (StringUtil.setContainsIgnoreCase(pairLemmas, lemmaToInsert))
if (StringUtil.setContainsIgnoreCase(mapHypothesisNodesToLemmas.get(hypothesisNode), textNodeLemma))