Spartan
Spartan

Reputation: 3401

how to manage hello.gram for conversation using sphinx and freetts in java

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.

modified based on Alexander's answer.

Upvotes: 0

Views: 194

Answers (2)

Spartan
Spartan

Reputation: 3401

You can use below code to avoid it .

public <name> = john | max;
public <age> = ten | nine ;
public <place> = France | Spain;

Upvotes: 0

Alexander Solovets
Alexander Solovets

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

Related Questions