public class MapBackedDictionary extends Dictionary
Dictionary backed by Maps. Warning: this has huge memory requirements.
Make sure to start the interpreter with a large enough free memory pool to accomodate this.| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_TYPE
File type install parameter.
|
static String |
MORPH
MorphologicalProcessor class install parameter. |
static String |
PATH
The path of the dictionary files
|
| Constructor and Description |
|---|
MapBackedDictionary() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shut down the dictionary
|
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 |
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 |
getIndexWordIterator(POS pos)
Return an Iterator over all the IndexWords of part-of-speech
pos in the database.
|
Iterator |
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) |
String |
getSenseKey(long offset,
String lemma)
Not implemented in Map yet.
|
Synset |
getSynsetAt(POS pos,
long offset)
Return the
Synset at offset offset from the database. |
Iterator |
getSynsetIterator(POS pos)
Return an Iterator over all the Synsets of part-of-speech pos
in the database.
|
int |
getUsageCount(long offset,
String lemma)
Not implemented in Map yet.
|
void |
install(Map params)
Install a
MapBackedDictionary from a map of parameters. |
static void |
install(String searchDir,
Class dictionaryFileType) |
static void |
install(String searchDir,
Class dictionaryFileType,
MorphologicalProcessor morph) |
getInstance, getMorphologicalProcessor, lookupAllIndexWords, lookupIndexWord, prepareQueryString, setDictionary, uninstallpublic static final String MORPH
MorphologicalProcessor class install parameter. The value should be the
class of MorphologicalProcessor to use.public static final String FILE_TYPE
DictionaryFileType.public static final String PATH
public static void install(String searchDir, Class dictionaryFileType) throws JWNLException
JWNLExceptionpublic static void install(String searchDir, Class dictionaryFileType, MorphologicalProcessor morph) throws JWNLException
JWNLExceptionpublic void install(Map params) throws JWNLException
MapBackedDictionary from a map of parameters. The parameters are chosen from the static
variables above.JWNLExceptionpublic IndexWord getIndexWord(POS pos, String lemma)
DictionaryDictionary.lookupIndexWord(POS, String).getIndexWord in class Dictionarypos - The part-of-speech.lemma - The orthographic representation of the word.null if
no such entry exists.public Iterator getIndexWordIterator(POS pos, String substring)
DictionarygetIndexWordIterator in class Dictionarypos - The part-of-speech.IndexWords.public Iterator getIndexWordIterator(POS pos)
DictionarygetIndexWordIterator in class Dictionarypos - The part-of-speechIndexWordspublic IndexWord getRandomIndexWord(POS pos) throws JWNLException
getRandomIndexWord in class DictionaryJWNLExceptionpublic Iterator getSynsetIterator(POS pos)
DictionarygetSynsetIterator in class Dictionarypos - The part-of-speech.Synsets.public Iterator getExceptionIterator(POS pos)
DictionarygetExceptionIterator in class Dictionarypos - the part-of-speechStringspublic Synset getSynsetAt(POS pos, long offset)
DictionarySynset at offset offset from the database.getSynsetAt in class Dictionarypos - The part-of-speech file to look inoffset - The offset of the synset in the filepublic Exc getException(POS pos, String derivation)
Dictionaryderivation in the exceptions file of part-of-speech
pos and return an Exc object containing the results.getException in class Dictionarypos - the exception file to look inderivation - the word to look uppublic void close()
Dictionaryclose in class Dictionarypublic int getUsageCount(long offset,
String lemma)
Copyright © 2023. All rights reserved.