RiWordNet (Java-only)

Description

Provides support for access to the WordNet ontological database. Note that WordNet data files are no longer supplied as part of the installation. Please download the version (3.x is recommended) for your platform here. The examples below assume the following installation structure (linux/unix/osx):

   /path/to/WordNet3.1
   /path/to/WordNet3.1/dict/
   /path/to/WordNet3.1/dict/data.noun
   ...

For more info on the meaning of various WordNet concepts (synset, sense, hypernym, etc), see this page.


Construct a RiWordNet object like so:
   RiWordNet wordnet = new RiWordNet("/path/to/WordNet3.1");
 
or, on Windows:
   RiWordNet wordnet = new RiWordNet("c:\\path\\to\\WordNet3.0");
 
Generally three methods are provided for each relation type. Using hypernyms as an example:
 getHyponyms(int id);

 getHyponyms(String word, String pos)

 getAllHyponyms(String word, String pos).
The 1st version returns hyponyms for a specific sense (as specified by its unique id), the 2nd returns hyponyms for the most common sense, and the 3rd returns hyponyms for ALL senses for the word/pos pair.


You can also retrieve the entire tree of hyponyms (down to the leaves) for a specific sense of a word.
 

Note: Valid WordNet parts-of-speech include (noun="n",verb="v",adj="a", and adverb="r").
These can be specified either as a literal (e.g., "n") or using the constants:

    RiWordNet.NOUN
    RiWordNet.VERB
    RiWordNet.ADJ
    RiWordNet.ADV
 

NOTE:  Methods returning a String[] will return a zero-length array when the query term is not found or there are no entries for the relation type being sought, rather than null (as in the original version of this library).

NOTE:  Methods returning a String[] will return results in randomized order. To disable this behavior, call wordnet.randomizeResults(false);

For more info on the meaning of various WordNet concepts (synset, sense, hypernym, etc), see this page.

See the included documentation for license information (in the rita.wordnet pkg).

Syntax
RiWordNet(String wordnetInstallDir);
RiWordNet(String wordnetInstallDir, boolean ignoreCompoundWords);
RiWordNet("/path/to/WordNet3.1", boolean ignoreCompoundWords, boolean ignoreUpperCaseWords);
Parameters
Stringpath to WordNet dictionary
booleanfalse by default, ignore compound words in the dictionary (optional)
booleanfalse by default, ignore upper case words in the dictionary (optional)
Platform Java only (Android coming soon...)                                                                                            
Documentation: