Not able to load grammar

Hi,

I am new in development of grammar using lumenvox license. I had made one grammar that can detect the level of input and based on that i will recognize that whether the input is correct or not.

Please find below grammar that i found from lumenvox knowledgebase and let me know where i am wrong.

#ABNF 1.0 UTF-8;

language en-IN;

mode voice;

tag-format <semantics/1.0>;
root $Final;

$Digit = (one {out = "1"} | two {out = "2"} | three {out = "3"} | four {out = "4"} | five {out = "5"}|six {out = "6"} | seven {out = "7"} | eight {out = "8"} | nine {out = "9"} | (zero | oh) {out = "0"});

$Digits =
        {
         out='';
         var curr_wild=0;
         var max_wild=5;
        }
   ( $Digit
      { ! {
          if (meta.Digit.score > 450)
               { out += rules.Digit; }
          else { out += '_'; ++curr_wild; }
      } ! }
    ) <1->
   { ! {
        if (curr_wild > max_wild){ out='';}
   } ! };

$Final = {out = ''} $Digits {out = rules.latest()};

 

Regards,

Nigel Quinnin's picture

Hello Jayesh,

It looks like some of the markup is causing problems there. Try this modified grammar instead:

#ABNF 1.0 UTF-8;
language en-IN;
mode voice;
tag-format <semantics/1.0>;
root $Final;
$Digit = (one {out = "1"} | two {out = "2"} | three {out = "3"} | four {out = "4"} | five {out = "5"}|six {out = "6"} | seven {out = "7"} | eight {out = "8"} | nine {out = "9"} | (zero | oh) {out = "0"});
$Digits =
        {
         out='';
         var curr_wild=0;
         var max_wild=5;
        }
   ( $Digit
      {
          if (meta.Digit.score > 450)
               out += rules.Digit;
          else out += '_'; ++curr_wild;
      }
    ) <1->
   {
           if (curr_wild > max_wild) out='';
   };

$Final = {out = ''} $Digits {out = rules.latest()};