|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fido.grammar.Grammar
The Fido system uses a grammatical system called link grammar to identify relationships between words in the user command. The command is defined as a set of words, which is the terminal symbols of the grammar, each of which has a linking requirement. A sequence of words is defined as a successful sentence if:
See Grammar String Concepts for a description of Grammar Strings and how they are used to link words.
A typical usage of Grammar would be to create an instance, which will start a new sentence with no threads. Use insertWord() method to incrementally add words to the sentence. When complete, call finalizeSentece() to ensure the sentence is valid and return a Vector containing the links of the sentence.
WordSense
,
WordPackage
Constructor Summary | |
Grammar()
Creates a new Grammar class with an empty thread stack. |
Method Summary | |
java.util.Vector |
finalizeSentence()
Ensures all threads are valid by checking to see there are no open links that have not been satisfied. |
java.util.Vector |
getThreads()
This method returns all of the sentence threads. |
void |
insertWord(WordPackage wordPack)
Inserts a new word string into the current grammar. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Grammar()
Method Detail |
public void insertWord(WordPackage wordPack) throws GrammarParseException
WordSense
has its grammar tree, which is a
BooleanTree
, added to the grammar. Each word sense
of the new word creates a new thread in the grammar,
which may or may not be valid.
wordPack
- WordPackage of the word to insert
GrammarParseException
- thrown if the grammar string in
the database was not able to be parsed.WordSense
,
BooleanTree
,
WordPackage
public java.util.Vector finalizeSentence()
Link
public java.util.Vector getThreads()
SentenceThread
|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |