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 classprivate classprivate classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DatabaseManagerprivate DatabaseDictionaryElementFactorystatic final Stringstatic final Stringstatic final StringMorphologicalProcessorclass install parameter. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDatabaseBackedDictionary(MorphologicalProcessor morph, DatabaseDictionaryElementFactory elementFactory, DatabaseManager dbManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shut down the dictionarygetException(POS pos, String derivation) Lookupderivationin the exceptions file of part-of-speechposand 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 theSynsetat offsetoffsetfrom the database.getSynsetIterator(POS pos) Return an Iterator over all the Synsets of part-of-speech pos in the database.intgetUsageCount(long offset, String lemma) Not implemented in DB yet.voidMethods inherited from class AbstractCachingDictionary
cacheException, cacheIndexWord, cacheSynset, clearCache, clearCache, getCacheCapacity, getCachedException, getCachedIndexWord, getCachedSynset, getCacheSizes, isCachingEnabled, setCacheCapacity, setCacheCapacity, setCachingEnabledMethods inherited from class Dictionary
getInstance, getMorphologicalProcessor, lookupAllIndexWords, lookupIndexWord, prepareQueryString, setDictionary, uninstall
-
Field Details
-
MORPH
MorphologicalProcessorclass install parameter. The value should be the class ofMorphologicalProcessorto 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:DictionaryLook 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:
getIndexWordin classDictionary- Parameters:
pos- The part-of-speech.lemma- The orthographic representation of the word.- Returns:
- An IndexWord representing the word, or
nullif no such entry exists. - Throws:
JWNLException
-
getIndexWordIterator
Description copied from class:DictionaryReturn an Iterator over all the IndexWords of part-of-speech pos in the database.- Specified by:
getIndexWordIteratorin classDictionary- Parameters:
pos- The part-of-speech- Returns:
- An iterator over
IndexWords - Throws:
JWNLException
-
getIndexWordIterator
Description copied from class:DictionaryReturn an Iterator over all the IndexWords of part-of-speech pos whose lemmas contain substring as a substring.- Specified by:
getIndexWordIteratorin classDictionary- Parameters:
pos- The part-of-speech.- Returns:
- An iterator over
IndexWords. - Throws:
JWNLException
-
getRandomIndexWord
- Specified by:
getRandomIndexWordin classDictionary- Throws:
JWNLException
-
getSynsetAt
Description copied from class:DictionaryReturn theSynsetat offsetoffsetfrom the database.- Specified by:
getSynsetAtin 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:DictionaryReturn an Iterator over all the Synsets of part-of-speech pos in the database.- Specified by:
getSynsetIteratorin classDictionary- Parameters:
pos- The part-of-speech.- Returns:
- An iterator over
Synsets. - Throws:
JWNLException
-
getException
Description copied from class:DictionaryLookupderivationin the exceptions file of part-of-speechposand return an Exc object containing the results.- Specified by:
getExceptionin 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:DictionaryReturn an Iterator over all the Exceptions in the database.- Specified by:
getExceptionIteratorin classDictionary- Parameters:
pos- the part-of-speech- Returns:
- Iterator An iterator over
Strings - Throws:
JWNLException
-
close
public void close()Description copied from class:DictionaryShut down the dictionary- Specified by:
closein classDictionary
-
getUsageCount
Not implemented in DB yet. -
getSenseKey
-