RiTa
index
Name RiWordnet
Examples
RiWordnet wordnet = new RiWordnet(this);
String[] hypos = wordnet.getHyponyms("dog", "n");
Description Provides library support for application & applet access to Wordnet.

You can construct this object like so:

   RiWordnet wordnet = new RiWordnet(this);
  
If you do not wish to use the embedded data files, but instead prefer a pre-installed
(local or remote) Wordnet installation, pass the filepath or URL of the directory in which Wordnet is installed to the constructor as follows:

   (Note: windows paths require double backslashes as below)
   
   RiWordnet wordnet = new RiWordnet(this, "c:\\Wordnet3.0\\"); 
 
Generally three methods are provided for each relation type (e.g., getHyponyms(String, String), getHyponyms(String, String) and getAllHyponyms(String,String) where the 1st returns hyponyms for a specific sense (as specified by its unique id), the 2nd returns the most common sense, and the 3rd returns 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 the word. (see VariousHyponyms.pde for examples)

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

    RiWordnet.NOUN
    RiWordnet.VERB
    RiWordnet.ADJ
    RiWordnet.ADV 
 

Note: methods return null either when the query term is not found or there are no entries for the relation type being sought.

For more info on the meaning of various wordnet concepts (synset, sense, hypernym, etc), see: {@link http://wordnet.princeton.edu/gloss}

See the accompanying documentation for license information

Constructors
RiWordnet(pApplet);
RiWordnet(pApplet, wordnetInstallDir);
Parameters
wordnetInstallDir   home directory for a pre-installed Wordnet installation.
Fields
RiWordnet.ADJ   String constant for Adjective part-of-speech

RiWordnet.ADV   String constant for Adverb part-of-speech

RiWordnet.NOUN   String constant for Noun part-of-speech

RiWordnet.VERB   String constant for Verb part-of-speech

Methods
exists()   Checks the existence of a 'word' in the ontology

getAllAlsoSees()   Returns also-see terms for all senses ofword/pos or null if not found
Holds for nouns (?) & adjectives
Example: happy -> [cheerful, elated, euphoric, felicitous, joyful, joyous...]

getAllAntonyms()   Returns String[] of Antonyms for the 1st sense of word with pos or null if not found
Holds for adjectives only (?)

getAllCoordinates()   Returns coordinate terms for all sense of word/pos, or null if not found
X is a coordinate term of Y if there exists a term Z which is the hypernym of both X and Y.
Examples:
  • blackbird and robin are coordinate terms (since they are both a kind of thrush)
  • gun and bow are coordinate terms (since they are both weapons)
  • fork and spoon are coordinate terms (since they are both cutlery, or eating utensils)
  • hat and helmet are coordinate terms (since they are both a kind of headgear or headdress)
Example: arm -> [hind-limb, forelimb, flipper, leg, crus, thigh, arm...]
Holds btwn nouns/nouns and verbs/verbs

getAllDerivedTerms()   Returns derived terms forall senses of word/pos or null if not found
Holds for adverbs
Example: happily -> [jubilant, blithe, gay, mirthful, merry, happy]

getAllExamples()   Returns examples for all senses of word with pos if they contain the word, else null if not found

getAllGlosses()   Returns glosses for all senses of 'word' with 'pos', or null if not found

getAllHolonyms()   Returns part-to-whole relationships for all sense of word/pos, or none if not found
X is a meronym of Y if Y has X as a part.
X is a holonym of Y if X has Y as a part. That is, if Y is a meronym of X.
Holds between: nouns and nouns
Returns part, member, and substance holonyms
Example: arm -> [body, physical-structure, man, human...]

getAllHypernyms()   Returns an ordered String[] of hypernym-synsets (each a semi-colon delimited String) up to the root of Wordnet for the 1st sense of the word, or null if not found

getAllHyponyms()   Returns an unordered String[] of hyponym-synsets (each a colon-delimited String), or null if not found

getAllMeronyms()   Returns array of whole-to-part relationships for all senses of word/pos, or null if not found
X is a meronym of Y if Y has X as a part.
X is a holonym of Y if X has Y as a part. That is, if Y is a meronym of X.
Holds between: Nouns and nouns
Returns part,member, and substance meronyms
Example: arm -> [wrist, carpus, wrist-joint, radiocarpal-joint...]

getAllNominalizations()   Returns nominalized terms for all sense of word/pos or null if not found
Refers to the use of a verb or an adjective as a noun. Holds for nouns, verbs & adjecstives(?)
Example: happiness(n) -> [happy, unhappy]
happy(a) -> [happiness, felicity]


getAllSimilar()   Returns similar-to list for all sense of word/pos or null if not found
Holds for adjectives
Example:
happy(a) -> [blessed, blissful, bright, golden, halcyon, prosperous...]


getAllSynonyms()   Returns an unordered String[] containing the synset, hyponyms, similars, alsoSees, and coordinate terms (checking each in order) for all senses of word with pos, or null if not found

getAllSynsets()   Returns String[] of words in each synset for all senses of word with pos, or null if not found

getAllVerbGroups()   Returns verb group for all senses of verb or null if not found
Example: live -> [dwell, inhabit]
Holds for verbs

getAlsoSees()   Returns also-see terms for 1st sense of word/pos or null if not found
Holds for nouns (?) & adjectives
Example: happy -> [cheerful, elated, euphoric, felicitous, joyful, joyous...]

getAnagrams()   Returns up to maxResults full anagram matches for the specified word and pos

Example: 'table' returns 'bleat' (but not 'tale').

getAntonyms()   Returns String[] of Antonyms for the 1st sense of word with pos or null if not found
Holds for adjectives only (?)

getAnyExample()   Return a random example from the set of examples from all senses of word with pos, assuming they contain word, or else null if not found

getBestPos()   Returns most-common pos according to polysemy count, returning the pos with the most different senses.

getCommonParent()   Returns common parent for words with unique ids id1, id2, or null if either word or no parent is found

getCommonParents()   Returns String[] of Common Parents for 1st senses of words with specified pos' or null if not found

getContains()   Returns up to maxResults of the specified pos where each contains the given word

Example: 'table' returns 'bleat' (but not 'tale').

getCoordinates()   Returns coordinate terms for 1st sense of word/pos, or null if not found
X is a coordinate term of Y if there exists a term Z which is the hypernym of both X and Y.
Examples:
  • blackbird and robin are coordinate terms (since they are both a kind of thrush)
  • gun and bow are coordinate terms (since they are both weapons)
  • fork and spoon are coordinate terms (since they are both cutlery, or eating utensils)
  • hat and helmet are coordinate terms (since they are both a kind of headgear or headdress)
Example: arm -> [hind-limb, forelimb, flipper, leg, crus, thigh, arm...]
Holds btwn nouns/nouns and verbs/verbs

getDerivedTerms()   Returns derived terms for 1st sense of word/pos or null if not found
Holds for adverbs
Example: happily -> [jubilant, blithe, gay, mirthful, merry, happy]

getDescription()   Returns description for word with pos or null if not found

getDistance()   Returns the min distance between any two senses for the 2 words in the wordnet tree (result normalized to 0-1) with specified pos, or 1.0 if either is not found

getEndsWith()   Returns up to maxResults of the specified pos ending with the given word.

Example: 'table' returns 'turntable' & 'uncomfortable'

getExamples()   Returns examples for word with unique senseId, or null if not found

getGloss()   Returns full gloss for !st sense of 'word' with 'pos' or null if not found

getHolonyms()   Returns part-to-whole relationships for 1st sense of word/pos, or none if not found
X is a meronym of Y if Y has X as a part.
X is a holonym of Y if X has Y as a part. That is, if Y is a meronym of X.
Holds between: nouns and nouns
Returns part, member, and substance holonyms
Example: arm -> [body, physical-structure, man, human...]

getHypernyms()   Returns Hypernym String[] for all senses of word with pos or null if not found

X is a hyponym of Y if there exists an is-a relationship between X and Y.
That is, if X is a subtype of Y.
Or, for xample, if X is a species of the genus Y.
X is a hypernym of Y is Y is a hyponym of X.
Holds between: nouns and nouns & verbs and verbs
Examples:

  • artifact is a hyponym of object
  • object is a hypernym of artifact
  • carrot is a hyponym of herb
  • herb is a hypernym of carrot


getHypernymTree()   Returns an ordered String[] of hypernym-synsets (each a semi-colon delimited String) up to the root of Wordnet for the id, or null if not found

getHyponyms()   Returns Hyponym String[] for 1st sense of word with pos or null if not found

X is a hyponym of Y if there exists an is-a relationship between X and Y.
That is, if X is a subtype of Y.
Or, for xample, if X is a species of the genus Y.
X is a hypernym of Y is Y is a hyponym of X.
Holds between: nouns and nouns & verbs and verbs
Examples:

  • artifact is a hyponym of object
  • object is a hypernym of artifact
  • carrot is a hyponym of herb
  • herb is a hypernym of carrot


getHyponymTree()   Returns an unordered String[] of hyponym-synsets (each a colon-delimited String) representing all paths to leaves in the ontology (the full hyponym tree), or null if not found



getMeronyms()   Returns array of whole-to-part relationships for 1st sense of word/pos, or null if not found
X is a meronym of Y if Y has X as a part.
X is a holonym of Y if X has Y as a part. That is, if Y is a meronym of X.
Holds between: Nouns and nouns
Returns part,member, and substance meronyms
Example: arm -> [wrist, carpus, wrist-joint, radiocarpal-joint...]

getNominalizations()   Returns nominalized terms for 1st sense of word/pos or null if not found
Refers to the use of a verb or an adjective as a noun. Holds for nouns, verbs & adjecstives(?)
Example: happiness(n) -> [happy, unhappy]
happy(a) -> [happiness, felicity]


getPos()   Returns an array of all parts-of-speech ordered according to their polysemy count, returning the pos with the most different senses in the first position, etc.

getRandomExample()   Returns a random example from a random word w' pos

getRandomExamples()   Returns numExamples random examples from random words w' pos

getRandomWord()   Returns a random word with pos and a maximum of maxChars.

getRandomWords()   Returns count random words w' pos

getRegexMatch()   Returns up to maxResults of the specified pos matching the the given regular expression pattern.



getSenseCount()   Return the # of senses (polysemy) for a given word/pos. A 'sense' refers to a specific Wordnet meaning and maps 1-1 to the concept of synsets. Each 'sense' of a word exists in a different synset.

For more info, see: {@link http://wordnet.princeton.edu/gloss}

getSenseIds()   Returns String[] of unique ids, one for each 'sense' of word with pos, or null if none are found.

A Wordnet 'sense' refers to a specific Wordnet meaning and maps 1-1 to the concept of synsets. Each 'sense' of a word exists in a different synset.

For more info, see: {@link http://wordnet.princeton.edu/gloss}

getSimilar()   Returns similar-to list for first sense of word/pos or null if not found
Holds for adjectives
Example:
happy(a) -> [blessed, blissful, bright, golden, halcyon, prosperous...]


getSoundsLike()   Returns up to maxResults of the specified pos that match the soundex code of the given word.



getStartsWith()   Returns up to maxResults of the specified pos starting with the given word.

Example: 'turn' returns 'turntable'

getStems()   Returns an array of all stems, or null if not found

getSynonyms()   Returns an unordered String[] containing the synset, hyponyms, similars, alsoSees, and coordinate terms (checking each in order) for all senses of word with pos, or null if not found

getSynset()   Returns String[] of words in synset for first sense of word with pos, or null if not found

getVerbGroup()   Returns verb group for 1st sense of verb or null if not found
Example: live -> [dwell, inhabit]
Holds for verbs

getWildcardMatch()   Returns up to maxResults of the specified pos matching a wildcard pattern,
with * '*' equals any number of characters,
and '?' equals any single character.

Example: 't?le' returns (tale,tile,tole)
Example: 't*le' returns (tatumble, turtle, tussle, etc.)
Example: 't?le*' returns (telex, tile,tilefish,tile,talent, tiles, etc.)


isStem()   Returns true if 'word' exists with 'pos' and is equal (via String.equals()) to any of its stem forms, else false;

printHypernymTree()   Prints the full hypernym tree to System.out (primarily for debugging).

printHyponymTree()   Prints the full hyponym tree to System.out (primarily for debugging).

Usage Web & Application
Related