Java Access to WordNet

danbikel.wordnet
Interface WordNetRemote

All Superinterfaces:
Remote
All Known Implementing Classes:
WordNetLocal, WordNetServer

public interface WordNetRemote
extends Remote

An interface describing methods that can be called via RMI to access the WordNet database.


Field Summary
static String adjPos
          The constant representing an adjective in WordNet.
static int adjPosIdx
          The integer constant representing an adjective in WordNet.
static String advPos
          The constant representing an adverb in WordNet.
static int advPosIdx
          The integer constant representing an adverb in WordNet.
static int maxPosIdx
          The maximum integer constant used to represent parts of speech.
static int minPosIdx
          The minimum integer constant used to represent parts of speech.
static String nounPos
          The constant representing a noun in WordNet.
static int nounPosIdx
          The integer constant representing a noun in WordNet.
static int numPartsOfSpeech
          The total number of parts of speech in WordNet, collapsing adjective satellites to be adjectives, i.e., 4.
static String verbPos
          The constant representing a verb in WordNet.
static int verbPosIdx
          The integer constant representing a verb in WordNet.
 
Method Summary
 boolean contains(String word, String pos)
          Returns whether a given word and part of speech exist in the database.
 boolean exists(String word, String pos)
          Returns whether a given word and part of speech exist in the database.
 int[][] getAllParentsBFS(String pos, int synset)
          Returns a breadth-first search of the hypernym subgraph of synset.
 int[] getAllSynsets(String word, String pos)
          Gets all synsets for word and pos.
 RemoteEnumeration getCachedDataEntries(int posIdx)
          Returns a RemoteEnumeraton to allow iteration over all cached data entries.
 RemoteEnumeration getCachedDataEntries(String pos)
          Returns a RemoteEnumeraton to allow iteration over all cached data entries.
 RemoteEnumeration getCachedIndexEntries(int posIdx)
          Returns an RemoteEnumeraton to allow iteration over all cached index entries.
 RemoteEnumeration getCachedIndexEntries(String pos)
          Returns an RemoteEnumeraton to allow iteration over all cached index entries.
 WNPointer[] getChildPointers(String pos, int synset)
          Gets the child (hyponym) pointers for the synset specified by pos and synset, as defined by pointers that pass through ChildSemanticPointerFilter.
 int[] getChildren(String pos, int synset)
          Gets all synsets that are children (hyponyms) of synset.
 WNDataEntry getDataEntry(String pos, int synset)
          Gets the WNDataEntry object for pos and synset.
 WNIndexEntry getIndexEntry(String word, String pos)
          Gets the WNIndexEntry for word and pos, printing errors if there is no such word-pos pair in the database.
 WNIndexEntry getIndexEntry(String word, String pos, boolean printErrors)
          Gets the WNIndexEntry for word and pos.
 WNPointer[] getParentPointers(String pos, int synset)
          Gets the parent (hypernym) pointers for the synset specified by pos and synset, as defined by pointers that pass through ParentSemanticPointerFilter.
 int[] getParents(String pos, int synset)
          Gets all synsets that are parents (hypernyms) of synset.
 int getSenseNum(String word, String pos, int synset)
          Gets the sense number for the passed synset of word and pos.
 int getSynset(String word, String pos, int senseNum)
          Gets the senseNumth synset for word and pos.
 WNWord getSynsetName(String pos, int synset)
          Gets the name of a synset.
 

Field Detail

verbPos

public static final String verbPos
The constant representing a verb in WordNet.


nounPos

public static final String nounPos
The constant representing a noun in WordNet.


adjPos

public static final String adjPos
The constant representing an adjective in WordNet.


advPos

public static final String advPos
The constant representing an adverb in WordNet.


nounPosIdx

public static final int nounPosIdx
The integer constant representing a noun in WordNet.

See Also:
Constant Field Values

verbPosIdx

public static final int verbPosIdx
The integer constant representing a verb in WordNet.

See Also:
Constant Field Values

adjPosIdx

public static final int adjPosIdx
The integer constant representing an adjective in WordNet.

See Also:
Constant Field Values

advPosIdx

public static final int advPosIdx
The integer constant representing an adverb in WordNet.

See Also:
Constant Field Values

minPosIdx

public static final int minPosIdx
The minimum integer constant used to represent parts of speech.

See Also:
Constant Field Values

maxPosIdx

public static final int maxPosIdx
The maximum integer constant used to represent parts of speech.

See Also:
Constant Field Values

numPartsOfSpeech

public static final int numPartsOfSpeech
The total number of parts of speech in WordNet, collapsing adjective satellites to be adjectives, i.e., 4.

See Also:
Constant Field Values
Method Detail

contains

public boolean contains(String word,
                        String pos)
                 throws RemoteException
Returns whether a given word and part of speech exist in the database.

Parameters:
word - a lemma in WordNet.
pos - a WordNet part of speech.
RemoteException

exists

public boolean exists(String word,
                      String pos)
               throws RemoteException
Returns whether a given word and part of speech exist in the database. This method is a synonym for contains(java.lang.String, java.lang.String).

Parameters:
word - a lemma in WordNet.
pos - a WordNet part of speech.
RemoteException

getIndexEntry

public WNIndexEntry getIndexEntry(String word,
                                  String pos)
                           throws RemoteException
Gets the WNIndexEntry for word and pos, printing errors if there is no such word-pos pair in the database.

Parameters:
word - a lemma in WordNet.
pos - a WordNet part of speech.
RemoteException

getIndexEntry

public WNIndexEntry getIndexEntry(String word,
                                  String pos,
                                  boolean printErrors)
                           throws RemoteException
Gets the WNIndexEntry for word and pos.

Parameters:
word - a lemma in WordNet.
pos - a WordNet part of speech.
printErrors - print errors using WordNet.printError(java.lang.String) if true.
RemoteException

getDataEntry

public WNDataEntry getDataEntry(String pos,
                                int synset)
                         throws RemoteException
Gets the WNDataEntry object for pos and synset.

Parameters:
pos - a WordNet part of speech.
synset - a synset in WordNet.
RemoteException

getAllSynsets

public int[] getAllSynsets(String word,
                           String pos)
                    throws RemoteException
Gets all synsets for word and pos.

Parameters:
word - a lemma in WordNet.
pos - a WordNet part of speech.
RemoteException
See Also:
WNIndexEntry.getSynsets()

getSynset

public int getSynset(String word,
                     String pos,
                     int senseNum)
              throws RemoteException
Gets the senseNumth synset for word and pos. Note that this is the senseNum - 1st element in the array returned by getAllSynsets(java.lang.String, java.lang.String), as sense numbers are 1-indexed.

RemoteException

getSenseNum

public int getSenseNum(String word,
                       String pos,
                       int synset)
                throws RemoteException
Gets the sense number for the passed synset of word and pos. N.B.: This method is O(n), where n is the number of synsets for word, pos.

RemoteException

getParentPointers

public WNPointer[] getParentPointers(String pos,
                                     int synset)
                              throws RemoteException
Gets the parent (hypernym) pointers for the synset specified by pos and synset, as defined by pointers that pass through ParentSemanticPointerFilter.

Parameters:
pos - a WordNet part of speech.
synset - a WordNet synset.
RemoteException

getParents

public int[] getParents(String pos,
                        int synset)
                 throws RemoteException
Gets all synsets that are parents (hypernyms) of synset. A cache is used for these parent-synset int arrays.

Parameters:
pos - a WordNet part of speech.
synset - a WordNet synset.
RemoteException

getChildPointers

public WNPointer[] getChildPointers(String pos,
                                    int synset)
                             throws RemoteException
Gets the child (hyponym) pointers for the synset specified by pos and synset, as defined by pointers that pass through ChildSemanticPointerFilter.

Parameters:
pos - a WordNet part of speech
synset - a WordNet synset
RemoteException

getChildren

public int[] getChildren(String pos,
                         int synset)
                  throws RemoteException
Gets all synsets that are children (hyponyms) of synset. A cache is used for these child-synset int arrays.

Parameters:
pos - a WordNet part of speech.
synset - a WordNet synset.
RemoteException

getSynsetName

public WNWord getSynsetName(String pos,
                            int synset)
                     throws RemoteException
Gets the name of a synset. A synset's name is defined to be the first lemma in the list of lemmas contained in the database.

Parameters:
pos - a WordNet part of speech.
synset - a WordNet synset.
Returns:
the WNWord object that represents the first lemma in the list of lemmas for synset in the database.
RemoteException

getAllParentsBFS

public int[][] getAllParentsBFS(String pos,
                                int synset)
                         throws RemoteException
Returns a breadth-first search of the hypernym subgraph of synset.

Parameters:
pos - a WordNet part of speech.
synset - a WordNet synset.
Returns:
an array of int arrays, where the ith element contains all synsets that have a hyponym path of length i to synset. Thus, the first element is guaranteed to be an array of length 1 containing only synset. Furthermore, since adjectives and adverbs do not have hypernyms, the return value for these two parts of speech is always of length 1.
RemoteException

getCachedDataEntries

public RemoteEnumeration getCachedDataEntries(String pos)
                                       throws RemoteException
Returns a RemoteEnumeraton to allow iteration over all cached data entries. Note that RemoteEnumeration objects, like the Enumeration objects they wrap, are fail-fast, and are even more brittle in that a RemoteException could be raised at any time.

RemoteException

getCachedDataEntries

public RemoteEnumeration getCachedDataEntries(int posIdx)
                                       throws RemoteException
Returns a RemoteEnumeraton to allow iteration over all cached data entries. Note that RemoteEnumeration objects, like the Enumeration objects they wrap, are fail-fast, and are even more brittle in that a RemoteException could be raised at any time.

RemoteException

getCachedIndexEntries

public RemoteEnumeration getCachedIndexEntries(String pos)
                                        throws RemoteException
Returns an RemoteEnumeraton to allow iteration over all cached index entries. Note that RemoteEnumeration objects, like the Enumeration objects they wrap, are fail-fast, and are even more brittle in that a RemoteException could be raised at any time.

RemoteException

getCachedIndexEntries

public RemoteEnumeration getCachedIndexEntries(int posIdx)
                                        throws RemoteException
Returns an RemoteEnumeraton to allow iteration over all cached index entries. Note that RemoteEnumeration objects, like the Enumeration objects they wrap, are fail-fast, and are even more brittle in that a RemoteException could be raised at any time.

RemoteException

Java Access to WordNet

Author: Dan Bikel