Menu

JSGF Grammer not working as expected

Help
G10DRAS
2016-06-03
2016-06-04
  • G10DRAS

    G10DRAS - 2016-06-03

    I have created a simple JSGF as follows and using it with PocketSphinx-5prealpha (Python API)

    #JSGF V1.0; 
    grammar testGrammar;
    <unit>     = (METER|CENTIMETER|MILE);
    <number>  = (ONE|TWO|THREE|FOUR|FIVE|SIX|SEVEN|EIGHT|NINE|TEN|HUNDRED|THOUSAND)+;
    public <phrases> = (WHAT IS YOUR NAME)  |  (<number> <unit> (EQUAL TO) [HOW MANY] <unit>) ;
    

    Output what I am expecting (always) out of above grammer:
    either
    WHAT IS YOUR NAME
    or phrases like
    "ONE THOUSAND FIVE HUNDRED TEN METER EQUAL TO MILE"
    "ONE THOUSAND FIVE HUNDRED TEN METER EQUAL TO HOW MANY MILE"
    "ONE MILE EQUAL TO METER"

    Which I am getting most of the time,

    but sometime I also get output like:
    "ONE TWO WHAT IS YOUR NAME"
    "THOUSAND WHAT IS YOUR NAME"

    I don't want such phrases, How to avoid this ?

    If I remove '+' (one-or-many) operator from below line in grammer file:
    <number> = (ONE|TWO|THREE|FOUR|FIVE|SIX|SEVEN|EIGHT|NINE|TEN|HUNDRED|THOUSAND)+;
    Grammer works as expected but then I cant repeat the numbers and able to use only one number at a time.
    for example
    "HUNDRED MILE EQUAL TO HOW MANY METER"
    and not like
    "FIVE HUNDRED MILE EQUAL TO HOW MANY METER"

     

    Last edit: Nickolay V. Shmyrev 2016-06-03
    • Nickolay V. Shmyrev

      This is a bug introduced some time ago. I'm looking on how to fix it, but it will take some time.

       
  • G10DRAS

    G10DRAS - 2016-06-04

    Thanks Nickolay. An issue is opened for this bug.
    https://github.com/cmusphinx/pocketsphinx/issues/53

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.