ar.com.ktulu.dict
Class CompressedDatabase

java.lang.Object
  |
  +--ar.com.ktulu.dict.Database
        |
        +--ar.com.ktulu.dict.CompressedDatabase

public class CompressedDatabase
extends Database

Support for dictionaries compressed with gzip.

Author:
Luis Parravicini

Constructor Summary
CompressedDatabase(java.lang.String name, java.lang.String fdb, java.lang.String fidx)
           
 
Method Summary
 Matches define(java.lang.String word)
          Used by the server to process a "DEFINE" command.
 Definition getWordDefinition(Key k)
          Returns the definition of the word stored in k.
protected  void initKeys()
          Reads the index into memory.
 int keySize()
          Returns the number of headwords in the database.
 Matches match(java.lang.String word, Strategy strat)
          Used by the server to process a "MATCH" command.
 
Methods inherited from class ar.com.ktulu.dict.Database
getInfo, getName, getProperty, getProperty, getShortInfo, setInfo, setName, setShortInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressedDatabase

public CompressedDatabase(java.lang.String name,
                          java.lang.String fdb,
                          java.lang.String fidx)
                   throws DatabaseException
Method Detail

initKeys

protected void initKeys()
                 throws java.io.IOException
Reads the index into memory. For this, it puts all the headwords into a KeyList.

java.io.IOException
See Also:
KeyList

keySize

public int keySize()
Description copied from class: Database
Returns the number of headwords in the database.

Specified by:
keySize in class Database

define

public Matches define(java.lang.String word)
Description copied from class: Database
Used by the server to process a "DEFINE" command.

Specified by:
define in class Database

match

public Matches match(java.lang.String word,
                     Strategy strat)
              throws DatabaseException
Description copied from class: Database
Used by the server to process a "MATCH" command.

Specified by:
match in class Database
DatabaseException

getWordDefinition

public Definition getWordDefinition(Key k)
                             throws DatabaseException
Description copied from class: Database
Returns the definition of the word stored in k.

Specified by:
getWordDefinition in class Database
DatabaseException