user3267555
user3267555

Reputation: 1

Grammar with dictation using Sphinx-4

I'm using Sphinx-4 to convert voice to text, but I need that the application recognizes a grammar and then a sequence of words dictated.

For example, having the following grammar:

public <greet> = (Good morning | Hello);

If I say "Hello" and then Joan (or any other name) I intend to return the text "Hello Joan"

I saw the topic Dictation Application using Sphinx4 but if I change the settings will always return <unk>. This is the right step? If yes, what am I doing wrong?

Upvotes: 0

Views: 1048

Answers (1)

NIket
NIket

Reputation: 924

To get output as Hello Joan you must keep your grammar like

public <greet> = (Good morning | Hello) (JOAN | JOHN | MIKE);

So it can return you -Good Morning JOAN -Good Morning JOHN -Good Morning MIKE -Hello JOAN -Hello JOHN -Hello MIKE

in this grammar if you also intended to get Just Good Morning or just Hello

then your grammar should be

public <greet> = (Good morning | Hello) (JOAN | JOHN | MIKE)*;
  • here specifies that 0 or more occurrence of JOAN/JOHN/MIKE SO it can also return Hello JOHN MIKE or Hello or Good Morning and all possible combinations.

Upvotes: 1

Related Questions