Builtin grammars
LumenVox provides the following built-in grammars expected by VoiceXML users:
URI | Sample Input | Semantic Interpretation Result |
builtin:grammar/boolean | "yes", "no thank you", etc. | "true" or "false" |
builtin:grammar/date | "january thirteenth" or "december first two thousand" | "????0113" or "20001201" |
builtin:grammar/digits | "one two three four" | "1234" |
builtin:grammar/currency | "eighteen dollars and four cents" | "USD18.04" |
builtin:grammar/number | "four hundred point five" | "400.5" |
builtin:grammar/phone | "area code eight five eight seven oh seven oh seven oh seven" | "8587070707" |
builtin:grammar/time | "six o clock" or "five thirty p m" | "0600?" or "0530p" |
Switching the Language for Built-in Grammars
By default, built-in grammars use US English as their language. So simply specifying builtin:grammar/digits will cause the ASR to use the US English digits grammar. However, if you are working with other languages, it can be useful to switch the language used with built-in grammars.
Changing language with SetPropertyEx
Users writing applications using LumenVox' C or C++ API should use the appropriate function as discussed in the Speech Port Properties articles to set the PROP_EX_BUILTIN_GRAMMAR_LANGUAGE property to the appropriate language identifier. For example, to use Mexican Spanish, the following C code would achieve the desired result:
char * builtin_language = "es-MX"; LV_SRE_SetPropertyEx(NULL, PROP_EX_BUILTIN_GRAMMAR_LANGUAGE, PROP_EX_VALUE_TYPE_STRING, (void*)builtin_language, PROP_EX_TARGET_CLIENT, 0); |
Using Built-in Grammars with MRCP
When using MRCP connectivity with LumenVox via the Media Server interface, you also need to specify the language you would like to use for builtin grammars, since the name itself does not indicate any language.
To do this, you need to ensure that your MRCP request (RECOGNIZE, SET-PARAMS, DEFINE-GRAMMAR, INTERPRET-TEXT, etc.) has the correct 'Speech-Language' header assigned to the request packet, as shown below:
RTSP (MRCPv1) "DEFINE-GRAMMAR" Example using Brazilian Portuguese:
C->S: DEFINE-GRAMMAR 543258 MRCP/1.0 Content-Type: text/uri-list Speech-Language: pt-BR Content-Length: 22 builtin:grammar/digits S->C: MRCP/1.0 543259 200 COMPLETE |
SIP (MRCPv2) "DEFINE-GRAMMAR" Example using Brazilian Portuguese:
C->S: MRCP/2.0 ... DEFINE-GRAMMAR 543258 Channel-Identifier:32AECB23433802@speechrecog Content-Type: text/uri-list Speech-Language: pt-BR Content-Length: 22 builtin:grammar/digits S->C: MRCP/2.0 ... 543259 200 COMPLETE Channel-Identifier:32AECB23433802@speechrecog |
Modifying or adding to Built-in Grammars
All of the built-in grammars are stored on disk in one of these two locations, based on your Operating System:
- Windows: Program Files\LumenVox\Engine\Lang\BuiltinGrammars\voice\
- Linux: /etc/lumenvox/Lang/BuiltinGrammars/voice/
Inside the voice directory are sub-directories with language identifiers (such as en-US). Inside each individual language directory is a set of grammars whose names correspond to the built-in grammars described in this article (e.g. digits, phone, etc.).
This same logic also allows users to modify the behavior of the existing built-in grammars by modifying the contents of the existing directories, however we recommend you back up your files before making changes to them so that the originals can be restored in the event that you later wish to revert your changes.
In addition to the existing builtin grammars, you are also able to add your own grammars into these folders and reference them using the builtin syntax. For example, if you wanted to add a new British English welcome grammar, you could simply create a grammar file with the name welcome inside the BuiltinGrammars/voice/en-GB/ folder, which could then be referenced as builtin:grammar/welcome within your application code whenever you have the British English (en-GB) language active. Note that you will have to create these grammars yourself, but you can use our existing built-in grammars as a guide.
Built-in Grammars
A broader selection of built-in grammars was added across all supported ASR languages. These are described in the following table:
boolean | currency | date | digits | number | phone | time | |
---|---|---|---|---|---|---|---|
American English en-US | |||||||
British English en-GB | |||||||
Australian English en-AU | |||||||
Indian English en-IN | |||||||
Colombian Spanish es-CO | |||||||
Mexican Spanish es-MX | |||||||
Canadian French fr-CA | |||||||
Brazilian Portuguese pt-BR | |||||||
German 1 de-DE | |||||||
Italian 2 it-IT |
Notes:
1 Support for the German (de-DE) ASR language was introduced in LumenVox version 15.1.100
2 Support for the Italian (it-IT) ASR language was introduced in LumenVox version 16.0.100
Other special grammars
In addition to the above builtin grammars, which may commonly be used in VXML, there are some additional builtin grammars that are designed to work with our Answering Machine Detection (AMD) and Call Progress Analysis (CPA) products, and provide a convenient way to activate this behavior. These special builtin grammars are described below:
URI | Description |
builtin:special/amd | Answering Machine Detection (AMD) |
builtin:special/cpa | Call Progress Analysis |
Builtin Grammars Prior to Version 15.0
Earlier versions of LumenVox only included a limited number of builtin grammars, with some languages (notably en-US and es-MX) having more grammars than other languages, however users were, and still are, free to add other custom builtin grammars for their chosen languages, as described above.
Some version specific changes to builtin grammars are shown below:
Version 14.1
Prior to version 14.1, LumenVox only provided builtin grammars for en-US and es-MX ASR languages. With the introduction of version 14.1, LumenVox also provided simple builtin:grammar/digits for all supported ASR languages.
Version 14.2
With the release of LumenVox 14.2, support for builtin:grammar/boolean was added for the Brazilian Portuguese (pt-BR) ASR language.
Behavior of Builtin Grammars
There is no clearly defined behavior specified for any of the builtin grammars, which is why we do not support all possible combinations in all languages.
We have, however, exposed the above mechanism that allows developers to create their own builtin grammars, or modify the simply templates provided by LumenVox as needed, which is described above.
Since there is no universally accepted definition for these grammars, users often have differing requirements, so the goal of providing these builtin grammars, is to allow developers to use these as templates where needed for their own specific needs. If users have any suggestions for additions or changes to our builtin grammar support, please contact your Client Services representative.