-
Notifications
You must be signed in to change notification settings - Fork 730
Description
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"