Class DatabaseBackedDictionary

All Implemented Interfaces:
Installable

public class DatabaseBackedDictionary extends AbstractCachingDictionary
  • Field Details

  • Constructor Details

    • DatabaseBackedDictionary

      public DatabaseBackedDictionary()
  • Method Details

    • install

      public void install(Map params) throws JWNLException
      Throws:
      JWNLException
    • getIndexWord

      public IndexWord getIndexWord(POS pos, String lemma) throws JWNLException
      Description copied from class: Dictionary
      Look up a word in the database. The search is case-independent, and phrases are separated by spaces ("look up", not "look_up"). Note: this method does not subject lemma to any morphological processing. If you want this, use Dictionary.lookupIndexWord(POS, String).
      Specified by:
      getIndexWord in class Dictionary
      Parameters:
      pos - The part-of-speech.
      lemma - The orthographic representation of the word.
      Returns:
      An IndexWord representing the word, or null if no such entry exists.
      Throws:
      JWNLException
    • getIndexWordIterator

      public Iterator getIndexWordIterator(POS pos) throws JWNLException
      Description copied from class: Dictionary
      Return an Iterator over all the IndexWords of part-of-speech pos in the database.
      Specified by:
      getIndexWordIterator in class Dictionary
      Parameters:
      pos - The part-of-speech
      Returns:
      An iterator over IndexWords
      Throws:
      JWNLException
    • getIndexWordIterator

      public Iterator getIndexWordIterator(POS pos, String substring) throws JWNLException
      Description copied from class: Dictionary
      Return an Iterator over all the IndexWords of part-of-speech pos whose lemmas contain substring as a substring.
      Specified by:
      getIndexWordIterator in class Dictionary
      Parameters:
      pos - The part-of-speech.
      Returns:
      An iterator over IndexWords.
      Throws:
      JWNLException
    • getRandomIndexWord

      public IndexWord getRandomIndexWord(POS pos) throws JWNLException
      Specified by:
      getRandomIndexWord in class Dictionary
      Throws:
      JWNLException
    • getSynsetAt

      public Synset getSynsetAt(POS pos, long offset) throws JWNLException
      Description copied from class: Dictionary
      Return the Synset at offset offset from the database.
      Specified by:
      getSynsetAt in class Dictionary
      Parameters:
      pos - The part-of-speech file to look in
      offset - The offset of the synset in the file
      Returns:
      A synset containing the parsed line from the database
      Throws:
      JWNLException
    • getSynsetIterator

      public Iterator getSynsetIterator(POS pos) throws JWNLException
      Description copied from class: Dictionary
      Return an Iterator over all the Synsets of part-of-speech pos in the database.
      Specified by:
      getSynsetIterator in class Dictionary
      Parameters:
      pos - The part-of-speech.
      Returns:
      An iterator over Synsets.
      Throws:
      JWNLException
    • getException

      public Exc getException(POS pos, String derivation) throws JWNLException
      Description copied from class: Dictionary
      Lookup derivation in the exceptions file of part-of-speech pos and return an Exc object containing the results.
      Specified by:
      getException in class Dictionary
      Parameters:
      pos - the exception file to look in
      derivation - the word to look up
      Returns:
      Exc the Exc object
      Throws:
      JWNLException
    • getExceptionIterator

      public Iterator getExceptionIterator(POS pos) throws JWNLException
      Description copied from class: Dictionary
      Return an Iterator over all the Exceptions in the database.
      Specified by:
      getExceptionIterator in class Dictionary
      Parameters:
      pos - the part-of-speech
      Returns:
      Iterator An iterator over Strings
      Throws:
      JWNLException
    • close

      public void close()
      Description copied from class: Dictionary
      Shut down the dictionary
      Specified by:
      close in class Dictionary
    • getUsageCount

      public int getUsageCount(long offset, String lemma)
      Not implemented in DB yet.
    • getSenseKey

      public String getSenseKey(long offset, String lemma)
      Not implemented in DB yet.