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, setRestoreDictionary
protected AbstractCachingDictionary(org.w3c.dom.Document doc) throws JWNLException
JWNLException
public 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
Dictionary
getExceptionIterator
in class Dictionary
pos
- the part-of-speechExc
sJWNLException
- JWNLExceptionpublic java.util.Iterator<Synset> getSynsetIterator(POS pos) throws JWNLException
Dictionary
getSynsetIterator
in class Dictionary
pos
- The part-of-speech.Synset
s.JWNLException
- JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos) throws JWNLException
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speechIndexWord
sJWNLException
- JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos, java.lang.String substring) throws JWNLException
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speech.substring
- substringIndexWord
s.JWNLException
- JWNLExceptionpublic void edit() throws JWNLException
Dictionary
edit
in class Dictionary
JWNLException
- JWNLExceptionpublic void addSynset(Synset synset) throws JWNLException
Dictionary
addSynset
in class Dictionary
synset
- synset to addJWNLException
- JWNLExceptionpublic void removeSynset(Synset synset) throws JWNLException
Dictionary
removeSynset
in class Dictionary
synset
- synset to removeJWNLException
- JWNLExceptionpublic void addException(Exc exc) throws JWNLException
Dictionary
addException
in class Dictionary
exc
- exception to addJWNLException
- JWNLExceptionpublic void removeException(Exc exc) throws JWNLException
Dictionary
removeException
in class Dictionary
exc
- exc to be removedJWNLException
- JWNLExceptionpublic void addIndexWord(IndexWord indexWord) throws JWNLException
Dictionary
addIndexWord
in class Dictionary
indexWord
- index word to addJWNLException
- JWNLExceptionpublic void removeIndexWord(IndexWord indexWord) throws JWNLException
Dictionary
removeIndexWord
in class Dictionary
indexWord
- index word to removeJWNLException
- JWNLExceptionpublic void cacheAll() throws JWNLException
JWNLException
protected void cachePOS(POS pos) throws JWNLException
JWNLException