public class FileBackedDictionary extends AbstractCachingDictionary
Dictionary
that retrieves objects from the text files
in the WordNet distribution directory.AbstractCachingDictionary.IndexWordIterator
Dictionary.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.
|
isCachingEnabled
CHECK_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, setCachingEnabled
addElement, 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, setRestoreDictionary
public 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
JWNLException
public void close() throws JWNLException
Dictionary
close
in class Dictionary
JWNLException
- JWNLExceptionpublic boolean delete() throws JWNLException
Dictionary
delete
in class Dictionary
JWNLException
- JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos) throws JWNLException
Dictionary
getIndexWordIterator
in class AbstractCachingDictionary
pos
- The part-of-speechIndexWord
sJWNLException
- JWNLExceptionpublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos, java.lang.String substring) throws JWNLException
Dictionary
getIndexWordIterator
in class AbstractCachingDictionary
pos
- The part-of-speech.substring
- substringIndexWord
s.JWNLException
- JWNLExceptionpublic IndexWord getIndexWord(POS pos, java.lang.String lemma) throws JWNLException
Dictionary
Dictionary.lookupIndexWord(POS, String)
.getIndexWord
in class Dictionary
pos
- The part-of-speechlemma
- The orthographic representation of the wordnull
if
no such entry existsJWNLException
- JWNLExceptionpublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
Dictionary
getRandomIndexWord
in class Dictionary
pos
- part of speechJWNLException
- JWNLExceptionpublic java.util.Iterator<Synset> getSynsetIterator(POS pos) throws JWNLException
Dictionary
getSynsetIterator
in class AbstractCachingDictionary
pos
- The part-of-speech.Synset
s.JWNLException
- JWNLExceptionpublic Synset getSynsetAt(POS pos, long offset) throws JWNLException
Dictionary
Synset
at offset offset.getSynsetAt
in class Dictionary
pos
- 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
Dictionary
getExceptionIterator
in class AbstractCachingDictionary
pos
- the part-of-speechExc
sJWNLException
- JWNLExceptionpublic Exc getException(POS pos, java.lang.String derivation) throws JWNLException
Dictionary
getException
in class Dictionary
pos
- the exception file to look inderivation
- the word to look upJWNLException
- JWNLExceptionpublic void edit() throws JWNLException
Dictionary
edit
in class AbstractCachingDictionary
JWNLException
- JWNLExceptionpublic void save() throws JWNLException
Dictionary
save
in class Dictionary
JWNLException
- JWNLExceptionpublic void cacheAll() throws JWNLException
cacheAll
in class AbstractCachingDictionary
JWNLException