Email Answering System
Version 1.0

com.ninecode.email.beans.slave.dictionary
Class DictionaryBean

java.lang.Object
  |
  +--com.ninecode.email.beans.slave.dictionary.DictionaryBean

public class DictionaryBean
extends Object

Bean to handle dictionary requests.

Author:
Derrick Oswald

Field Summary
protected  Connection mConnection
          The connection to the database.
protected  int mFuzzyThreshold
          The maximum Levenshtein distance allowed.
protected  int mRecordLimit
          The maximum number of records returned.
protected  String mWord
          The word to look up.
 
Constructor Summary
DictionaryBean()
          Creates a new instance of DictionaryBean
 
Method Summary
 Definition[] approximateLookup()
          Perform an approximate query.
 Definition[] exactLookup()
          Perform an exact query.
 Definition[] fuzzyLookup()
           
 String getApproximateQuery()
           
protected  Connection getConnection()
          Get the database connection.
 String getExactQuery()
           
 int getFuzzyThreshold()
          Get the maximum Levenshtein distance allowed.
 int getRecordLimit()
          Get the upper limit on returned records.
 String getSoundexQuery()
           
 String getText()
           
protected  String getWord()
           
 String help()
           
protected  void limit(StringBuffer query, String value, String column)
           
protected  void setConnection(Connection connection)
          Set the database connection.
 void setFuzzyThreshold(int threshold)
          Set the maximum Levenshtein distance allowed.
 void setRecordLimit(int limit)
          Set the limit on returned records.
 void setText(String text)
           
protected  void setWord(String word)
           
 Definition[] soundexLookup()
          Perform a soundex query.
 String toString()
          Generate a string representing the state of this bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mConnection

protected Connection mConnection
The connection to the database.


mWord

protected String mWord
The word to look up.


mRecordLimit

protected int mRecordLimit
The maximum number of records returned.


mFuzzyThreshold

protected int mFuzzyThreshold
The maximum Levenshtein distance allowed.

Constructor Detail

DictionaryBean

public DictionaryBean()
Creates a new instance of DictionaryBean

Method Detail

getConnection

protected Connection getConnection()
Get the database connection.

Returns:
The connection to the word database.

setConnection

protected void setConnection(Connection connection)
Set the database connection.

Parameters:
connection - The connection to use to query the word database.

getRecordLimit

public int getRecordLimit()
Get the upper limit on returned records.

Returns:
The maximum number of records that will be returned bay a query.

setRecordLimit

public void setRecordLimit(int limit)
Set the limit on returned records.

Parameters:
limit - The new value of property recordLimit.

getFuzzyThreshold

public int getFuzzyThreshold()
Get the maximum Levenshtein distance allowed.

Returns:
The maximum Levenshtein distance allowed.

setFuzzyThreshold

public void setFuzzyThreshold(int threshold)
Set the maximum Levenshtein distance allowed. Note that this applies to the sum of the distances of all specified terms.

Parameters:
threshold - The new value for property fuzzyThreshold.

getWord

protected String getWord()

setWord

protected void setWord(String word)

help

public String help()

limit

protected void limit(StringBuffer query,
                     String value,
                     String column)

getExactQuery

public String getExactQuery()

getApproximateQuery

public String getApproximateQuery()

getSoundexQuery

public String getSoundexQuery()

exactLookup

public Definition[] exactLookup()
                         throws SQLException
Perform an exact query. Everything in uppercase.

SQLException

approximateLookup

public Definition[] approximateLookup()
                               throws SQLException
Perform an approximate query. Everything in uppercase.

SQLException

fuzzyLookup

public Definition[] fuzzyLookup()
                         throws SQLException
SQLException

soundexLookup

public Definition[] soundexLookup()
                           throws SQLException
Perform a soundex query. Everything in uppercase.

SQLException

setText

public void setText(String text)

getText

public String getText()

toString

public String toString()
Generate a string representing the state of this bean.

Overrides:
toString in class Object
Returns:
A string of the form:
 theword
 

Email Answering System
Version 1.0

Copyright © 2003 Derrick Oswald. All rights reserved.