Reputation: 3401
I am developing small voice based interaction tool using sphinx (Speech to Text) and FreeTTS(Text to Speech) in java.
for eg : FreeTTS gives voice command like Name : user will reply his name and age and place.everything is static.
How to write hello.gram in sphinx to achieve this
public<greet>=[<name>] [<age>] [<place>];
<name> = john | max;
<age> = ten | nine ;
<place> = France | Spain;
Voice command : What is your name my reply : Max
Observation : Max ten
Voice command : what is your age my reply : nine
Observation : nine France
I want only names should be observed when i say name.its highly intermittent too :(
Thanks in advance.
Upvotes: 0
Views: 194
Reputation: 3401
You can use below code to avoid it .
public <name> = john | max;
public <age> = ten | nine ;
public <place> = France | Spain;
Upvotes: 0
Reputation: 2507
There is no magical method to do what you want. You have to specify all phrases that you want to be recognized in your grammar. The only thing I can recommend is to factorize some rules, e.g. numbers:
<digits> = one | two | three | four ;
<decades> = twenty | thirty | forty ;
<numto44> = <decades> | <decades> <digits> ;
Upvotes: 1