Package net.didion.jwnl.dictionary
Class DatabaseBackedDictionary
java.lang.Object
net.didion.jwnl.dictionary.Dictionary
net.didion.jwnl.dictionary.AbstractCachingDictionary
net.didion.jwnl.dictionary.DatabaseBackedDictionary
- All Implemented Interfaces:
Installable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DatabaseManager
private DatabaseDictionaryElementFactory
static final String
static final String
static final String
MorphologicalProcessor
class install parameter. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
DatabaseBackedDictionary
(MorphologicalProcessor morph, DatabaseDictionaryElementFactory elementFactory, DatabaseManager dbManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Shut down the dictionarygetException
(POS pos, String derivation) Lookupderivation
in the exceptions file of part-of-speechpos
and return an Exc object containing the results.getExceptionIterator
(POS pos) Return an Iterator over all the Exceptions in the database.getIndexWord
(POS pos, String lemma) Look up a word in the database.getIndexWordIterator
(POS pos) Return an Iterator over all the IndexWords of part-of-speech pos in the database.getIndexWordIterator
(POS pos, String substring) Return an Iterator over all the IndexWords of part-of-speech pos whose lemmas contain substring as a substring.getRandomIndexWord
(POS pos) getSenseKey
(long offset, String lemma) Not implemented in DB yet.getSynsetAt
(POS pos, long offset) Return theSynset
at offsetoffset
from the database.getSynsetIterator
(POS pos) Return an Iterator over all the Synsets of part-of-speech pos in the database.int
getUsageCount
(long offset, String lemma) Not implemented in DB yet.void
Methods inherited from class net.didion.jwnl.dictionary.AbstractCachingDictionary
cacheException, cacheIndexWord, cacheSynset, clearCache, clearCache, getCacheCapacity, getCachedException, getCachedIndexWord, getCachedSynset, getCacheSizes, isCachingEnabled, setCacheCapacity, setCacheCapacity, setCachingEnabled
Methods inherited from class net.didion.jwnl.dictionary.Dictionary
getInstance, getMorphologicalProcessor, lookupAllIndexWords, lookupIndexWord, prepareQueryString, setDictionary, uninstall
-
Field Details
-
MORPH
MorphologicalProcessor
class install parameter. The value should be the class ofMorphologicalProcessor
to use.- See Also:
-
DICTIONARY_ELEMENT_FACTORY
- See Also:
-
DATABASE_MANAGER
- See Also:
-
_elementFactory
-
_dbManager
-
-
Constructor Details
-
DatabaseBackedDictionary
public DatabaseBackedDictionary() -
DatabaseBackedDictionary
private DatabaseBackedDictionary(MorphologicalProcessor morph, DatabaseDictionaryElementFactory elementFactory, DatabaseManager dbManager)
-
-
Method Details
-
install
- Throws:
JWNLException
-
getIndexWord
Description copied from class:Dictionary
Look up a word in the database. The search is case-independent, and phrases are separated by spaces ("look up", not "look_up"). Note: this method does not subject lemma to any morphological processing. If you want this, useDictionary.lookupIndexWord(POS, String)
.- Specified by:
getIndexWord
in classDictionary
- Parameters:
pos
- The part-of-speech.lemma
- The orthographic representation of the word.- Returns:
- An IndexWord representing the word, or
null
if no such entry exists. - Throws:
JWNLException
-
getIndexWordIterator
Description copied from class:Dictionary
Return an Iterator over all the IndexWords of part-of-speech pos in the database.- Specified by:
getIndexWordIterator
in classDictionary
- Parameters:
pos
- The part-of-speech- Returns:
- An iterator over
IndexWord
s - Throws:
JWNLException
-
getIndexWordIterator
Description copied from class:Dictionary
Return an Iterator over all the IndexWords of part-of-speech pos whose lemmas contain substring as a substring.- Specified by:
getIndexWordIterator
in classDictionary
- Parameters:
pos
- The part-of-speech.- Returns:
- An iterator over
IndexWord
s. - Throws:
JWNLException
-
getRandomIndexWord
- Specified by:
getRandomIndexWord
in classDictionary
- Throws:
JWNLException
-
getSynsetAt
Description copied from class:Dictionary
Return theSynset
at offsetoffset
from the database.- Specified by:
getSynsetAt
in classDictionary
- Parameters:
pos
- The part-of-speech file to look inoffset
- The offset of the synset in the file- Returns:
- A synset containing the parsed line from the database
- Throws:
JWNLException
-
getSynsetIterator
Description copied from class:Dictionary
Return an Iterator over all the Synsets of part-of-speech pos in the database.- Specified by:
getSynsetIterator
in classDictionary
- Parameters:
pos
- The part-of-speech.- Returns:
- An iterator over
Synset
s. - Throws:
JWNLException
-
getException
Description copied from class:Dictionary
Lookupderivation
in the exceptions file of part-of-speechpos
and return an Exc object containing the results.- Specified by:
getException
in classDictionary
- Parameters:
pos
- the exception file to look inderivation
- the word to look up- Returns:
- Exc the Exc object
- Throws:
JWNLException
-
getExceptionIterator
Description copied from class:Dictionary
Return an Iterator over all the Exceptions in the database.- Specified by:
getExceptionIterator
in classDictionary
- Parameters:
pos
- the part-of-speech- Returns:
- Iterator An iterator over
String
s - Throws:
JWNLException
-
close
public void close()Description copied from class:Dictionary
Shut down the dictionary- Specified by:
close
in classDictionary
-
getUsageCount
Not implemented in DB yet. -
getSenseKey
Not implemented in DB yet.
-