0

I am new to sphinx java and started with small project of employee details.Download HelloWorld program and modifying it. how to get employee id (eg : T5438,Y7651,U9085) and department ( Auto, Support , Mobile) dynamically.

How to declare below in Hello.gram file :

public <greet> = ();  

I want to know how and what words i have to add in hello.gram and how to do it dynamically

Thanks in advance

Spartan
  • 3,213
  • 6
  • 26
  • 31

2 Answers2

2

Unless your IDs have some recurrent pattern, there's no way to add them dynamically. In this case you will have to make a list of them beforehand and make the corresponding grammar. See this answer on how to make grammar for recurrent IDs.

Community
  • 1
  • 1
Alexander Solovets
  • 2,447
  • 15
  • 22
  • Thanks for your answer @Alexander . can you please help me how to do for department ? how to add in hello.gram. No clear tutorials available on net. – Spartan Nov 19 '15 at 06:47
  • 1
    The link that I provided in the answer gives quit clear example of how to compose the grammar and http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4 will help you to run it. – Alexander Solovets Nov 19 '15 at 07:00
0

you can try something like below :

public <basicCmd> = <startPolite> <command> <endPolite>;

<command> = <action> <object>;
<action> = /10/ open |/2/ close |/1/ delete |/1/ move;
<object> = [the | a] (window | file | menu);
Spartan
  • 3,213
  • 6
  • 26
  • 31