Getting The Return Value

In SI Script by Example we described how to use grammar tags to create a semantic interpretation result. In order to get the return value into your application, LumenVox provides an XML fragment representation of the return type. This conforms to the W3C's proposal for generating XML from semantic interpretation results (except that it does not enclose the XML in a top-level tag). LumenVox provides an API for accessing the return value as a data structure.

Under the XML scheme, if the engine recognized "four hundred and six" using our example grammar, then the result would look like:

<number>406</number>
<text>FOUR HUNDRED AND SIX</text>

To access the return value of semantic interpretation scheme you must do the following:

  1. Set the LV_DECODE_SEMANTIC_INTERPRETATION flag in your decode function call.
  2. After decode, get the number of different interpretations that exist using GetNumberOfInterpretations (usually there will only be one, but an ambiguous grammar might return more than one).
  3. For each result, get the interpretation result by calling GetInterpretation.

More options are available for more complex interpretations. See the LVInterpretation Summary for information.

© 2012 LumenVox LLC. All rights reserved.