| <?xml version="1.0" encoding="iso-8859-1"?> |
| <!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" "http://www.w3.org/TR/speech-grammar/grammar.dtd"> |
| <grammar version="1.0" xmlns="http://www.w3.org/2001/06/grammar" xml:lang = "en-US" tag-format="semantics/1.0" |
| mode="voice" root="percent"> |
| <!-- |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| --> |
| |
| <rule id="percent" scope="public"> |
| <one-of> |
| <item weight="3.0"><ruleref uri="#numbers0to100"/>percent<tag><![CDATA[ $= $numbers0to100 ; ]]></tag></item> |
| </one-of> |
| </rule> |
| |
| <rule id="numbers1to9"> |
| <one-of> |
| <item> one <tag><![CDATA[ $="1"; ]]></tag></item> |
| <item> two <tag><![CDATA[ $="2"; ]]></tag></item> |
| <item> three <tag><![CDATA[ $="3"; ]]></tag></item> |
| <item> four <tag><![CDATA[ $="4"; ]]></tag></item> |
| <item> five <tag><![CDATA[ $="5"; ]]></tag></item> |
| <item> six <tag><![CDATA[ $="6"; ]]></tag></item> |
| <item> seven <tag><![CDATA[ $="7"; ]]></tag></item> |
| <item> eight <tag><![CDATA[ $="8"; ]]></tag></item> |
| <item> nine <tag><![CDATA[ $="9"; ]]></tag></item> |
| </one-of> |
| </rule> |
| |
| <rule id="zero"> |
| <item> |
| <one-of> |
| <item> zero </item> |
| <item> oh </item> |
| <item> nil </item> |
| <item> null </item> |
| </one-of> |
| </item><tag><![CDATA[ $="0"; ]]></tag> |
| </rule> |
| |
| <rule id="tens10to90"> |
| <one-of> |
| <item> ten <tag><![CDATA[ $="1"; ]]></tag></item> |
| <item><ruleref uri="#tens20to90"/><tag><![CDATA[ $=$tens20to90; ]]></tag></item> |
| </one-of> |
| </rule> |
| |
| <rule id="tens20to90"> |
| <one-of> |
| <item> twenty <tag><![CDATA[ $="2"; ]]></tag></item> |
| <item> thirty <tag><![CDATA[ $="3"; ]]></tag></item> |
| <item> forty <tag><![CDATA[ $="4"; ]]></tag></item> |
| <item> fifty <tag><![CDATA[ $="5"; ]]></tag></item> |
| <item> sixty <tag><![CDATA[ $="6"; ]]></tag></item> |
| <item> seventy <tag><![CDATA[ $="7"; ]]></tag></item> |
| <item> eighty <tag><![CDATA[ $="8"; ]]></tag></item> |
| <item> ninety <tag><![CDATA[ $="9"; ]]></tag></item> |
| </one-of> |
| </rule> |
| |
| |
| <rule id="teens"> |
| <one-of> |
| <item> eleven <tag><![CDATA[ $="11"; ]]></tag></item> |
| <item> twelve <tag><![CDATA[ $="12"; ]]></tag></item> |
| <item> thirteen <tag><![CDATA[ $="13"; ]]></tag></item> |
| <item> fourteen <tag><![CDATA[ $="14"; ]]></tag></item> |
| <item> fifteen <tag><![CDATA[ $="15"; ]]></tag></item> |
| <item> sixteen <tag><![CDATA[ $="16"; ]]></tag></item> |
| <item> seventeen <tag><![CDATA[ $="17"; ]]></tag></item> |
| <item> eighteen <tag><![CDATA[ $="18"; ]]></tag></item> |
| <item> nineteen <tag><![CDATA[ $="19"; ]]></tag></item> |
| </one-of> |
| </rule> |
| |
| <rule id="numbers0to100"> |
| <one-of> |
| <item><ruleref uri="#zero"/><tag><![CDATA[ $=$zero; ]]></tag></item> |
| <item><ruleref uri="#numbers1to9"/><tag><![CDATA[ $=$numbers1to9; ]]></tag></item> |
| <item><ruleref uri="#tens10to90"/><tag><![CDATA[ $=$tens10to90 + "0"; ]]></tag></item> |
| <item><ruleref uri="#teens"/><tag><![CDATA[ $=$teens; ]]></tag></item> |
| <item><ruleref uri="#tens20to90"/><ruleref uri="#numbers1to9"/><tag><![CDATA[ $=$tens20to90 + $numbers1to9; ]]></tag></item> <item><item repeat="0-1">one</item> hundred<tag><![CDATA[ $="100"; ]]></tag></item> |
| </one-of> |
| </rule> |
| |
| |
| </grammar> |
| |