我使用JWNL库进行搜索相似性。在公式中,需要下位数。我如何使用JWNL获得WordNet中的Hyponym和深度synset的数量?感谢
我已经尝试过以下代码。但是当程序运行时出现错误的java堆空间。我的java堆空间是2 GB
//Method for count number of hyponym of synset
public double getHypo(Synset synset) throws JWNLException {
double hypo = PointerUtils.getInstance().getHyponymTree(synset).toList().size();
return hypo;
}
//Method for count deep of synset from root (deep root =1)
public double getDeep(Synset synset) throws JWNLException {
double deep = PointerUtils.getInstance().getHypernymTree(synset).toList().size() + 1;
return deep;
}