public abstract class AbstractCachingDictionary extends Dictionary
Dictionary to provide caching of elements.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractCachingDictionary.IndexWordIterator |
Dictionary.Version| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isCachingEnabled |
CHECK_LEX_IDS_KEY, DEFAULT_RESOURCE_CONFIG_PATH, DICTIONARY_ELEMENT_FACTORY, EDIT_CHECK_ALIEN_POINTERS, EDIT_MANAGE_SYMMETRIC_POINTERS, elementFactory, MORPHOLOGICAL_PROCESSOR, params| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCachingDictionary(org.w3c.dom.Document doc) |
| Modifier and Type | Method and Description |
|---|---|
void |
addException(Exc exc)
Adds exception to the dictionary.
|
void |
addIndexWord(IndexWord indexWord)
Adds index word to the dictionary.
|
void |
addSynset(Synset synset)
Adds synset to the dictionary.
|
void |
cacheAll() |
protected Exc |
cacheException(Exc exception) |
protected IndexWord |
cacheIndexWord(IndexWord word) |
protected void |
cachePOS(POS pos) |
void |
cacheSynset(Synset synset) |
void |
clearCache() |
void |
clearCache(DictionaryElementType elementType) |
protected void |
clearException(POS pos,
java.lang.Object key) |
protected void |
clearIndexWord(POS pos,
java.lang.Object key) |
void |
clearSynset(POS pos,
java.lang.Object key) |
void |
edit()
Puts the dictionary into edit mode.
|
long |
getCacheCapacity(DictionaryElementType type) |
protected Exc |
getCachedException(POS pos,
java.lang.Object key) |
protected IndexWord |
getCachedIndexWord(POS pos,
java.lang.Object key) |
protected Synset |
getCachedSynset(POS pos,
java.lang.Object key) |
int |
getCacheSizes(DictionaryElementType type) |
java.util.Iterator<Exc> |
getExceptionIterator(POS pos)
Returns an iterator over all the exceptions.
|
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.
|
java.util.Iterator<Synset> |
getSynsetIterator(POS pos)
Returns an iterator over all the synsets of part-of-speech pos.
|
boolean |
isCachingEnabled() |
void |
removeException(Exc exc)
Removes the exc from the dictionary.
|
void |
removeIndexWord(IndexWord indexWord)
Removes indexWord from the dictionary.
|
void |
removeSynset(Synset synset)
Removes synset from the dictionary.
|
void |
setCacheCapacity(DictionaryElementType type,
int size) |
void |
setCacheCapacity(int size) |
void |
setCachingEnabled(boolean cachingEnabled) |
addElement, checkEditable, close, createException, createIndexWord, createSynset, delete, getCheckAlienPointers, getDatabaseBackedInstance, getDefaultResourceInstance, getException, getFileBackedInstance, getFrames, getFrames, getIndexWord, getInstance, getInstance, getManageSymmetricPointers, getMapBackedInstance, getMessages, getMorphologicalProcessor, getRandom, getRandomIndexWord, getResourceInstance, getRestoreDictionary, getSynsetAt, getVerbFrameIndices, getVersion, getWordBySenseKey, isEditable, lookupAllIndexWords, lookupIndexWord, prepareQueryString, removeElement, resolveAllPointers, resolvePointers, save, setRandom, setRestoreDictionaryprotected AbstractCachingDictionary(org.w3c.dom.Document doc)
throws JWNLException
JWNLExceptionpublic boolean isCachingEnabled()
public void setCachingEnabled(boolean cachingEnabled)
public int getCacheSizes(DictionaryElementType type)
public long getCacheCapacity(DictionaryElementType type)
public void setCacheCapacity(int size)
public void setCacheCapacity(DictionaryElementType type, int size)
public void clearCache()
public void clearCache(DictionaryElementType elementType)
protected void clearIndexWord(POS pos, java.lang.Object key)
public void cacheSynset(Synset synset)
public void clearSynset(POS pos, java.lang.Object key)
protected void clearException(POS pos, java.lang.Object key)
public java.util.Iterator<Exc> getExceptionIterator(POS pos) throws JWNLException
DictionarygetExceptionIterator in class Dictionarypos - the part-of-speechExcsJWNLException - JWNLExceptionpublic java.util.Iterator<Synset> getSynsetIterator(POS pos) throws JWNLException
DictionarygetSynsetIterator in class Dictionarypos - The part-of-speech.Synsets.JWNLException - JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos) throws JWNLException
DictionarygetIndexWordIterator in class Dictionarypos - The part-of-speechIndexWordsJWNLException - JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos, java.lang.String substring) throws JWNLException
DictionarygetIndexWordIterator in class Dictionarypos - The part-of-speech.substring - substringIndexWords.JWNLException - JWNLExceptionpublic void edit()
throws JWNLException
Dictionaryedit in class DictionaryJWNLException - JWNLExceptionpublic void addSynset(Synset synset) throws JWNLException
DictionaryaddSynset in class Dictionarysynset - synset to addJWNLException - JWNLExceptionpublic void removeSynset(Synset synset) throws JWNLException
DictionaryremoveSynset in class Dictionarysynset - synset to removeJWNLException - JWNLExceptionpublic void addException(Exc exc) throws JWNLException
DictionaryaddException in class Dictionaryexc - exception to addJWNLException - JWNLExceptionpublic void removeException(Exc exc) throws JWNLException
DictionaryremoveException in class Dictionaryexc - exc to be removedJWNLException - JWNLExceptionpublic void addIndexWord(IndexWord indexWord) throws JWNLException
DictionaryaddIndexWord in class DictionaryindexWord - index word to addJWNLException - JWNLExceptionpublic void removeIndexWord(IndexWord indexWord) throws JWNLException
DictionaryremoveIndexWord in class DictionaryindexWord - index word to removeJWNLException - JWNLExceptionpublic void cacheAll()
throws JWNLException
JWNLExceptionprotected void cachePOS(POS pos) throws JWNLException
JWNLException