Cisco Customer Response Applications Editor Step Reference Guide (3.1)
Grammar Step Descriptions

Table of Contents

Grammar Step Descriptions
Create Language Grammar
Create Menu Grammar
Using Grammar Formats

Grammar Step Descriptions


The steps in the Grammar palette of the Cisco Customer Response Applications (CRA) Editor provide script designers with a way to specify a set of all possible spoken phrases and/or Dual Tone Multi-Frequency (DTMF) digits to be recognized by CRA applications and acted upon during run time.


Note   If you specify a Grammar tag with incorrect case in a Grammar step, the script goest to the Unsuccessful branch when it reaches this step. The Validate function does not detect this case mismatch. Ensure the proper case is used in every instance to avoid this issue..

This chapter contains the following sections:

Figure 10-1 shows the steps in the Grammar palette as they appear in the Palette pane of the CRA Editor.


Figure 10-1   Grammar Palette Steps


Create Language Grammar

Use the Language Grammar step to select a set of grammars based on the language context of the call.

Grammar selection is based on the standard search for a matching language. For example, assuming a language context of {L[fr_FR], L[en_GB]}, the search would return the first grammar defined for the following languages:

  • L[fr_FR]
  • L[fr]
  • L[en_GB]
  • L[en]
  • L[ ]

Figure 10-2 shows the customizer window for the Create Language Grammar step.


Figure 10-2   Create Language Grammar Customizer Window


Table 10-1 describes the properties of the Create Language Grammar step.

Table 10-1   Create Language Grammar Properties

Property Description

Output Grammar

Variable associated with the language grammar being created.

Language/Grammar

Grammar variables to use for the corresponding language.

This grammar can be the result of the Create Menu Grammar step or any grammar expression previously stored in a Grammar variable.

To use the Create Language Grammar customizer window to select a set of grammars, perform the following procedure:

Procedure

Step 1   From the Output Grammar drop-down menu, choose the variable that stores the language grammar information.

Step 2   Click Add.

The Add Language Grammar dialog box appears. (See Figure 10-3 .)


Figure 10-3   Add Language Grammar Dialog Box


Step 3   To choose the language to be added to the Language/Grammar list, take one of the following actions:

  • From the Language drop-down menu, choose the language variable that stores the grammar information.
  • Click the Expression Editor (...) button.

The Define Language dialog box appears. (See Figure 10-4 .)


Figure 10-4   Define Language Dialog Box


  • Choose the desired language from the Language display list, or enter the name of the desired language in the User Defined text field.
  • Click OK.

The Define Language dialog box closes, and the name of the language appears in the Language text field of the Add Language Grammar dialog box.

Step 4   From the Grammar drop-down menu, choose the Grammar variable that stores the grammar information for the language.

Step 5   Click OK.

The Add Language Grammar dialog box closes, and the names of the language and grammar appear in the Language and Grammar columns of the Create Language Grammar customizer window.

Step 6   Repeat Steps 3 to 5 as needed to add languages and grammars as desired.

(If you want to modify an existing language, click Modify. The Edit Language Grammar dialog box appears, which contains the same fields as the Add Language Grammar dialog box and is configured in the same way.)

Step 7   Click OK.

The Create Language Grammar customizer window closes.





Create Menu Grammar

Use the Create Menu Grammar step to create spoken word and/or DTMF menus in which the user makes a single choice from multiple options.

Each step holds the equivalent phrases or digits for the menu in corresponding languages. For each Create Menu Grammar step you create, you must assign a script variable of type grammar as the output variable.

By default, the actual language in which any grammar is played is determined by the language associated with the contact. When you define multiple grammars to be available, the script chooses a single grammar based on the language of the contact.

Figure 10-5 shows the customizer window for the Create Menu Grammar step.


Figure 10-5   Create Menu Grammar Customizer Window


Table 10-2 describes the properties of the Create Menu Grammar step.

Table 10-2   Create Menu Grammar Properties

Property Description

Output Grammar

Variable associated with the menu grammar being created

Grammar/Tag

Phrases and/or digits, and tags, created with the Create Menu Grammar step

To use the Create Menu Grammar customizer window to provide grammar for menus, perform the following procedure:

Procedure

Step 1   From the Output Grammar drop-down menu, choose the variable that stores the menu grammar information.

Step 2   Click Add.

The Add Phrase dialog box appears. (See Figure 10-6 .)


Figure 10-6   Add Phrase Dialog Box


Step 3   In the Grammar field, enter a value directly or take one of the following actions:

  • From the Grammar drop-down menu, choose the variable that stores the grammar information.
  • Click the Expression Editor (...) button and enter a phrase, grammar expression, or digits as a string expression.

Step 4   In the Tag text field, enter a tag name.

Tags for grammars are case-sensitive.

Step 5   Click OK.

The Add Phrase dialog box closes, and the names of the grammar and tag appear in the Grammar and Tag columns of the Create Menu Grammar customizer window.

Step 6   Repeat Steps 3 to 5 as needed to add grammars and tags as desired.

(If you want to modify an existing grammar, click Modify. The Edit Phrase dialog boxappears, which contains the same fields as the Add Phrase dialog box and is configured in the same way.)

Step 7   To import a list of phrases and tags delimited by tabs from a text file, click Import.

The Select a File dialog box appears. (See Figure 10-7 .)


Figure 10-7   Select a File Dialog Box


Step 8   Browse to the desired file, and then click Open.

The Select a File dialog box closes, and the phrases and tags appear in the Grammar/Tag list of the Create Menu Grammar customizer window.

Step 9   Click OK.

The Create Menu Grammar customizer window closes.





Using Grammar Formats

The following sections describe the two types of grammar formats you can use to specify grammars:

Using GSL File Grammar Format

The CRA Engine uses a language called Nuance Grammar Specification Language (GSL).

Table 10-3 describes sample expressions you can use to specify grammars in GSL.

Table 10-3   Grammar Expressions

Expression Description

[ ]

Only one of the words in the list must match.

( )

All words in the list must match.

?

The following word or phrase is optional.

{ }

Slot value pair

The following are examples of GSL language statements:

  • Digits [one two three four five six seven eight nine zero]
  • HowMany [I [want need] Digits [pencil pencils]]

In this example, the caller can say "I want" or "I need", followed by a number from zero to nine, and then either "pencil" or "pencils".

Using the Digit File Grammar Format

The Digit File Grammar Format (".digit") is based on Java Properties File, in which keys are defined as "dtmf-x", where "x" is from the set "0123456789*#ABCD" or one of "star" or "pound", where values are the corresponding tag to be returned when a key is pressed or recognized.

You can also use an optional entry defined as "word=true" to specify that the word representation of each DTMF digit should be automatically included during a recognition.

For example:

word=true
dtmf-star=bye
dtmf-4=4