/** * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { return (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech) || simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag()) ); }
public static final boolean posEqual(PartOfSpeech textPos, PartOfSpeech hypothesisPos) { if (textPos==hypothesisPos)return true; SimplerCanonicalPosTag canonicalText = (null==textPos)?SimplerCanonicalPosTag.OTHER:simplerPos(textPos.getCanonicalPosTag()); SimplerCanonicalPosTag canonicalhypothesis = (null==hypothesisPos)?SimplerCanonicalPosTag.OTHER:simplerPos(hypothesisPos.getCanonicalPosTag()); if (canonicalText.equals(canonicalhypothesis)) return true; else return false; }
private String tableNameByPos(PartOfSpeech pos) { String ret = null; if (simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.VERB) ret = "verbs_200"; else if (simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.NOUN) ret = "nouns_200"; return ret; }
/** * @param partOfSpeech * @return */ private boolean isUnspecifiedPos(PartOfSpeech partOfSpeech) { return simplerPos(partOfSpeech.getCanonicalPosTag()).toString().equals(partOfSpeech.getStringRepresentation()); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((simplerPos(pos.getCanonicalPosTag()) == null) ? 0 : simplerPos(pos.getCanonicalPosTag()).hashCode()); result = prime * result + ((word == null) ? 0 : word.hashCode()); return result; }
public LexicalIDM(LexicalSentenceProcessor sentPoc) throws UnsupportedPosTagStringException { m_nounPOS = new ByCanonicalPartOfSpeech(CanonicalPosTag.N.name()); m_lexicalSentenceProcessor = sentPoc; }
public void setUnspecifiedPosTag(PartOfSpeech unspecifiedPosTag) throws UnsupportedPosTagStringException{ this.unspecifiedPosTag = new ByCanonicalPartOfSpeech(unspecifiedPosTag.getCanonicalPosTag().toString()); this.setPosTag(unspecifiedPosTag); }
public static boolean isANoun(PartOfSpeech pos) { if (pos != null && pos.getCanonicalPosTag().equals(CanonicalPosTag.N)) { return true; } return false; }
public String toString() { return lemma+"/"+ (pos!=null?pos.name():"null"); }
/** * @param canonicalPartOfSpeech the canonicalPartOfSpeech to set * @throws UnsupportedPosTagStringException */ private void setCanonicalPartOfSpeech(SimplerCanonicalPosTag canonicalPartOfSpeech) throws UnsupportedPosTagStringException { this.canonicalPartOfSpeech = canonicalPartOfSpeech; partOfSpeech = new BySimplerCanonicalPartOfSpeech(canonicalPartOfSpeech); }
/** * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { return (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech) || simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag()) ); }
protected static char toChar(PartOfSpeech pos) { switch (simplerPos(pos.getCanonicalPosTag())) { case NOUN: return 'n'; case VERB: return 'v'; case ADJECTIVE: return 'a'; //case ADVERB: return 'r'; case PREPOSITION: return 'p'; //case DETERMINER: return 'd'; case PRONOUN: return 'n'; // NOTE: in UNARY_BINC database, a pronoun is considered a 'n' - not 'p'! //case PUNCTUATION: return ','; default: return '0'; // no pos tag } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((lemma == null) ? 0 : lemma.hashCode()); result = prime * result + ((simplerPos(pos.getCanonicalPosTag()) == null) ? 0 : simplerPos(pos.getCanonicalPosTag()).hashCode()); return result; }
public void set(String word) throws LemmatizerException { this.word = word; try { this.partOfSpeech = new ByCanonicalPartOfSpeech(CanonicalPosTag.N.name()); } catch(Exception e) { throw new LemmatizerException("POS exception", e); } }
public WordAndPartOfSpeech(String word, PartOfSpeech pos) throws UnsupportedPosTagStringException { super(); this.word = word; this.pos = ((null==pos)?new BySimplerCanonicalPartOfSpeech(SimplerCanonicalPosTag.OTHER):pos); }
/** * @param partOfSpeechObject * @param partOfSpeechObject2 * @return */ private boolean posMatch(PartOfSpeech textPartOfSpeech, PartOfSpeech rulePartOfSpeech) { return (WildcardPartOfSpeech.isWildCardPOS(rulePartOfSpeech) || simplerPos(textPartOfSpeech.getCanonicalPosTag())==simplerPos(rulePartOfSpeech.getCanonicalPosTag()) ); }
@Override public boolean evaluate(T object) { PartOfSpeech pos = InfoGetFields.getPartOfSpeechObject(object); return ( simplerPos(pos.getCanonicalPosTag())==SimplerCanonicalPosTag.VERB ); } }
public WikipediaLexicalResource(Classifier classifier, int limitOnRetrievedRules, String driver, String url, String username, String password ) throws UnsupportedPosTagStringException { this.m_nounPOS = new eu.excitementproject.eop.common.representation.partofspeech.ByCanonicalPartOfSpeech(CanonicalPosTag.N.name()); this.m_classifier = classifier; this.m_limitOnRetrievedRules = limitOnRetrievedRules; this.m_retrivalTool = new RetrievalTool(driver, url, username, password); }
public RedisBasedWikipediaLexicalResource(Classifier classifier, int limitOnRetrievedRules, String leftRedisDBFile, String rightRedisDBFile, boolean bVM) throws UnsupportedPosTagStringException, FileNotFoundException, RedisRunException { leftRules = new RedisBasedStringListBasicMap(leftRedisDBFile, bVM); rightRules = new RedisBasedStringListBasicMap(rightRedisDBFile, bVM); this.m_nounPOS = new eu.excitementproject.eop.common.representation.partofspeech.ByCanonicalPartOfSpeech(CanonicalPosTag.N.name()); this.m_classifier = classifier; this.m_limitOnRetrievedRules = limitOnRetrievedRules; }