This package is intended to compare two WORDS and return a score indicating their RELATEDNESS. It includes several metrics based on WordNet, a Paraphrase resource, and the Lin and Resnik metrics from WS4J.
This code is set up to allow use of part of speech as well as words themselves, but presently does not use it. Use WNSimSimple's compare() method to compare two strings (each one a single word):
WNSimSimple sim = null;
try {
sim = new WNSimSimple();
} catch (IOException e) {
e.printStackTrace();
fail( e.getMessage() );
}
String first = "apple";
String second = "fruit";
MetricResponse response = sim.compare(first, second);
print( "score: " response.score );