Feedback

  • Contents
 

Grammar Example

The following example is of the SRGS grammar file used in the previous example.

    #ABNF 1.0;
    language en-us;
    mode voice;
    tag-format <semantics/1.0>;
    root $root;
  
    public $root = [I would | "I'ld" ] [like] 
 
 [a | an | one ]
                  $size 
 
 {out.size=rules.latest();}
                  $drink 
 
 {out.drink=rules.latest();}
                  [please];
  
    private $size = small {out="small";}| 
 
 medium {out="medium";}| large {out="large";}| 
 extra 
 large {out="extra
  
    large";};
    
    private $drink = [diet {out="diet ";}] 
 
 (pepsi {out=out+"pepsi";}| (coke | coca cola) {out=out+"coke";} 
 
 | sprite
    
    {out=out+"sprite";}| mountain dew {out=out+"mountain 
 
 dew";});