Browse
 
Tools
Rss Categories

LV_SRE_GetInterpretationGrammarLabel

Reference Number: AA-00686 Views: 6738 0 Rating/ Voters

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

  •  const char* LV_SRE_GetInterpretationGrammarLabel(HPORT hport, int VoiceChannel, int index)

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

  1. // An example of how this information might be used. In this case, we give
  2. // the user a list of attributes about the interpretations so far.
  3. for (counter = 0; counter < NumberOfInterpretationsFromASR; counter++)
  4. {
  5. // Show what interpretation we are on
  6. printf("  Interpretation %d of %d\n", counter + 1,
    NumberOfInterpretationsFromASR);

  7. // Show the input string that the ASR used to parse a semantic interpretation
  8. input_string = LV_SRE_GetInterpretationInputString(port, VOICE_CHANNEL,
  9. counter);
  10. printf("  Input Sentence : %s\n", input_string);

  11. // Show the label of the grammar used for this decode
  12. input_string = LV_SRE_GetInterpretationGrammarLabel(port, VOICE_CHANNEL,
  13. counter);
  14. printf("  Grammar Label : %s\n", gram_label);

  15. // Show the string that was retrieved from the grammar
  16. // after semantic interpretation
  17. input_string = LV_SRE_GetInterpretationString(port, VOICE_CHANNEL, counter);
  18. printf("  Interpretation String : %s\n", interp_string);

  19. // Show the score of the interpretation
  20. input_string = LV_SRE_GetInterpretationScore(port, VOICE_CHANNEL, counter);
  21. printf("  Interpretation Score : %s\n", score);
  22. }

See Also