org.speakright.sro
Class SROConfirmYesNo
java.lang.Object
org.speakright.core.FlowBase
org.speakright.core.flows.QuestionFlow
org.speakright.sro.BaseSROQuestion
org.speakright.sro.gen.genSROConfirmYesNo
org.speakright.sro.SROConfirmYesNo
- All Implemented Interfaces:
- java.io.Serializable, IConfirmationFlow, IFlow
public class SROConfirmYesNo
- extends genSROConfirmYesNo
- implements IConfirmationFlow
SRO for doing simple yes/no confirmation. This confirmer can be used
with any SRO by passing an instance of SROConfirmYesNo to the SRO's
setConfirmer method.
This confirmer does explicit confirmation, accepting yes or no as the
answer. eg. "Do you want Boston?" If the user answers no then a confirm-rejection
occurs and the SRO asks its question again.
Features
- a confirmation threshold at which the confirmer should execute. If the user input
has a confirmation above this threshold, the confirmer does not do anything. So
setting confirmation threshold to 100 means confirmation will always be done,
0 means it will never be done.
- Author:
- IanRaeLaptop
- See Also:
- Serialized Form
| Fields inherited from class org.speakright.sro.BaseSROQuestion |
m_cmds, m_main1Prompt, m_maxReExecutions, m_modelVar, m_noreco1Prompt, m_noreco2Prompt, m_noreco3Prompt, m_noreco4Prompt, m_prefixPrompt, m_silence1Prompt, m_silence2Prompt, m_silence3Prompt, m_silence4Prompt, m_slotName, m_subject, m_subjectWord |
| Methods inherited from class org.speakright.sro.BaseSROQuestion |
addCancelCommand, addCommand, initMainPrompt, initPrompt, initPrompts, initPrompts, onValidateFailed, set_main1Prompt, set_noreco1Prompt, set_noreco2Prompt, set_noreco3Prompt, set_noreco4Prompt, set_prefixPrompt, set_silence1Prompt, set_silence2Prompt, set_silence3Prompt, set_silence4Prompt, setConfirmer, setModelVar, setPromptCondition, setSubjectPlurality |
| Methods inherited from class org.speakright.core.FlowBase |
executionCount, fixupGrammar, fixupPrompt, getFirst, getSubFlowAfter, log, logError, name, onBegin, onCatch, onComplete, onDisconnect, onEnd, onNoInput, onPlatformError, onTransferFailed, promptGroup, setExecutionCount, setName, setPromptGroup, shouldExecute, validateInput |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.speakright.core.IFlow |
createRenderer, execute, executionCount, fixupGrammar, fixupPrompt, getFirst, getSubFlowAfter, name, onBegin, onCatch, onComplete, onDisconnect, onEnd, onNoInput, onPlatformError, onTransferFailed, onValidateFailed, promptGroup, setExecutionCount, setPromptGroup, shouldExecute, validateInput |
SROConfirmYesNo
public SROConfirmYesNo(java.lang.String subject)
confirmThreshold
public int confirmThreshold()
setConfirmThreshold
public void setConfirmThreshold(int threshold)
setNotifier
public void setNotifier(IConfirmationNotifier notifier)
- Description copied from interface:
IConfirmationFlow
- Set the notifier, which MUST be called from within
the confirmation flow's getNext.
Used to notify the confirmation wrapper. MUST call this from getNext when
the confirmation finishes.
- Specified by:
setNotifier in interface IConfirmationFlow
- Parameters:
notifier - the confirmation wrapper
needToExecute
public boolean needToExecute(IFlow current,
SRResults results)
- Description copied from interface:
IConfirmationFlow
- Inspect the results to see if confirmation is needed.
Some confirmers may only kick if in the confidence level of
the previous answer was less than some threshold.
- Specified by:
needToExecute in interface IConfirmationFlow
- Parameters:
current - the current flow objectsresults - results from the question for which we may do
confirmation.
- Returns:
- true if confirmation should be done.
getNext
public IFlow getNext(IFlow current,
SRResults results)
- Description copied from class:
FlowBase
- The default implementation of getNext is to return null.
- Specified by:
getNext in interface IFlow- Overrides:
getNext in class BaseSROQuestion
- Parameters:
current - the currently executing flow object. More precisely, current is the flow
object that this object most recently returned from getFirst or getNext.results - the results of current's execution by the speech platform. Results
contains user input and/or events such as disconnect or platform-error.
- Returns:
- the next flow to run, or null which means this flow object is finished.