Documentation is here (just click the method names in the right column):
http://www.rednoise.org/rita/wordnet/documentation/
But I have to admit it is not very detailed.
When I run this, I repeatedly get poss = [n] synonyms = [chip, diode, microchip, thermistor]
If you don't, you may want to check if you have multiple versions of WordNet JARs in your classpath (the word lists are inside the Jar in a folder called rita/wordnet/wdict.dat
)
You can use Arrays.toString()
to easily print the contents of an array for debugging, without having to use a for
loop every time.
The middle argument ('n') in this case is the word class ("a" = adjective, "n" = noun, "r" = adverb, "v" = verb) since some words (like "good") may exist in multiple classes and each of them has individual synonyms.