/** * POS tag this term, and return a determiner, or "to", according to the POS tag * @param term * @param gloss * @return * @throws JwktlException */ private String determineFirstWord(String term, String gloss) throws JwktlException { String prefixWord = ""; { // if the last word is a noun-singular. it's a noun phrase, and needs an 'a' // must pos tag the term even though wiki already has, cos the wiki POS don't tell us if the noun is singular List<PosTaggedToken> tags = posTag(term); // note that term may have several words. if (tags.get(tags.size()-1).getPartOfSpeech().getStringRepresentation().equals(PennPosTag.NN.name())) prefixWord = "a"; } return prefixWord; }
/** * @param partOfSpeech * @return */ private boolean isUnspecifiedPos(PartOfSpeech partOfSpeech) { return simplerPos(partOfSpeech.getCanonicalPosTag()).toString().equals(partOfSpeech.getStringRepresentation()); }
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());
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);
pos = node.getInfo().getNodeInfo().getSyntacticInfo().getPartOfSpeech().getStringRepresentation(); sbPos.append(pos); sbWords.append(word);
(!( (UtilClass.isANoun(firstpos)) || (firstpos.getCanonicalPosTag().equals(CanonicalPosTag.ADJ)) || (firstpos.getStringRepresentation().equals("N")) )))
(!( (UtilClass.isANoun(firstpos)) || (firstpos.getCanonicalPosTag().equals(CanonicalPosTag.ADJ)) || (firstpos.getStringRepresentation().equals("CD")) )))
pos = node.getInfo().getNodeInfo().getSyntacticInfo().getPartOfSpeech().getStringRepresentation();
String pos=processResults.get(k).getPosTag().getStringRepresentation(); sbWords.append(lemma); sbPos.append(pos);
ExtendedInfoGetFields.getPartOfSpeechObject(siblingInfo).getStringRepresentation().equals(PennPosTag.EX.name()) && ExtendedInfoGetFields.getRelation(siblingInfo).equals(StanfordDepedencyRelationType.expl.name())) isExplative = true;
else if (currentPOS.getStringRepresentation().equals("N")) //it's a number
else if (currentPOS.getStringRepresentation().equals("CD")) //it's a number
@Override public boolean evaluate(T object) { PartOfSpeech pos = InfoGetFields.getPartOfSpeechObject(object); return ( simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.ADJECTIVE || simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.ADVERB || simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.NOUN || simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.PRONOUN || "VBN".equals(pos.getStringRepresentation()) // a passive noun is also considered an adjective! ); } }
for (PosTaggedToken taggedToken : taggedTokens) { Token tokenAnno = tokenIter.next(); String tagString = taggedToken.getPartOfSpeech().getStringRepresentation();