|
||||||||||
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.MapBackedDictionary
public class MapBackedDictionary
A Dictionary
backed by Map
s. Warning: this has huge memory requirements.
Make sure to start the interpreter with a large enough free memory pool to accommodate this.
Nested Class Summary | |
---|---|
static class |
MapBackedDictionary.IndexWordIterator
|
Nested classes/interfaces inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
Dictionary.Version |
Field Summary | |
---|---|
static String |
MORPH
MorphologicalProcessor class install parameter. |
Fields inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
CHECK_LEX_IDS_KEY, maxOffset, params |
Constructor Summary | |
---|---|
MapBackedDictionary(Document doc)
|
Method Summary | |
---|---|
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 |
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. |
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. |
Map<Object,DictionaryElement> |
getTable(POS pos,
DictionaryFileType fileType)
|
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 |
save()
Saves the dictionary. |
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
MorphologicalProcessor
class install parameter. The value should be the
class of MorphologicalProcessor
to use.
Constructor Detail |
---|
public MapBackedDictionary(Document doc) throws JWNLException
JWNLException
Method Detail |
---|
public void delete() throws JWNLException
delete
in class Dictionary
JWNLException
public IndexWord getIndexWord(POS pos, String lemma)
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.public Iterator<IndexWord> getIndexWordIterator(POS pos, String substring)
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speech.substring
- substring
IndexWord
s.public Iterator<IndexWord> getIndexWordIterator(POS pos)
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speech
IndexWord
spublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
getRandomIndexWord
in class Dictionary
JWNLException
public Iterator<Synset> getSynsetIterator(POS pos)
Dictionary
getSynsetIterator
in class Dictionary
pos
- The part-of-speech.
Synset
s.public Iterator<Exc> getExceptionIterator(POS pos)
Dictionary
getExceptionIterator
in class Dictionary
pos
- the part-of-speech
Exc
spublic Synset getSynsetAt(POS pos, long offset)
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
public Exc getException(POS pos, String derivation)
Dictionary
getException
in class Dictionary
pos
- the exception file to look inderivation
- the word to look up
public void close()
Dictionary
close
in class Dictionary
public void edit() throws JWNLException
Dictionary
edit
in class Dictionary
JWNLException
- JWNLExceptionpublic void save() throws JWNLException
Dictionary
save
in class Dictionary
JWNLException
- JWNLExceptionpublic void addSynset(Synset synset) throws JWNLException
Dictionary
addSynset
in class Dictionary
synset
- synset to add
JWNLException
- JWNLExceptionpublic void removeSynset(Synset synset) throws JWNLException
Dictionary
removeSynset
in class Dictionary
synset
- synset to remove
JWNLException
- JWNLExceptionpublic void addException(Exc exc) throws JWNLException
Dictionary
addException
in class Dictionary
exc
- exception to add
JWNLException
- JWNLExceptionpublic void removeException(Exc exc) throws JWNLException
Dictionary
removeException
in class Dictionary
exc
- exc to be removed
JWNLException
- JWNLExceptionpublic void addIndexWord(IndexWord indexWord) throws JWNLException
Dictionary
addIndexWord
in class Dictionary
indexWord
- index word to add
JWNLException
- JWNLExceptionpublic void removeIndexWord(IndexWord indexWord) throws JWNLException
Dictionary
removeIndexWord
in class Dictionary
indexWord
- index word to remove
JWNLException
- JWNLExceptionpublic Map<Object,DictionaryElement> getTable(POS pos, DictionaryFileType fileType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |