}
private static int distance(String w1, POS pos1, String w2, POS pos2,
PointerType type) {
try {
IndexWord start = Dictionary.getInstance().lookupIndexWord(
getPOS(pos1), w1);
IndexWord end = Dictionary.getInstance().lookupIndexWord(
getPOS(pos2), w2);
if ((start == null) || (end == null))
return Integer.MAX_VALUE;
Synset startSynset = start.getSense(1);
Synset endSynset = end.getSense(1);
RelationshipList list = RelationshipFinder.getInstance()
.findRelationships(startSynset, endSynset, type);
// System.out.println("Synonym relationship between \"" +
// start.getLemma() + "\" and \"" + end.getLemma() + "\":");