Provides the label of the grammar that was used by the ASR engine to produce the parse associated with a given interpretation. When a decode is performed with more than one active grammars, this API call helps identify the grammar that produced the parse leading to a given interpretation.
Function
Parameters
hport
The port's handle.
VoiceChannel
The channel containing the decoded audio.
index
The index of the interpretation for which the grammar label is being queried.
Return Values
Non-NULL
The queried grammar label.
NULL
If either the inputs port or VoiceChannel are invalid, or the specified (index) interpretation does not exist.
C Code
- // An example of how this information might be used. In this case, we give
- // the user a list of attributes about the interpretations so far.
- for (counter = 0; counter < NumberOfInterpretationsFromASR; counter++)
- {
// Show what interpretation we are on
printf(" Interpretation %d of %d\n", counter + 1,
NumberOfInterpretationsFromASR);
// Show the input string that the ASR used to parse a semantic interpretation input_string = LV_SRE_GetInterpretationInputString(port, VOICE_CHANNEL,
counter);
printf(" Input Sentence : %s\n", input_string);
// Show the label of the grammar used for this decode
input_string = LV_SRE_GetInterpretationGrammarLabel(port, VOICE_CHANNEL,
counter);
printf(" Grammar Label : %s\n", gram_label);
// Show the string that was retrieved from the grammar
// after semantic interpretation
input_string = LV_SRE_GetInterpretationString(port, VOICE_CHANNEL, counter);
printf(" Interpretation String : %s\n", interp_string);
// Show the score of the interpretation
input_string = LV_SRE_GetInterpretationScore(port, VOICE_CHANNEL, counter);
printf(" Interpretation Score : %s\n", score);
- }
See Also