The most common type of grammar is a MappingRule
(or MergeRule
in Caster). It is built from three variables:
- a
mapping
dictionary - an
extras
list - and an optional
defaults
dictionary.
A mapping
maps a specially formatted spoken phrase to some Action
class, usually some combination of Key
, Text
, or Function
.
A spoken phrase is usually some combination of the following:
- literal spoken text
- alternatives separated by
|
and grouped by()