public abstract class Dictionary extends java.lang.Object implements Installable
| Modifier and Type | Field and Description |
|---|---|
private static Dictionary |
_dictionary
The singleton instance of the dictionary to be used throughout the system.
|
private static MessageLog |
_log |
private MorphologicalProcessor |
_morph |
| Modifier | Constructor and Description |
|---|---|
protected |
Dictionary()
Create a Dictionary that does not do morphological processing.
|
protected |
Dictionary(MorphologicalProcessor morph)
Create a Dictionary using the specified MorphologicalProcessor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Shut down the dictionary
|
abstract Exc |
getException(POS pos,
java.lang.String derivation)
Lookup
derivation in the exceptions file of part-of-speech
pos and return an Exc object containing the results. |
abstract java.util.Iterator |
getExceptionIterator(POS pos)
Return an Iterator over all the Exceptions in the database.
|
abstract IndexWord |
getIndexWord(POS pos,
java.lang.String lemma)
Look up a word in the database.
|
abstract java.util.Iterator |
getIndexWordIterator(POS pos)
Return an Iterator over all the IndexWords of part-of-speech
pos in the database.
|
abstract java.util.Iterator |
getIndexWordIterator(POS pos,
java.lang.String substring)
Return an Iterator over all the IndexWords of part-of-speech pos
whose lemmas contain substring as a substring.
|
static Dictionary |
getInstance() |
MorphologicalProcessor |
getMorphologicalProcessor() |
abstract IndexWord |
getRandomIndexWord(POS pos) |
abstract Synset |
getSynsetAt(POS pos,
long offset)
Return the
Synset at offset offset from the database. |
abstract java.util.Iterator |
getSynsetIterator(POS pos)
Return an Iterator over all the Synsets of part-of-speech pos
in the database.
|
IndexWordSet |
lookupAllIndexWords(java.lang.String lemma)
Return a set of
IndexWords, with each element in the set
corresponding to a part-of-speech of word. |
IndexWord |
lookupIndexWord(POS pos,
java.lang.String lemma)
Main word lookup procedure.
|
protected static java.lang.String |
prepareQueryString(java.lang.String lemma)
Prepares the lemma for being used in a lookup operation.
|
protected static void |
setDictionary(Dictionary dictionary) |
static void |
uninstall() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinstallprivate static final MessageLog _log
private static Dictionary _dictionary
private MorphologicalProcessor _morph
protected Dictionary()
protected Dictionary(MorphologicalProcessor morph)
public static Dictionary getInstance()
protected static void setDictionary(Dictionary dictionary)
public static void uninstall()
protected static java.lang.String prepareQueryString(java.lang.String lemma)
lemma - the lemma to be preparedpublic abstract java.util.Iterator getIndexWordIterator(POS pos) throws JWNLException
pos - The part-of-speechIndexWordsJWNLExceptionpublic abstract java.util.Iterator getIndexWordIterator(POS pos, java.lang.String substring) throws JWNLException
pos - The part-of-speech.IndexWords.JWNLExceptionpublic abstract IndexWord getIndexWord(POS pos, java.lang.String lemma) throws JWNLException
lookupIndexWord(POS, String).pos - The part-of-speech.lemma - The orthographic representation of the word.null if
no such entry exists.JWNLExceptionpublic abstract IndexWord getRandomIndexWord(POS pos) throws JWNLException
JWNLExceptionpublic abstract java.util.Iterator getSynsetIterator(POS pos) throws JWNLException
pos - The part-of-speech.Synsets.JWNLExceptionpublic abstract Synset getSynsetAt(POS pos, long offset) throws JWNLException
Synset at offset offset from the database.pos - The part-of-speech file to look inoffset - The offset of the synset in the fileJWNLExceptionpublic abstract java.util.Iterator getExceptionIterator(POS pos) throws JWNLException
pos - the part-of-speechStringsJWNLExceptionpublic abstract Exc getException(POS pos, java.lang.String derivation) throws JWNLException
derivation in the exceptions file of part-of-speech
pos and return an Exc object containing the results.pos - the exception file to look inderivation - the word to look upJWNLExceptionpublic abstract void close()
public MorphologicalProcessor getMorphologicalProcessor()
public IndexWord lookupIndexWord(POS pos, java.lang.String lemma) throws JWNLException
pos - the part-of-speech of the word to look uplemma - the lemma to look upJWNLExceptionpublic IndexWordSet lookupAllIndexWords(java.lang.String lemma) throws JWNLException
IndexWords, with each element in the set
corresponding to a part-of-speech of word.lemma - the word for which to lookup sensesJWNLException