devs.speechpackage
Class DialogNodeBehavior

java.lang.Object
  extended by devs.speechpackage.DialogNodeBehavior
Direct Known Subclasses:
NewGrammarDialogNodeBehavior

 class DialogNodeBehavior
extends java.lang.Object

Provides the default behavior for dialog node. Applications will typically extend this class and override methods as appropriate


Constructor Summary
DialogNodeBehavior()
           
 
Method Summary
 edu.cmu.sphinx.jsapi.JSGFGrammar getGrammar()
          Retrieves the grammar associated with this ndoe
 java.lang.String getName()
          Returns the name for this node
(package private)  javax.speech.recognition.RuleParse getRuleParse(edu.cmu.sphinx.result.Result result)
          Retrieves the rule parse for the given result
(package private)  java.lang.String getTagString(edu.cmu.sphinx.result.Result result)
          Gets a space delimited string of tags representing the result
 void onEntry()
          Called when this node becomes the active node
 void onExit()
          Called when this node is no lnoger the active node
 void onInit(DialogManager.DialogNode node)
          Called during the initialization phase
 void onReady()
          Called when this node is ready to perform recognition
 java.lang.String onRecognize(edu.cmu.sphinx.result.Result result)
           
 java.lang.String toString()
          Returns the string representation of this object
(package private)  void trace(java.lang.String msg)
          Outputs a trace message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DialogNodeBehavior

DialogNodeBehavior()
Method Detail

onInit

public void onInit(DialogManager.DialogNode node)
Called during the initialization phase

Parameters:
node - the dialog node that the behavior is attached to

onEntry

public void onEntry()
             throws java.io.IOException
Called when this node becomes the active node

Throws:
java.io.IOException

onReady

public void onReady()
Called when this node is ready to perform recognition


onRecognize

public java.lang.String onRecognize(edu.cmu.sphinx.result.Result result)
                             throws javax.speech.recognition.GrammarException
Throws:
javax.speech.recognition.GrammarException

onExit

public void onExit()
Called when this node is no lnoger the active node


getName

public java.lang.String getName()
Returns the name for this node

Returns:
the name of the node

toString

public java.lang.String toString()
Returns the string representation of this object

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this object

getGrammar

public edu.cmu.sphinx.jsapi.JSGFGrammar getGrammar()
Retrieves the grammar associated with this ndoe

Returns:
the grammar

getRuleParse

javax.speech.recognition.RuleParse getRuleParse(edu.cmu.sphinx.result.Result result)
                                          throws javax.speech.recognition.GrammarException
Retrieves the rule parse for the given result

Parameters:
the - recognition result
Returns:
the rule parse for the result
Throws:
javax.speech.recognition.GrammarException - if there is an error while parsing the result

getTagString

java.lang.String getTagString(edu.cmu.sphinx.result.Result result)
                        throws javax.speech.recognition.GrammarException
Gets a space delimited string of tags representing the result

Parameters:
result - the recognition result
Returns:
the tag string
Throws:
javax.speech.recognition.GrammarException - if there is an error while parsing the result

trace

void trace(java.lang.String msg)
Outputs a trace message

Parameters:
the - trace message