Final Code: Dictionary
- Yavneeka Patel
- Apr 29, 2015
- 1 min read
/**
*Java Speech Grammar Format (JSGF) file
*This file holds all the words that the program will recognize
**/
//------------------------GRAMMAR HEADER BEGINS--------------------------------//
#JSGF V1.0;
grammar dialog; //Grammar name
//------------------------GRAMMAR HEADER ENDS--------------------------------//
//------------------------GRAMMAR BODY BEGINS--------------------------------//
/**Rule definition format:
* "Public" is optional, but remaining part is mandatory
* public <ruleName> = ruleExpansion
*An expansion can refer to one or more tokens OR rules
**/
<greeting> = hi | hello | my name is;
<feel> = how are;
<location> = where are you from;
<age> = old;
<hardware> = on | off | blink ;
public <command> = <feel> | <greeting> | <feel> | <hardware> | <age>;
//------------------------GRAMMAR BODY ENDS--------------------------------//
Comments