4

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!

missrg
  • 585
  • 2
  • 8
  • 19

1 Answers1

6

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.

Ram Narasimhan
  • 22,341
  • 5
  • 49
  • 55
  • First of all thank you for the answer which was really useful, but I had already found these after much searching. Do you know about Wordnet? I am trying to find synonyms in estimated frequency order, do you have any idea how this can be done? If so, I would really appreciate your help! [http://stackoverflow.com/questions/13822141/java-how-can-i-find-synonyms-in-estimated-frequency-order-using-jwnlwordnet-li] – missrg Dec 11 '12 at 14:50
  • great and proper answer helps me alot – Java Nerd Mar 31 '14 at 12:01
  • Links in tha answer are dead!! – Om Sao Jan 07 '18 at 00:44