use of edu.illinois.cs.cogcomp.sim.WordSim in project cogcomp-nlp by CogComp.
the class WordSimTest method testParagram.
@Test
public void testParagram() throws Exception {
WordSim ws = new WordSim(rm_, "paragram");
MetricResponse m1 = ws.compare("word", "sentence", "paragram");
MetricResponse m2 = ws.compare("word", "wife", "paragram");
assertTrue(m1.score > m2.score);
}
use of edu.illinois.cs.cogcomp.sim.WordSim in project cogcomp-nlp by CogComp.
the class WordSimTest method testWordNet.
@Test
public void testWordNet() {
WordSim ws = new WordSim(rm_, "wordnet");
MetricResponse m1 = ws.compare("word", "sentence", "wordnet");
MetricResponse m2 = ws.compare("word", "wife", "wordnet");
assertTrue(m1.score > m2.score);
}
use of edu.illinois.cs.cogcomp.sim.WordSim in project cogcomp-nlp by CogComp.
the class WordComparator method configure.
/**
* reads parameters from configuration file named by m_propertiesFile loads
* stopwords, sets xmlrpc client if appropriate
*
* @throws IllegalArgumentException
* @throws IOException
*/
protected void configure(ResourceManager rm_) throws IllegalArgumentException, IOException {
// boolean useWordSim = rm_.getBoolean(Constants.USE_WORDSIM); // if
// false, use WNSim (older
// package)
entailmentThreshold = rm_.getDouble(SimConfigurator.WORD_ENTAILMENT_THRESHOLD.key);
computeSimpleScore = rm_.getBoolean(SimConfigurator.USE_SIMPLE_SCORE.key);
String wordComparator = rm_.getString(SimConfigurator.WORD_METRIC);
wordSim = new WordSim(rm_, wordComparator);
}
Aggregations