|
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.GrammarStack
Each SentenceThread contains a GrammarStack that is used to push and pop StackElements. Each StackElement represents a grammar expression. Grammar will push a new open link as a new StackElement onto the GrammarStack. Each close link will attempt to find the next matching link on the GrammarStack.
Internally, the Grammar stack has a StackElement for the head of the stack and a hold element. The hold element will be the next element to push onto the stack. If the element is immediately pushed onto the stack, it is possible the Grammar module will match a close link with an open link in the same word.
StackElement
,
Grammar
Constructor Summary | |
GrammarStack()
Creates a new empty GrammarStack instance. |
Method Summary | |
GrammarStack |
cloneGrammarStack()
Makes a deep copy of the GrammarStack. |
java.util.Iterator |
elementIterator()
Returns an iterator over the StackElements in this stack. |
StackElement |
getHeadElement()
Returns the element at the top of the stack. |
void |
holdExpression(NodeExpression exp,
WordSense sense)
Stores an open link on the stack in the hold area. |
boolean |
isEmpty()
Tests the stack to be empty. |
void |
push()
Puts the hold element onto the top of the stack. |
WordSense |
traverseStack(java.lang.String str)
Starts with the top of the stack and looks for an open link element matching the parameter string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GrammarStack()
Method Detail |
public void push()
public WordSense traverseStack(java.lang.String str)
If the node matches, and it is a multi-node, the node is set to being used at least once. If it is not a multi-node, it is removed from the stack.
str
- String value of the open link to look for on the stack
NodeExpression.setMultiNodeUsed()
public void holdExpression(NodeExpression exp, WordSense sense)
exp
- Expression to hold.sense
- WordSense to store along with the expressionpublic boolean isEmpty()
StackElement.allExpressionsUsed()
public StackElement getHeadElement()
public java.util.Iterator elementIterator()
public GrammarStack cloneGrammarStack()
|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |