use of net.didion.jwnl.data.list.PointerTargetNodeList in project lucida by claritylab.
the class WordNetAnswerTypeMapping method findWnMapMatch.
private static AnswerType findWnMapMatch(Synset synset, int level) throws Exception {
AnswerType type = null;
String synsetId = buildSynsetString(synset);
String typeStr = wnAtypeMap.get(synsetId);
if (typeStr != null) {
type = AnswerType.constructFromString(typeStr);
type.setConfidence(1.0 - ((double) level / 100.0));
return type;
}
PointerTargetNodeList ptNodeList = null;
ptNodeList = pUtils.getDirectHypernyms(synset);
for (int i = 0; i < ptNodeList.size(); i++) {
Synset parent = (Synset) ((PointerTargetNode) ptNodeList.get(i)).getPointerTarget();
type = findWnMapMatch(parent, level + 1);
if (type != null)
return type;
}
return type;
}
Aggregations