private boolean isCoordinatingConjuction(Token token, String language) { Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); return posAnnotation == null ? false : posAnnotation.value().getPosHierarchy().contains(Pos.CoordinatingConjunction); }
if(!adjectivesOnly){ process = true; Value<PosTag> posTag = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); if(posTag != null && posTag.probability() == Value.UNKNOWN_PROBABILITY || posTag.probability() >= (minPOSConfidence/2.0)){
Value<PosTag> posAnnotation = token.getAnnotation(POS_ANNOTATION); if(posAnnotation != null) { selectedPosTag = posAnnotation.value();
private boolean isSectionBorder(Token token, String language) { Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); if(posAnnotation != null && !Collections.disjoint(sectionBorderPosTags, posAnnotation.value().getPosHierarchy())){ return true; } else { return false; } }
Value<PosTag> posAnnotation = token.getAnnotation(POS_ANNOTATION); if(posAnnotation != null) { selectedPosTag = posAnnotation.value();
private boolean isPronoun(Token token, String language) { Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); return posAnnotation == null ? false : posAnnotation.value().getPosHierarchy().contains(Pos.Pronoun); }
/** * Checks if the parsed {@link Token} represents an negation * @param token the word * @param language the language * @return <code>true</code> if the {@link Token} represents a negation. * Otherwise <code>false</code> */ private boolean isNegation(Token token, String language) { Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); if(posAnnotation != null && !Collections.disjoint(negativePosTags, posAnnotation.value().getPosHierarchy())){ return true; } else { return false; } }
/** * If the current Token should be considered for counting distances to * negations and nouns * @param token * @param language * @return */ private boolean isCountable(Token token, String language){ Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); if(posAnnotation != null && !Collections.disjoint(countableLexCats, posAnnotation.value().getCategories())){ return true; } else { return false; } }
private boolean isVerb(Token token, String language) { Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); return posAnnotation == null ? false : posAnnotation.value().hasCategory(LexicalCategory.Verb); }
/** * Checks if the parsed {@link Token} represents an negation * @param token the word * @param index the index of the token relative to the sentence | section * @param language the language * @return <code>true</code> if the {@link Token} represents a negation. * Otherwise <code>false</code> */ private boolean isNoun(Token token, boolean firstTokenInSentence, String language) { String word = token.getSpan(); if(!firstTokenInSentence && !word.isEmpty() && Character.isUpperCase(word.charAt(0))){ return true; //assume all upper case tokens are Nouns } Value<PosTag> posAnnotation = token.getAnnotation(NlpAnnotations.POS_ANNOTATION); if(posAnnotation != null && (posAnnotation.value().hasCategory(LexicalCategory.Noun) || posAnnotation.value().getPosHierarchy().contains(Pos.CardinalNumber))){ return true; } return false; } /**
tokenList.add(token); tokenTextList.add(token.getSpan()); Value<PosTag> posValue = token.getAnnotation(POS_ANNOTATION); if(posValue == null){ throw new EngineException("Missing POS value for Token '"
Value<PosTag> pos = word.getAnnotation(NlpAnnotations.POS_ANNOTATION); log.debug(" [{}] '{}' pos: {}, sentiment {}", new Object[]{ addToList ? sentimentTokens.size() : "-",