- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Looking at the demo application for voice recognition, there are tags available on commands, it iterates through them and reports them back to the form.
But if I create a grammar file for commands and add a tag, it fails to load. So this is OK:
public <play> = (play [(video | movie)]);
But this causes a loading error:
public <play> = (play [(video | movie)]) {play};
Is this a bug or not fully implemented? Without tags, voice commands become much harder to process.
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Here is the description from the JSGF specification:
Tags can simplify the writing of applications by simplifying the processing of recognition results. The content of tags, and the use of tags are entirely up to the discretion of the developer.
One important use of tags is in internationalizing applications. The following are examples of rule definitions for four grammars, each for a separate language. The application loads the grammar for the language spoken by the user into an appropriate recognizer. The tags remain the same across all languages and thus simplify the application software that processes the results. Typically, the grammar name will include the language identifier so that it can be programmatically located and loaded.
In the English grammar:
In the Japanese grammar:
In the German grammar:
In the French grammar:
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I've spent today setting up voice recognition comands, mainly to familiarise myself with the way sessions and modules are configured.
One thing I spotted was that the demo is set to not use JSGF files, which I thought would explain my problems with tags. However, having changed the parameter, it still doesn't work. What it does do, is disable the camera!
So no luck on this front, but hopefully it saves others from going through the same pain.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello, steve-vink.
Could you share full text of .jsgf file?
But, Looks like "public <play> = (play [(video | movie)]) {play};"
"play" cannot be used for tag and name at the same time. Try to write: "public <play> = (play [(video | movie)]) {Play};"
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Apologies for the delay in responding
Your advice is correct, the label and tags need to be different, and are case-sensitive. This works:
public <play> = (play [(video | movie)]) {PLAY};
public <select> = (select [(video | movie)]) {SELECT};
public <pause> = (pause [(video | movie)]) {PAUSE};
However I'm still a bit confused. The tag value returns this:
"{ \"tags\" : { \"player#SELECT\" : \"select\" } }"
Which I guess reduces to :
{ "tags" : { "player#SELECT" : "select" } }
I was expecting to see just "SELECT" which would be so much easier to capture in code.
