|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fido.db.DictionaryTable
The dictionary is a simple map that takes a String input, representing a word in the sentence, and returns a collection of zero to many WordSenses. Each WordSense is a distinct definition of a word. Each word sense also contains a grammar string that is used to connect words in the user input.
By default, the dictionary contains two special words. These words cannot be matched by words of the same name in a sentence because these words are stored as all uppercase and the Word Separation module converts all words from the sentence to lower case.
ObjectTable
,
WordSense
,
WordSeparation
Constructor Summary | |
DictionaryTable()
Creates a new instance of DictionaryTable |
Method Summary | |
int |
add(java.lang.String word,
java.lang.String grammarString,
int objectId)
Adds a new word sense to a word. |
boolean |
contains(java.lang.String word)
Tests for the existance of a word in the dictionary. |
void |
delete(java.lang.String word,
int row)
Removes a word sense of a word specified by the row number. |
void |
deleteReferenceToObject(java.sql.Statement stmt,
java.lang.String objectId)
Scans all of the dictionary words for a reference to the class and removes the reference. |
int |
hashCode(java.lang.String word,
java.lang.String row)
Creates a hash value for a given row. |
java.util.Collection |
list()
Returns an array of Strings containing all of the words in the dictionary. |
java.util.Collection |
lookupWord(java.lang.String word)
Retrieves a specified entry from the dictionary specified by word. |
void |
modify(java.lang.String word,
int row,
java.lang.String grammarString,
int objectId)
Replaces a word sense of a word specified by the row number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DictionaryTable()
Method Detail |
public java.util.Collection list() throws FidoDatabaseException
FidoDatabaseException
public boolean contains(java.lang.String word) throws FidoDatabaseException
FidoDatabaseException
public int add(java.lang.String word, java.lang.String grammarString, int objectId) throws FidoDatabaseException, GrammarLinkNotFoundException, GrammarParseException, ObjectNotFoundException
word
- word to add the word sense to
java.sql.SQLException
- thrown if there is a Input / Output error
saving the Dictionary.
LinkTypeNotFoundException
- thrown if the LinkTypeList does not
contain the system link Word
FidoDatabaseException
GrammarLinkNotFoundException
GrammarParseException
ObjectNotFoundException
public void modify(java.lang.String word, int row, java.lang.String grammarString, int objectId) throws FidoDatabaseException, GrammarLinkNotFoundException, GrammarParseException, ObjectNotFoundException, WordNotFoundException
word
- word to replace the word sense inrow
- used to specify which word sense to replace.
FidoDatabaseException
- thrown if there is a Input / Output error
saving the Dictionary.
WordNotFoundException
- word parameter does not exists
in the Dictionary
GrammarLinkNotFoundException
GrammarParseException
ObjectNotFoundException
public void delete(java.lang.String word, int row) throws FidoDatabaseException
word
- word to remove the word sense fromrow
- used to specify which word sense to remove
FidoDatabaseException
- thrown if there is a Input / Output error
saving the Dictionary.
WordNotFoundException
- word parameter does not exists
in the Dictionary
ObjectNotFoundException
- the object in the WordSense was not
found in the ObjectTable
LinkTypetNotFoundException
- the system link type Word
was not found in the LinkTypeListpublic java.util.Collection lookupWord(java.lang.String word) throws FidoDatabaseException, GrammarParseException, GrammarLinkNotFoundException
FidoDatabaseException
GrammarParseException
GrammarLinkNotFoundException
public void deleteReferenceToObject(java.sql.Statement stmt, java.lang.String objectId) throws java.sql.SQLException
FidoDatabaseException
- thrown if there is a Input / Output error
saving the Dictionary.
java.sql.SQLException
public int hashCode(java.lang.String word, java.lang.String row) throws FidoDatabaseException, WordNotFoundException
FidoDatabaseException
- Thrown if the database had an error.
WordNotFoundException
- Thrown if the parameters did not specify
a row in the table.
|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |