<?xml version="1.0" encoding="UTF-8" ?>
<grammar version="1.0" 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"
 xml:lang="th-TH" mode="voice" root="carPlate">

<rule id="carPlate" scope="public">
 <item>
  <ruleref uri="#DETAILS"/>
  <tag>app_tag_intent=DETAILS.A; BUILD='20221026144900';</tag>
 </item>
</rule> 

<rule id="DETAILS">
 <one-of>
  <item>
  <ruleref uri="#PREFIX"/>
  <ruleref uri="#ALPHABETS"/><tag>A=ALPHABETS.A;</tag>
  <ruleref uri="#SUFFIX"/>
  </item>
  <item>
  <ruleref uri="#ALPHABETS"/><tag>A=ALPHABETS.A;</tag>
  <ruleref uri="#SUFFIX"/>
  </item>
 </one-of>
</rule>

<rule id="ALPHABETS">
 <item>
  <ruleref uri="#S"/>
  <tag>A=S.V;</tag>
 </item>
</rule>

<rule id="S">
      <item repeat="1-">
         <ruleref uri="#AN"/>
         <tag>V = V ? V +"CHR$(8)"+ AN.V : AN.V</tag>
      </item>
   </rule>

   <rule id="AN">
      <one-of>
         <item><tag>V='0'</tag>0</item>
         <item><tag>V='1'</tag>1</item>
         <item><tag>V='2'</tag>2</item>
         <item><tag>V='3'</tag>3</item>
         <item><tag>V='4'</tag>4</item>
         <item><tag>V='5'</tag>5</item>
         <item><tag>V='6'</tag>6</item>
         <item><tag>V='7'</tag>7</item>
         <item><tag>V='8'</tag>8</item>
         <item><tag>V='9'</tag>9</item>
         <item>
              <tag>V='KO_KAI'</tag>
			 <one-of>
                 <item> กอ </item>
                 <item> ก ไก่  </item>
              </one-of>
        </item>
        <item>
              <tag>V='KHO_KHAI'</tag>
               ข ไข่
       </item>
       <item>
              <tag>V='KHO_KHUAT'</tag>
               ฃ ขวด
        </item>
        <item>
              <tag>V='KHO_KHWAI'</tag>
               ค ควาย
        </item>
        <item>
              <tag>V='KHO_KHON'</tag>
               ฅ คน
        </item>
        <item>
              <tag>V='KHO_RAKHANG'</tag>
               ฆ ระฆัง
        </item>
        <item>
              <tag>V='NGO_NGU'</tag>
               ง งู
        </item>
        <item>
              <tag>V='CHO_CHAN'</tag>
               จ จาน
        </item>
        <item>
              <tag>V='CHO_CHING'</tag>
               ฉ ฉิ่ง
        </item>
        <item>
              <tag>V='CHO_CHANG'</tag>
               ช ช้าง
        </item>
        <item>
              <tag>V='SO_SO'</tag>
               ซ โซ่
       </item>
       <item>
              <tag>V='CHO_CHOE'</tag>
               <one-of>
                 <item> ฌ เฌอ </item>
                 <item> ฌ กระเฌอ  </item>
               </one-of>
        </item>
        <item>
              <tag>V='YO_YING'</tag>
               ญ หญิง
        </item>
        <item>
              <tag>V='DO_CHADA'</tag>
               ฎ ชฎา
        </item>
        <item>
              <tag>V='TO_PATAK'</tag>
               ฏ ปฏัก
        </item>
        <item>
              <tag>V='THO_THAN'</tag>
               <one-of>
                 <item> ฐ ฐาน </item>
                 <item>  ฐ สัณฐาน </item>
               </one-of>
        </item>
        <item>
              <tag>V='THO_NANGMONTHO'</tag>
              <one-of>
               <item> ฑ มณโฑ </item>
               <item> ฑ นาง มณโฑ </item>
              </one-of>
        </item>
        <item>
              <tag>V='THO_PHUTHAO'</tag>
               ฒ ผู้เฒ่า
        </item>
        <item>
              <tag>V='NO_NEN'</tag>
               ณ เณร
        </item>
        <item>
              <tag>V='DO_DEK'</tag>
               ด เด็ก
       </item>
       <item>
              <tag>V='TO_TAO'</tag>
               ต เต่า
        </item>
        <item>
              <tag>V='THO_THUNG'</tag>
               ถ ถุง
        </item>
        <item>
              <tag>V='THO_THAHAN'</tag>
               ท ทหาร
        </item>
        <item>
              <tag>V='THO_THONG'</tag>
               ธ ธง
        </item>
        <item>
              <tag>V='NO_NU'</tag>
               น หนู
        </item>
        <item>
              <tag>V='BO_BAIMAI'</tag>
               บ ใบไม้
        </item>
        <item>
              <tag>V='PO_PLA'</tag>
               ป ปลา
        </item>
        <item>
              <tag>V='PHO_PHUNG'</tag>
               ผ ผึ้ง
        </item>
        <item>
              <tag>V='FO_FA'</tag>
               ฝ ฝา
        </item>
        <item>
              <tag>V='PHO_PHAN'</tag>
               พ พาน
        </item>
        <item>
              <tag>V='FO_FAN'</tag>
               ฟ ฟัน
       </item>
       <item>
              <tag>V='PHO_SAMPHAO'</tag>
                สำเภา
        </item>
        <item>
              <tag>V='MO_MA'</tag>
               ม ม้า
        </item>
        <item>
              <tag>V='YO_YAK'</tag>
              ย ยักษ์
        </item>
        <item>
              <tag>V='RO_RUA'</tag>
               ร เรือ
        </item>
        <item>
              <tag>V='LO_LING'</tag>
               ล ลิง
        </item>
        <item>
              <tag>V='WO_WAEN'</tag>
			  <one-of>
                <item> วอ </item>
                <item> ว แหวน </item>
               </one-of>
        </item>
        <item>
              <tag>V='SO_SALA'</tag>
               <one-of>
                <item> ศ ศาลา </item>
                <item> ศ ค ศาลา  </item>
               </one-of>
        </item>
        <item>
              <tag>V='SO_RUSI'</tag>
               <one-of>
                <item> ษ ฤาษี </item>
                <item> ษ บ ฤาษี </item>
               </one-of>
        </item>
        <item>
              <tag>V='SO_SUA'</tag>
               <one-of>
                 <item> ส เสือ </item>
                 <item> ส ล </item>
                </one-of>
        </item>
        <item>
              <tag>V='HO_HIP'</tag>
               ห หีบ
        </item>
        <item>
              <tag>V='LO_CHULA'</tag>
               ฬ จุฬา
        </item>
        <item>
              <tag>V='O_ANG'</tag>
               อ อ่าง
        </item>
        <item>
              <tag>V='HO_NOKHUK'</tag>
               ฮ นกฮูก
        </item>
      </one-of>
   </rule>

<rule id="PREFIX">
 <item repeat="0-1">
  <one-of>
  <item>เลข</item>
  <item>หมายเลข</item>
  <item>กอทอ</item>
  </one-of>
 </item>
</rule>
<rule id="SUFFIX">
 <item repeat="0-1">
  <one-of>
  <item>ครับ</item>
  <item>คับ</item>
  <item>นะคะ</item>
  <item>คะ</item>
  <item>ค่ะ</item>
  <item>ค่า</item>
  <item>ค้า</item>
  <item>ข้า</item>
  <item>จ้า</item>
  <item>จ๊ะ</item>
  <item>กรุงเทพ</item>
  </one-of>
 </item>
</rule>
</grammar>
