Dictionary Api For Java(用于查找单词的含义)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7804715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Dictionary Api For Java (for finding meaning for the word)
提问by Prasanth
Hello everyone can anyone tell me how to access the dictionary in Java? I need API for that such that I can access all the dictionary words and meanings.
大家好,谁能告诉我如何在 Java 中访问字典?我需要 API 以便我可以访问所有字典单词和含义。
回答by matt burns
JWKTLlooks like a good place to start although I haven't tried it myself. It gets the words and definitions from the Wiktionarydatabase.
JWKTL看起来是一个不错的起点,尽管我自己还没有尝试过。它从维基词典数据库中获取单词和定义。
Example usage:
用法示例:
Wiktionary wiktionary = new Wiktionary(DB_PATH, Language.GERMAN);
wiktionary.addWiktionary(DB_PATH, Language.English);
wiktionary.setWordLanguage(Language.German);
List<WiktionaryWord> wordList = wiktionary.getWords("bank");