By building upon SRGS grammars it allows Voice browsers via ECMAScript to semantically interpret complex grammars and provide the information back to the application. For example, it allows utterances like "I would like a coca cola and three large pizzas with pepperoni and mushrooms." to be interpreted into an object that can be understood by an application. For example, the utterance could produce the following object named order:
If used against this grammar that includes SISR markup in addition to the standard SRGS grammar in XML format:
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" "http://www.w3.org/TR/speech-grammar/grammar.dtd"><grammarxmlns="http://www.w3.org/2001/06/grammar"xml:lang="en"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.w3.org/2001/06/grammar
http://www.w3.org/TR/speech-grammar/grammar.xsd"version="1.0"mode="voice"tag-format="semantics/1.0"root="order"><ruleid="order">
I would like a
<rulerefuri="#drink"/><tag>out.drink = new Object(); out.drink.liquid=rules.drink.type;
out.drink.drinksize=rules.drink.drinksize;</tag>
and
<rulerefuri="#pizza"/><tag>out.pizza=rules.pizza;</tag></rule><ruleid="kindofdrink"><one-of><item>coke</item><item>pepsi</item><item>coca cola<tag>out="coke";</tag></item></one-of></rule><ruleid="foodsize"><tag>out="medium";</tag><!-- "medium" is default if nothing said --><itemrepeat="0-1"><one-of><item>small<tag>out="small";</tag></item><item>medium</item><item>large<tag>out="large";</tag></item><item>regular<tag>out="medium";</tag></item></one-of></item></rule><!-- Construct Array of toppings, return Array --><ruleid="tops"><tag>out=new Array;</tag><rulerefuri="#top"/><tag>out.push(rules.top);</tag><itemrepeat="1-">
and
<rulerefuri="#top"/><tag>out.push(rules.top);</tag></item></rule><ruleid="top"><one-of><item>anchovies</item><item>pepperoni</item><item>mushroom<tag>out="mushrooms";</tag></item><item>mushrooms</item></one-of></rule><!-- Two properties (drinksize, type) on left hand side Rule Variable --><ruleid="drink"><rulerefuri="#foodsize"/><rulerefuri="#kindofdrink"/><tag>out.drinksize=rules.foodsize; out.type=rules.kindofdrink;</tag></rule><!-- Three properties on rules.pizza --><ruleid="pizza"><rulerefuri="#number"/><rulerefuri="#foodsize"/><tag>out.pizzasize=rules.foodsize; out.number=rules.number;</tag>
pizzas with
<rulerefuri="#tops"/><tag>out.topping=rules.tops;</tag></rule><ruleid="number"><one-of><item><tag>out=1;</tag><one-of><item>a</item><item>one</item></one-of></item><item>two<tag>out=2;</tag></item><item>three<tag>out=3;</tag></item></one-of></rule></grammar>