|
Java Access to WordNet | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--danbikel.wordnet.WordNetServer
Implementation of the WordNetRemote interface, allowing access
to the WordNet database via RMI.
| Field Summary | |
protected WordNet |
wn
WordNet object used to carry out remotely-requested method calls. |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Fields inherited from interface danbikel.wordnet.WordNetRemote |
adjPos, adjPosIdx, advPos, advPosIdx, maxPosIdx, minPosIdx, nounPos, nounPosIdx, numPartsOfSpeech, verbPos, verbPosIdx |
| Constructor Summary | |
WordNetServer(WordNet wn)
Constructs a new WordNetRMI object, using the passed WordNet object to carry out the remotely-requested WordNet method calls. |
|
| 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. |
static void |
main(String[] args)
Constructs a new WordNetServer object and binds it to a
running rmiregistry, using Naming.rebind. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected WordNet wn
UnicastRemoteObject. Therefore,
this class acts as a flow-through to methods implemented by the
WordNet class.
| Constructor Detail |
public WordNetServer(WordNet wn)
throws RemoteException
| Method Detail |
public boolean contains(String word,
String pos)
throws RemoteException
contains in interface WordNetRemoteword - a lemma in WordNet.pos - a WordNet part of speech.
RemoteException
public boolean exists(String word,
String pos)
throws RemoteException
contains(java.lang.String, java.lang.String).
exists in interface WordNetRemoteword - a lemma in WordNet.pos - a WordNet part of speech.
RemoteException
public WNIndexEntry getIndexEntry(String word,
String pos)
throws RemoteException
word and pos,
printing errors if there is no such word-pos pair in the database.
getIndexEntry in interface WordNetRemoteword - a lemma in WordNet.pos - a WordNet part of speech.
RemoteException
public WNIndexEntry getIndexEntry(String word,
String pos,
boolean printErrors)
throws RemoteException
word and pos.
getIndexEntry in interface WordNetRemoteword - a lemma in WordNet.pos - a WordNet part of speech.printErrors - print errors using WordNet.printError(java.lang.String) if true.
RemoteException
public WNDataEntry getDataEntry(String pos,
int synset)
throws RemoteException
pos and synset.
getDataEntry in interface WordNetRemotepos - a WordNet part of speech.synset - a synset in WordNet.
RemoteException
public int[] getAllSynsets(String word,
String pos)
throws RemoteException
word and pos.
getAllSynsets in interface WordNetRemoteword - a lemma in WordNet.pos - a WordNet part of speech.
RemoteExceptionWNIndexEntry.getSynsets()
public int getSynset(String word,
String pos,
int senseNum)
throws RemoteException
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.
getSynset in interface WordNetRemoteRemoteException
public int getSenseNum(String word,
String pos,
int synset)
throws RemoteException
synset of
word and pos.
N.B.: This method is O(n), where n is the number of
synsets for word, pos.
getSenseNum in interface WordNetRemoteRemoteException
public WNPointer[] getParentPointers(String pos,
int synset)
throws RemoteException
pos and synset, as defined by pointers that pass
through ParentSemanticPointerFilter.
getParentPointers in interface WordNetRemotepos - a WordNet part of speech.synset - a WordNet synset.
RemoteException
public int[] getParents(String pos,
int synset)
throws RemoteException
synset.
A cache is used for these parent-synset int arrays.
getParents in interface WordNetRemotepos - a WordNet part of speech.synset - a WordNet synset.
RemoteException
public WNPointer[] getChildPointers(String pos,
int synset)
throws RemoteException
pos and synset, as defined by pointers that pass
through ChildSemanticPointerFilter.
getChildPointers in interface WordNetRemotepos - a WordNet part of speechsynset - a WordNet synset
RemoteException
public int[] getChildren(String pos,
int synset)
throws RemoteException
synset.
A cache is used for these child-synset int arrays.
getChildren in interface WordNetRemotepos - a WordNet part of speech.synset - a WordNet synset.
RemoteException
public WNWord getSynsetName(String pos,
int synset)
throws RemoteException
getSynsetName in interface WordNetRemotepos - a WordNet part of speech.synset - a WordNet synset.
WNWord object that represents the first lemma
in the list of lemmas for synset in the database.
RemoteException
public int[][] getAllParentsBFS(String pos,
int synset)
throws RemoteException
synset.
getAllParentsBFS in interface WordNetRemotepos - a WordNet part of speech.synset - a WordNet synset.
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
public RemoteEnumeration getCachedDataEntries(String pos)
throws RemoteException
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.
getCachedDataEntries in interface WordNetRemoteRemoteException
public RemoteEnumeration getCachedDataEntries(int posIdx)
throws RemoteException
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.
getCachedDataEntries in interface WordNetRemoteRemoteException
public RemoteEnumeration getCachedIndexEntries(String pos)
throws RemoteException
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.
getCachedIndexEntries in interface WordNetRemoteRemoteException
public RemoteEnumeration getCachedIndexEntries(int posIdx)
throws RemoteException
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.
getCachedIndexEntries in interface WordNetRemoteRemoteExceptionpublic static void main(String[] args)
WordNetServer object and binds it to a
running rmiregistry, using Naming.rebind. This
server will be bound under the name "wordnet".
|
Java Access to WordNet | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||