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, setRestoreDictionaryprotected 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
JWNLExceptionpublic IndexWord getIndexWord(POS pos, java.lang.String lemma)
DictionaryDictionary.lookupIndexWord(POS, String).getIndexWord in class Dictionarypos - 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)
DictionarygetIndexWordIterator in class Dictionarypos - The part-of-speech.substring - substringIndexWords.public java.util.Iterator<IndexWord> getIndexWordIterator(POS pos)
DictionarygetIndexWordIterator in class Dictionarypos - The part-of-speechIndexWordspublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
DictionarygetRandomIndexWord in class Dictionarypos - part of speechJWNLException - JWNLExceptionpublic java.util.Iterator<Synset> getSynsetIterator(POS pos)
DictionarygetSynsetIterator in class Dictionarypos - The part-of-speech.Synsets.public java.util.Iterator<Exc> getExceptionIterator(POS pos)
DictionarygetExceptionIterator in class Dictionarypos - the part-of-speechExcspublic Synset getSynsetAt(POS pos, long offset)
DictionarySynset at offset offset.getSynsetAt in class Dictionarypos - The part-of-speech file to look inoffset - The offset of the synset in the filepublic Exc getException(POS pos, java.lang.String derivation)
DictionarygetException in class Dictionarypos - the exception file to look inderivation - the word to look uppublic void close()
throws JWNLException
Dictionaryclose in class DictionaryJWNLException - JWNLExceptionpublic void edit()
throws JWNLException
Dictionaryedit in class DictionaryJWNLException - JWNLExceptionpublic void addSynset(Synset synset) throws JWNLException
DictionaryaddSynset in class Dictionarysynset - synset to addJWNLException - JWNLExceptionpublic void removeSynset(Synset synset) throws JWNLException
DictionaryremoveSynset in class Dictionarysynset - synset to removeJWNLException - JWNLExceptionpublic void addException(Exc exc) throws JWNLException
DictionaryaddException in class Dictionaryexc - exception to addJWNLException - JWNLExceptionpublic void removeException(Exc exc) throws JWNLException
DictionaryremoveException in class Dictionaryexc - exc to be removedJWNLException - JWNLExceptionpublic void addIndexWord(IndexWord indexWord) throws JWNLException
DictionaryaddIndexWord in class DictionaryindexWord - index word to addJWNLException - JWNLExceptionpublic void removeIndexWord(IndexWord indexWord) throws JWNLException
DictionaryremoveIndexWord in class DictionaryindexWord - index word to removeJWNLException - JWNLExceptionpublic java.util.Map<java.lang.Object,DictionaryElement> getTable(POS pos, DictionaryFileType fileType)