public class FileBackedDictionary extends AbstractCachingDictionary
Dictionary that retrieves objects from the text files
in the WordNet distribution directory.AbstractCachingDictionary.IndexWordIteratorDictionary.Version| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CACHE_SIZE
The default cache size.
|
static java.lang.String |
ENABLE_CACHING
The value should be "true" or "false".
|
static java.lang.String |
EXCEPTION_WORD_CACHE_SIZE
Size of the exception cache.
|
static java.lang.String |
FILE_MANAGER
File manager install parameter.
|
static java.lang.String |
INDEX_WORD_CACHE_SIZE
Size of the index word cache.
|
static java.lang.String |
SYNSET_WORD_CACHE_SIZE
Size of the synset cache.
|
isCachingEnabledCHECK_LEX_IDS_KEY, DEFAULT_RESOURCE_CONFIG_PATH, DICTIONARY_ELEMENT_FACTORY, EDIT_CHECK_ALIEN_POINTERS, EDIT_MANAGE_SYMMETRIC_POINTERS, elementFactory, MORPHOLOGICAL_PROCESSOR, params| Constructor and Description |
|---|
FileBackedDictionary(org.w3c.dom.Document doc) |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheAll() |
void |
close()
Shuts down the dictionary, freeing resources.
|
boolean |
delete()
Deletes dictionary files.
|
void |
edit()
Puts the dictionary into edit mode.
|
Exc |
getException(POS pos,
java.lang.String derivation)
Looks up derivation in the exceptions file of part-of-speech
pos and return an Exc object containing the results.
|
java.util.Iterator<Exc> |
getExceptionIterator(POS pos)
Returns an iterator over all the exceptions.
|
IndexWord |
getIndexWord(POS pos,
java.lang.String lemma)
Looks up a word.
|
java.util.Iterator<IndexWord> |
getIndexWordIterator(POS pos)
Returns an Iterator over all the IndexWords of part-of-speech pos.
|
java.util.Iterator<IndexWord> |
getIndexWordIterator(POS pos,
java.lang.String substring)
Returns an Iterator over all the IndexWords of part-of-speech pos
whose lemmas contain substring as a substring.
|
IndexWord |
getRandomIndexWord(POS pos)
Returns a random index word of a specified pos.
|
Synset |
getSynsetAt(POS pos,
long offset)
Returns the
Synset at offset offset. |
java.util.Iterator<Synset> |
getSynsetIterator(POS pos)
Returns an iterator over all the synsets of part-of-speech pos.
|
void |
save()
Saves the dictionary.
|
addException, addIndexWord, addSynset, cacheException, cacheIndexWord, cachePOS, cacheSynset, clearCache, clearCache, clearException, clearIndexWord, clearSynset, getCacheCapacity, getCachedException, getCachedIndexWord, getCachedSynset, getCacheSizes, isCachingEnabled, removeException, removeIndexWord, removeSynset, setCacheCapacity, setCacheCapacity, setCachingEnabledaddElement, checkEditable, createException, createIndexWord, createSynset, getCheckAlienPointers, getDatabaseBackedInstance, getDefaultResourceInstance, getFileBackedInstance, getFrames, getFrames, getInstance, getInstance, getManageSymmetricPointers, getMapBackedInstance, getMessages, getMorphologicalProcessor, getRandom, getResourceInstance, getRestoreDictionary, getVerbFrameIndices, getVersion, getWordBySenseKey, isEditable, lookupAllIndexWords, lookupIndexWord, prepareQueryString, removeElement, resolveAllPointers, resolvePointers, setRandom, setRestoreDictionarypublic static final java.lang.String FILE_MANAGER
public static final java.lang.String ENABLE_CACHING
public static final java.lang.String CACHE_SIZE
public static final java.lang.String INDEX_WORD_CACHE_SIZE
public static final java.lang.String SYNSET_WORD_CACHE_SIZE
public static final java.lang.String EXCEPTION_WORD_CACHE_SIZE
public FileBackedDictionary(org.w3c.dom.Document doc)
throws JWNLException
JWNLExceptionpublic void close()
throws JWNLException
Dictionaryclose in class DictionaryJWNLException - JWNLExceptionpublic boolean delete()
throws JWNLException
Dictionarydelete in class DictionaryJWNLException - JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos) throws JWNLException
DictionarygetIndexWordIterator in class AbstractCachingDictionarypos - The part-of-speechIndexWordsJWNLException - JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos, java.lang.String substring) throws JWNLException
DictionarygetIndexWordIterator in class AbstractCachingDictionarypos - The part-of-speech.substring - substringIndexWords.JWNLException - JWNLExceptionpublic IndexWord getIndexWord(POS pos, java.lang.String lemma) throws JWNLException
DictionaryDictionary.lookupIndexWord(POS, String).getIndexWord in class Dictionarypos - The part-of-speechlemma - The orthographic representation of the wordnull if
no such entry existsJWNLException - JWNLExceptionpublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
DictionarygetRandomIndexWord in class Dictionarypos - part of speechJWNLException - JWNLExceptionpublic java.util.Iterator<Synset> getSynsetIterator(POS pos) throws JWNLException
DictionarygetSynsetIterator in class AbstractCachingDictionarypos - The part-of-speech.Synsets.JWNLException - JWNLExceptionpublic Synset getSynsetAt(POS pos, long offset) throws JWNLException
DictionarySynset at offset offset.getSynsetAt in class Dictionarypos - The part-of-speech file to look inoffset - The offset of the synset in the fileJWNLException - JWNLExceptionpublic java.util.Iterator<Exc> getExceptionIterator(POS pos) throws JWNLException
DictionarygetExceptionIterator in class AbstractCachingDictionarypos - the part-of-speechExcsJWNLException - JWNLExceptionpublic Exc getException(POS pos, java.lang.String derivation) throws JWNLException
DictionarygetException in class Dictionarypos - the exception file to look inderivation - the word to look upJWNLException - JWNLExceptionpublic void edit()
throws JWNLException
Dictionaryedit in class AbstractCachingDictionaryJWNLException - JWNLExceptionpublic void save()
throws JWNLException
Dictionarysave in class DictionaryJWNLException - JWNLExceptionpublic void cacheAll()
throws JWNLException
cacheAll in class AbstractCachingDictionaryJWNLException