public class MapDictionary extends Dictionary
Dictionary.Version
Modifier and Type | Field and Description |
---|---|
protected static java.util.Random |
rand
Random number generator used by getRandomIndexWord()
|
protected java.util.Map<POS,java.util.Map<DictionaryFileType,java.util.Map<java.lang.Object,DictionaryElement>>> |
tableMap |
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 |
---|
MapDictionary(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 |
close()
Shuts down the dictionary, freeing resources.
|
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.
|
java.util.Map<java.lang.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.
|
addElement, checkEditable, createException, createIndexWord, createSynset, delete, 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, save, setRandom, setRestoreDictionary
protected static final java.util.Random rand
protected final java.util.Map<POS,java.util.Map<DictionaryFileType,java.util.Map<java.lang.Object,DictionaryElement>>> tableMap
public MapDictionary(org.w3c.dom.Document doc) throws JWNLException
JWNLException
public IndexWord getIndexWord(POS pos, java.lang.String lemma)
Dictionary
Dictionary.lookupIndexWord(POS, String)
.getIndexWord
in class Dictionary
pos
- The part-of-speechlemma
- The orthographic representation of the wordnull
if
no such entry existspublic java.util.Iterator<IndexWord> getIndexWordIterator(POS pos, java.lang.String substring)
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speech.substring
- substringIndexWord
s.public java.util.Iterator<IndexWord> getIndexWordIterator(POS pos)
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speechIndexWord
spublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
Dictionary
getRandomIndexWord
in class Dictionary
pos
- part of speechJWNLException
- JWNLExceptionpublic java.util.Iterator<Synset> getSynsetIterator(POS pos)
Dictionary
getSynsetIterator
in class Dictionary
pos
- The part-of-speech.Synset
s.public java.util.Iterator<Exc> getExceptionIterator(POS pos)
Dictionary
getExceptionIterator
in class Dictionary
pos
- the part-of-speechExc
spublic Synset getSynsetAt(POS pos, long offset)
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 filepublic Exc getException(POS pos, java.lang.String derivation)
Dictionary
getException
in class Dictionary
pos
- the exception file to look inderivation
- the word to look uppublic void close() throws JWNLException
Dictionary
close
in class Dictionary
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 java.util.Map<java.lang.Object,DictionaryElement> getTable(POS pos, DictionaryFileType fileType)