|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.speakright.core.FlowBase
org.speakright.core.flows.QuestionFlow
public class QuestionFlow
Flow object that asks the user a question. The user can reply using either speech or DTMF digits, depending on the grammar used. This class implements a single-slot single question. This is the simplest form of directed dialog VUI.
| Field Summary | |
|---|---|
protected Question |
m_quest
|
| Constructor Summary | |
|---|---|
QuestionFlow()
|
|
QuestionFlow(java.lang.String gtext,
java.lang.String ptext)
Constructor. |
|
| Method Summary | |
|---|---|
void |
add(PromptType type,
java.lang.String text)
Add a prompt to the question. |
void |
addBinding(java.lang.String slotName,
java.lang.String modelVar)
Add a model binding. |
void |
addGrammar(Grammar gram)
Add/replace a grammar to the question. |
void |
addGrammar(java.lang.String gtext)
Add/replace a grammar to the question. |
void |
addPrompt(Prompt prompt)
Add a prompt to the question. |
IFlowRenderer |
createRenderer()
Create the type-specific renderer |
protected void |
InitPrompts(java.lang.String subject)
initialize the main, silence, and noreco prompts to default values. |
| Methods inherited from class org.speakright.core.FlowBase |
|---|
execute, executionCount, fixupGrammar, fixupPrompt, getFirst, getNext, getSubFlowAfter, log, logError, name, onBegin, onCatch, onComplete, onDisconnect, onEnd, onNoInput, onPlatformError, onTransferFailed, onValidateFailed, promptGroup, setExecutionCount, setName, setPromptGroup, shouldExecute, validateInput |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Question m_quest
| Constructor Detail |
|---|
public QuestionFlow()
public QuestionFlow(java.lang.String gtext,
java.lang.String ptext)
gtext - a grammar text (url, inline grammar, etc)ptext - prompt text| Method Detail |
|---|
protected void InitPrompts(java.lang.String subject)
subject - the subject of the question, such as "flight". Used to construct the prompts.
Of course, simply inserting a subject into our default prompts may not always be grammatically correct.
Issues such as lack of pluralization may occur. In those cases, you should set the prompts yourself.
public void add(PromptType type,
java.lang.String text)
type - type of prompt. This includes the role (MAIN, SILENCE, NORECO) and escalation count.text - prompt text.public void addPrompt(Prompt prompt)
type - type of prompt. This includes the role (MAIN, SILENCE, NORECO) and escalation count.text - prompt text.public void addGrammar(Grammar gram)
gram - grammarpublic void addGrammar(java.lang.String gtext)
grammar - text such as "inline:yes no"
public void addBinding(java.lang.String slotName,
java.lang.String modelVar)
slotName - slot in the grammar that is the value to be bound.
When the speech platform sends back the user input, it sends back
(slot,value) pairs.modelVar - name of the model variable to bind to. This variable
must have get and set methods with the following signatures
public {type} {modelVar}();
public void set{modelVar}({type} value);
Examples:
public String City();
public void setCity(String value);public IFlowRenderer createRenderer()
createRenderer in interface IFlowcreateRenderer in class FlowBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||