Using alternate return values
You may want to have a grammar file return a value other than the exact phrase that the user says. This may be useful when you want to use phrases rather than words, or if you want different phrases to return the same result. An example of using an alternate return value could be that when the user says, "repeat prompts," the Speakeasy engine can act like it hears "repeat".
You can also use more than one word or phrase to return the same result. This may be especially helpful in a multilingual environment. For example, you could have an English grammar file that listens for "yes" and a Dutch grammar file that listens for "ja," but either grammar would return the result "yes." Then the grammar file would only have to be programmed for one result.
To use an alternate return value, list the word or phrase the engine should listen for and then attach {@ = "result";}, where result is the alternate return value that the engine should convert to text.
For example:
<letter>:
ALPHA {@ = "A";} |
BRAVO {@ = "B";} |
CHARLIE {@ = "C";} |
DELTA {@ = "D";};
Using the phonetic alphabet above, users speak the term and Speakeasy converts it to a single letter of text.