我正在使用带有www.projects.csail.mit.edu/jwi/api/edu/mit/jwi库的www.wordnet.princeton.edu开源词典?
我找不到一个词的反义词。人们声称这是一本非常好的词典,但我在里面找不到我的单词。我需要反义词和其他相关词。很好的描述和其他词汇信息,但我找不到我需要的东西。
这是我的代码:
List<IWordID> wordIDList = indexWordList.get(0).getWordIDs();
for(int idIndex = 0; idIndex < wordIDList.size(); idIndex++)
{
IWordID wordID = wordIDList.get(idIndex);
IWord word = m_Dict.getWord(wordID);
System.out.println("Id = " + wordID);
System.out.println(" Lemma = " + word.getLemma());
System.out.println(" Gloss = " + word.getSynset().getGloss());
ISynset synset = word.getSynset();
String LexFileName = synset.getLexicalFile().getName();
System.out.println("Lexical Name : " + LexFileName);
/** Finding stem for the word. */
WordnetStemmer stem = new WordnetStemmer(m_Dict);
//System.out.println("test" + stem.findStems(key, POS.NOUN));
ArrayList<String> antonymsList = new ArrayList<String>();
List<IWordID> relatedWords = word.getRelatedWords();
Map<IPointer, List<IWordID>> map = word.getRelatedMap();
AdjMarker marker = word.getAdjectiveMarker();
for (IWordID antonym : word.getRelatedWords()) {
String meaning = m_Dict.getWord(antonym).getLemma();
antonymsList.add(meaning);
System.out.println("Antonym: " + meaning);
System.out.println("Antonym POS: " + m_Dict.getWord(antonym).getPOS());
}
}
我真正需要什么?:::
我需要有关如何从 WordNet 获取相关信息的建议。此外,**I am open to accept any other API or library that will provide me the latest version of Dictionary, antonyms, Synonyms and well written description.**
每一个建议都值得赞赏。