Skip to content

Instantly share code, notes, and snippets.

@mheadd
Created February 26, 2011 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mheadd/a622a0a53a2378c1b86c to your computer and use it in GitHub Desktop.
Save mheadd/a622a0a53a2378c1b86c to your computer and use it in GitHub Desktop.
An SRGS grammar for capturing user input on body weight.
<?xml version="1.0" encoding="ISO-8859-1"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" 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" xml:lang="en-US" mode="voice" root="main">
<!-- Main gramar rule -->
<rule id="main" scope="public">
<item>
<ruleref uri="#first" />
</item>
<item repeat="0-">
<ruleref uri="#second" />
</item>
<item repeat="0-">
<ruleref uri="#third" />
</item>
<item>
<ruleref uri="#fourth" />
</item>
</rule>
<rule id="first" scope="private">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</one-of>
</rule>
<rule id="second" scope="private">
<one-of>
<item>hundred<tag>0</tag></item>
<item>oh<tag>0</tag></item>
</one-of>
</rule>
<rule id="third" scope="private">
<one-of>
<item>twenty</item>
<item>thirty</item>
<item>forty</item>
<item>fifty</item>
<item>sixty</item>
<item>seventy</item>
<item>eighty</item>
<item>ninety</item>
</one-of>
</rule>
<rule id="fourth" scope="private">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>18</item>
<item>19</item>
</one-of>
</rule>
</grammar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment