<nuance:nbest>

Selects the best recognition result from a list returned by the recognizer.

Attributes

This section describes the attributes you can set for this element.

Name

Data type

Default

charset

CDATA

optional

fetchhint

(prefetch | safe)

optional

fetchtimeout

CDATA

optional

maxage

CDATA

optional

maxstale

CDATA

optional

src

CDATA

optional

charset

The charset attribute specifies the character encoding of the remote script. For example:

<script src="remote_script.js" charset="ISO8859_1"/>

For a complete list of all encoding types, click here.

Note: Voice Platform supports all encoding types supported by Java2.

fetchhint

The fetchhint attribute determines when content is retrieved from the server. The settings for the fetchhint attribute are prefetch and safe. The prefetch setting indicates that files or dialogs are downloaded when a page is loaded. The safe setting indicates that files or dialogs are downloaded only when they are actually needed.

If you do not specify a setting for the fetchhint attribute, the <property> element determines the setting by defining a value for the appropriate *fetchhint property, for example:

<property name="documentfetchhint" value="safe"/>

fetchtimeout

The fetchtimeout attribute specifies the amount of time to wait for the content to be fetched before throwing an error.badfetch event.

The value may be specified in seconds (s) or milliseconds (ms). If no unit is specified, the value is interpreted as milliseconds by default. If no value is specified, the fetchtimeout defaults to the value set an applicable <property> element, or to the value set for the browser.loading.fetchtimeout property in the Management Station if no <property> applies. If no other default applies, the platform default of 10000 milliseconds is used.

maxage

The maxage attribute specifies the maximum amount of time a fetched resource may remain in the locale cache without requiring a server revalidation. If a value for the maxage attribute is not specified, revalidation will occur after the expiration of the freshness lifetime (as defined in RFC 2616).

maxstale

The maxstale attribute specifies the maximum amount of time a stale file remains valid before a refetch is required. If a value for the maxstale attribute is not specified, the stale document is refetched.

src

The src attribute specifies the URI location of the script file.

Note: Only one src attribute or PCDATA inline content may be specified.

Children

Parsed character data

Parents

Sample code

<grammar src="mygrammar.grxml">
    <nuance:nbest>
        <![CDATA[
        for(var i = 0; i < lastresult$.length; i++)
        {
            var number = lastresult$[i].interpretation.number;
            if(number!= undefined && skiplist[number] ==
            undefined)
            return lastresult$[i];
        }
        // No appropriate result was found, so mark
        // the first one as an alternate and return it.
        lastresult$[0].alternate = true;
        return lastresult$[0];
        ]]>
    </nuance:nbest>
</grammar>