/** * Calculates similarity between word1 and word2 * TODO: determine catalog of POS values for POS tags of word1 and word2 * * @param arg1 1st component (word + POS tag) * @param arg2 2nd component * @return similarity score between words plus a "reason" * @throws IllegalArgumentException * @throws NotImplementedException */ public MetricResponse compare(MetricWord arg1, MetricWord arg2) throws IllegalArgumentException, NotImplementedException { String pos1 = ( null == arg1.pos ) ? null : arg1.pos.name(); String pos2 = ( null == arg2.pos ) ? null : arg2.pos.name(); double score = this.parascore(arg1.word, pos1, arg2.word, pos2); return new MetricResponse(score, NAME); //return null; }
/** * Calculates similarity between word1 and word2 TODO: determine catalog of * POS values for POS tags of word1 and word2 * * @param arg1 * 1st component (word + POS tag) * @param arg2 * 2nd component * @return similarity score between words plus a "reason" * @throws IllegalArgumentException * @throws NotImplementedException */ public MetricResponse compare(MetricWord arg1, MetricWord arg2) throws IllegalArgumentException, NotImplementedException { String pos1 = (null == arg1.pos) ? null : arg1.pos.name(); String pos2 = (null == arg2.pos) ? null : arg2.pos.name(); double score = this.parascore(arg1.word, pos1, arg2.word, pos2); return new MetricResponse(score, NAME); // return null; }