| How to generate a dynamic grammar at runtime |
| Categories: Audium OpenSDK, Audium Studio (3.4.x) |
| Article ID: | 42 |
| Last updated: | February 28, 2006 |
| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
SUMMARY
This article explains how a dynamic grammar can be generated from a database at runtime for use by an Audium application.
SYMPTOMS
There exists a changing list of items that needs to be included in a grammar that live calls will access. For example, callers can specify the name of a person, and the list of valid names is constantly changing.
RESOLUTION
Any dynamic web programming language that can access your database (e.g. ASP, PHP, JSP, etc.) can be used to generate a dynamic grammar.
For example, a PHP page can be written (e.g. "mygrammar.php") that looks up a list of names from a database, and then returns a valid XML grammar. If you reference this PHP page as an external grammar from within your Audium applications (e.g., "http://myhost:port/mygrammar.php"), the grammar will be generated dynamically for each call, including the latest information.
For an advanced example of how this can be used in a real application, please refer to the Hollywood Hotel sample application.
This is also a useful approach in situations where the data may not regularly change, but the grammars for each item are so similar that it makes sense to write the grammar structure once, and have the values subsituted at runtime. For example, a long list of codes that need to be recognized. While the codes may not change, it is simple to write a dynamic web page that generates a grammar to match the codes, rather than having to hard code all of the utterances into a grammar.
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|
| Attachments |
|
No attachments were found.
|