|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.extjwnl.dictionary.Dictionary
net.sf.extjwnl.dictionary.AbstractCachingDictionary
net.sf.extjwnl.dictionary.FileBackedDictionary
public class FileBackedDictionary
A Dictionary
that retrieves objects from the text files
in the WordNet distribution directory.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
Dictionary.Version |
Field Summary | |
---|---|
static String |
CACHE_SIZE
The default cache size. |
static String |
DICTIONARY_ELEMENT_FACTORY
The class of FileDictionaryElementFactory to use. |
static String |
ENABLE_CACHING
The value should be "true" or "false". |
static String |
EXCEPTION_WORD_CACHE_SIZE
Size of the exception cache. |
static String |
FILE_MANAGER
File manager install parameter. |
static String |
INDEX_WORD_CACHE_SIZE
Size of the index word cache. |
static String |
MORPH
Morphological processor class install parameter. |
static String |
SYNSET_WORD_CACHE_SIZE
Size of the synset cache. |
Fields inherited from class net.sf.extjwnl.dictionary.AbstractCachingDictionary |
---|
isCachingEnabled |
Fields inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
CHECK_LEX_IDS_KEY, maxOffset, params |
Constructor Summary | |
---|---|
FileBackedDictionary(Document doc)
|
Method Summary | |
---|---|
void |
close()
Shut down the dictionary |
void |
delete()
|
void |
edit()
Puts the dictionary into edit mode. |
Exc |
getException(POS pos,
String derivation)
Lookup derivation in the exceptions file of part-of-speech pos and return an Exc object containing the results. |
Iterator<Exc> |
getExceptionIterator(POS pos)
Return an Iterator over all the Exceptions in the database. |
protected FileManager |
getFileManager()
Returns the file manager that backs this database. |
IndexWord |
getIndexWord(POS pos,
String lemma)
Look up a word in the database. |
Iterator<IndexWord> |
getIndexWordIterator(POS pos)
Return an Iterator over all the IndexWords of part-of-speech pos in the database. |
Iterator<IndexWord> |
getIndexWordIterator(POS pos,
String substring)
Return an Iterator over all the IndexWords of part-of-speech pos whose lemmas contain substring as a substring. |
IndexWord |
getRandomIndexWord(POS pos)
|
Synset |
getSynsetAt(POS pos,
long offset)
Return the Synset at offset offset from the database. |
Iterator<Synset> |
getSynsetIterator(POS pos)
Return an Iterator over all the Synsets of part-of-speech pos in the database. |
void |
save()
Saves the dictionary. |
Methods inherited from class net.sf.extjwnl.dictionary.AbstractCachingDictionary |
---|
addException, addIndexWord, addSynset, cacheAll, cacheException, cacheIndexWord, cachePOS, cacheSynset, clearCache, clearCache, clearException, clearIndexWord, clearSynset, getCacheCapacity, getCachedException, getCachedIndexWord, getCachedSynset, getCacheSizes, isCachingEnabled, removeException, removeIndexWord, removeSynset, setCacheCapacity, setCacheCapacity, setCachingEnabled |
Methods inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
addElement, createException, createIndexWord, createSynset, getDatabaseBackedInstance, getFileBackedInstance, getInstance, getInstance, getInstance, getMapBackedInstance, getMorphologicalProcessor, getRestoreDictionary, getVersion, isEditable, lookupAllIndexWords, lookupIndexWord, prepareQueryString, removeElement, setInstance, setMorphologicalProcessor, setRestoreDictionary, uninstall |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MORPH
public static final String FILE_MANAGER
public static final String DICTIONARY_ELEMENT_FACTORY
public static final String ENABLE_CACHING
public static final String CACHE_SIZE
public static final String INDEX_WORD_CACHE_SIZE
public static final String SYNSET_WORD_CACHE_SIZE
public static final String EXCEPTION_WORD_CACHE_SIZE
Constructor Detail |
---|
public FileBackedDictionary(Document doc) throws JWNLException
JWNLException
Method Detail |
---|
public void close()
Dictionary
close
in class Dictionary
public void delete() throws JWNLException
delete
in class Dictionary
JWNLException
protected FileManager getFileManager()
public Iterator<IndexWord> getIndexWordIterator(POS pos) throws JWNLException
Dictionary
getIndexWordIterator
in class AbstractCachingDictionary
pos
- The part-of-speech
IndexWord
s
JWNLException
- JWNLExceptionpublic Iterator<IndexWord> getIndexWordIterator(POS pos, String substring) throws JWNLException
Dictionary
getIndexWordIterator
in class AbstractCachingDictionary
pos
- The part-of-speech.substring
- substring
IndexWord
s.
JWNLException
- JWNLExceptionpublic IndexWord getIndexWord(POS pos, String lemma) throws JWNLException
Dictionary
Dictionary.lookupIndexWord(POS, String)
.
getIndexWord
in class Dictionary
pos
- The part-of-speech.lemma
- The orthographic representation of the word.
null
if
no such entry exists.
JWNLException
- JWNLExceptionpublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
getRandomIndexWord
in class Dictionary
JWNLException
public 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 from the database.
getSynsetAt
in class Dictionary
pos
- The part-of-speech file to look inoffset
- The offset of the synset in the file
JWNLException
- JWNLExceptionpublic Iterator<Exc> getExceptionIterator(POS pos) throws JWNLException
Dictionary
getExceptionIterator
in class AbstractCachingDictionary
pos
- the part-of-speech
Exc
s
JWNLException
- JWNLExceptionpublic Exc getException(POS pos, String derivation) throws JWNLException
Dictionary
getException
in class Dictionary
pos
- the exception file to look inderivation
- the word to look up
JWNLException
- JWNLExceptionpublic void edit() throws JWNLException
Dictionary
edit
in class AbstractCachingDictionary
JWNLException
- JWNLExceptionpublic void save() throws JWNLException
Dictionary
save
in class Dictionary
JWNLException
- JWNLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |