Changes were introduced to the Speech Tuner in version 14.1, which fundamentally altered the way in which grammars and any referenced customer grammars were organized within the sandbox as well as in memory when being used by the Tuner.
These changes were needed to address issues with certain combinations of grammar relationships that are possible when using multiple versions of those related grammars.
Before getting into more of the details around these grammar reference issues, it is probably good to go over some definitions and terminology, since this can be very confusing. We use this terminology to describe how grammars are used by the application, in a logical and meaningful way - ideally referencing something that a user may understand.
Within the Speech Tuner we group together grammars into meaningful collections that make sense to users. By definition, there is at least one grammar reference (inline buffer, file or URL) used for every ASR interaction. Sometimes there are more than one unrelated top-level (root) grammars used for an interaction, or there may be some other grammars referenced by one or more of these top-level grammars.
So, a Menu could be using only a single grammar reference, or many - here are a couple of examples:
Figure 1 - Menu with two top level grammars
Figure 2 - Menu with two top level grammars, one of which has child and grandchild references
Whatever combination is used, this collective is typically associated with a single Menu choice, or Dialog (in VXML terminology). Typically, speech applications have several of these Menus or Dialogs as the user traverses the application. The Speech Tuner refers to each unique collection of grammars associated with a single Dialog/Menu as a Grammar "Menu".
A Grammar Set is a unique combination of grammars. This means that every "Menu" has at least one Grammar Set associated with it, or one unique combination of grammars.
The reason that there is not a one-to-one relationship between Menus and Grammar Sets is because several variants of the grammars may exist - for example, one of the grammars in the combination may have been edited. This does not mean it no longer relates to the same Menu (it does), but the unique combination of grammars has changed, therefore the Tuner needs to make clones of the unchanged files, so that each collection of grammars remains separate from others. It doesn't matter which grammar in the combination has changed, just that a change has happened. Every time this is detected (while loading interactions or response files, or while manually editing grammars within the Tuner), a new Grammar Set is created if needed to maintain track of all unique instances.
Figure 3 - Same Menu, but 3 different Grammar Sets
This is illustrated in Figure 3, which shows a single Menu. The Grammar Set on the left is the original Grammar Set, and the other two were created due to edits to the Language Selection grammars. This would result in a single Menu that has 3 related Grammar Sets.
Now, this can be very confusing to users, since there is no "clear" way to know which Grammar Set is being referred to. This is why the Speech Tuner allows you to select Individual Grammar Sets and review them, as well as assign "friendly" (or meaningful) names to them.
Tip: The Speech Tuner is not going to know the reasons behind why changes were made between Grammar Sets, just that they were, so it likely just numbered them as something like "Grammar Set 1", "Grammar Set 2" and "Grammar Set 3". You could modify the "friendly" names associated with these three Grammars Sets so that they are more meaningful to you while working with the Tuner - perhaps something like "English Only Grammar Set", "Added French Grammar Set" and "Added Spanish Grammar Set". Clearly these will have more meaning to you as you work.
Note that in the above example, the "Language Selection Grammar" was changed, so there are 3 different copies of it. The "Operator Grammar" was not changed, however there are still three copies of it, with identical contents. Each copy is uniquely associated with its own Grammar Set, to avoid any possible reference issues.
Understanding the above distinctions between Menus, Grammar Sets and why there may be multiple Grammar Sets associated with a single Menu is critical to getting a full understanding of how to deal with grammars within the Speech Tuner environment, and is also helpful when you are keeping track of your own grammar changes over time.
Changes Introduced in 14.1
Now that we've described Menus, Grammar Sets and how they relate, we can describe some of the problems that a small number of customers encountered prior to version 14.1 - specifically, the Speech Tuner was not able to accurately track all instances of modified grammars' original references, so in other words, some Grammar Sets could be created with missing grammar references. This anomaly resulted in grammar loading errors for those affected Grammar Sets, which was very confusing to those users that were affected.
As part of the changes made for the 14.1 release, the way in which Grammar Sets was organized was redone to address this issue, so it should not affect users of 14.1 and later Speech Tuners.
Another thing that was noticed while making these changes is that there may be completely isolated copies/clones of certain referenced grammars in existence now (for example unmodified copies of grammars that are common to multiple Grammar Sets), if someone was to modify one of these grammars using the Grammar Editor within the Speech Tuner, it is possible they intended this change to be made to more than just the one instance being edited.
An example of this, taken from Figure 3 above, would be if you decided to modify the "Operator Grammar" - there are three copies of it (one for each unique Grammar Set), however if you edit one of them, is your intent to simply modify that one instance, or have your changes copied to all three?
Starting In version 14.1, the Speech Tuner will now automatically detect any changes to grammars that are related in this way, and offer the user a dialog box describing which grammars are potentially affected by a change, and give them the choice of whether to copy those changes to those other grammars or not. This is done using the new matching files update selection dialog as shown below:
Figure 4 - Matching Files Update Selection Dialog
In the dialog shown, you can see that the Speech Tuner has identified five possible matches for the grammar that was edited, and offers you the choice of updating them, by selecting the corresponding checkbox(es) and pressing the OK button.
Users also have the choice of skipping any other file updates and only update the one file that was edited using the Skip button. Also, if someone needs to preview the contents of the affected files, they can highlight it, then click the "Preview Selected Grammar" button.
We hope that these changes make the referencing and updating of related grammar references that are organized in this way easier to manage and understand. As always, if you are uncertain about the location or specific details of a grammar within the Speech Tuner, you can right click on it in the lists of the main views and see its properties to get information about its URI, its Grammar Index (a unique integer reference to the file, used internally by the Speech Tuner to uniquely identify it), or other detailed parameters.