The following contents apply only to the Professional Edition.
The dynamic grammar instantiation task can be used to instantiate grammars at application build time, or as part of a periodic maintenance process.
grammar.instantiation
| Attribute | Description | Required |
|---|---|---|
abnffile |
The name of the dynamic ABNF grammar file to instantiate. | Yes |
grdfile |
The name of the grammar coverage file
(.grd file) which contains the context to use for
the instantiation. When not specified, defaults to the value of the
abnffile attribute, but with
the .grd extension. |
No |
contextname |
The name of the instantiation context to use for the instantiation. | Yes |
engineId |
The name of the target speech recognition engine. This
identifier will be available in the template as Global.engineId |
No |
outfile |
The name of the output ABNF file resulting from the instantiation. | Yes |
failonerror |
Whether the build fails if a conversion error
occurs. Defaults to true. |
No |
The grammar.conversion task accepts any number
of classpath elements (see the Ant documentation
for more information). classpath elements are used
for dynamic grammars with Java instantiation contexts. They
specify the classpath entries required to load and run the Java
instantiation contexts.
<grammar.instantiation
abnffile="${basedir}/grammars/templates/billpayees.abnf"
contextname="CSV - Java"
engineId="OSR-3"
outfile="${basedir}/output/billpayees.abnf" />
is equivalent to
<grammar.instantiation
abnffile="${basedir}/grammars/templates/billpayees.abnf"
grdfile="${basedir}/grammars/templates/billpayees.grd"
contextname="CSV - Java"
outfile="${basedir}/output/billpayees.abnf" />
The following example explicitly specifies the classpath:
<grammar.instantiation
abnffile="${basedir}/grammars/templates/billpayees.abnf"
contextname="CSV - Java"
outfile="${basedir}/output/billpayees.abnf" >
<classpath>
<pathelement location="${basedir}/obj" />
</classpath>
</grammar.instantiation>