Trying to find synonyms using wordnet java api

﹥>﹥吖頭↗ 提交于 2019-12-06 05:16:50

问题


I am trying to find synonyms of some words(String type) in java using Wordnet java api. I have difficulties though in figuring out how it works.

I found this link http://lyle.smu.edu/~tspell/jaws/doc/edu/smu/tspell/wordnet/impl/file/ReferenceSynset.html#getTagCount%28java.lang.String%29 which I though it is useful, but still I don't know how to start. Do I have to create a ReferenceSynset object and then find its synonyms, and how can this be done? Or is there another easier way? Please help!

Thanks in advance!


回答1:


JAWS - "Java API for WordNet Searching" has been created exactly for this purpose. It is possible that you haven't installed it right. In the same domain that you mention (smu.edu) there are instructions for installing JAWS.

First, you will need to download the executable and Wordnet itself.

  1. Get the *.jar file
  2. Download the wordnet database files to the appropriate directory (instructions here)

Once you have done this you should next try the example program. First, make sure that it works unmodified. If you get that working, you should see a bunch of synsets when you type:

java TestJAWS <your word here>

If that works, you can start modifying the code to suit your purpose.

Hope that helps.



来源:https://stackoverflow.com/questions/13745631/trying-to-find-synonyms-using-wordnet-java-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!