Note that there are some explanatory texts on larger screens.

plurals
  1. POIs Web Speech API Grammar exposed to developers?
    primarykey
    data
    text
    <p>I am currently doing some RnD on Webkit Speech Recognition and I wanted to create an application specific grammar file. According W3C definition I wrote the following code. But it doesnt seem to show improved results in recognition for these words. Can you kindly provide some help with this.?</p> <p>var recognition = new webkitSpeechRecognition(); recognition.grammars.addFromUri("voice/api_grammar/weight.grxml");</p> <p>The grammar file is a simple file which looked like the following.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" "http://www.w3.org/TR/speech-grammar/grammar.dtd"&gt; &lt;grammar version="1.0" xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" mode="voice" root="sequence"&gt; &lt;meta name='description' content='Example using examples'/&gt; &lt;meta name='in.1' content='sunny Yorktown Heights New York United States'/&gt; &lt;meta name='out.1' content='$sequence[$repeat[$alternatives["sunny"]],$ruleref[$token["Yorktown Heights"]],$Token["New","York"],$TOKEN["United States"]]'/&gt; &lt;rule id="ruleref"&gt; &lt;example&gt;"Yorktown Heights"&lt;/example&gt; &lt;ruleref uri="#token"/&gt; &lt;/rule&gt; &lt;rule id="alternatives"&gt; &lt;example&gt;sunny&lt;/example&gt; &lt;example&gt;cloudy&lt;/example&gt; &lt;example&gt;warm&lt;/example&gt; &lt;example&gt;cold&lt;/example&gt; &lt;one-of&gt; &lt;item&gt; sunny &lt;/item&gt; &lt;item&gt; cloudy &lt;/item&gt; &lt;item&gt; warm &lt;/item&gt; &lt;item&gt; cold &lt;/item&gt; &lt;/one-of&gt; &lt;/rule&gt; &lt;rule id="repeat"&gt; &lt;example&gt;&lt;/example&gt; &lt;!-- for count=0 --&gt; &lt;example&gt;warm&lt;/example&gt; &lt;example&gt;warm sunny cloudy&lt;/example&gt; &lt;item repeat="0-3"&gt; &lt;ruleref uri="#alternatives"/&gt; &lt;/item&gt; &lt;/rule&gt; &lt;rule id="sequence"&gt; &lt;example&gt; warm sunny cloudy "Yorktown Heights" New York "United States" &lt;/example&gt; &lt;example&gt; warm sunny cloudy Yorktown Heights New York United States &lt;/example&gt; &lt;example&gt; &lt;!-- this example is actually wrong but that is legal --&gt; warm sunny cloudy "Yorktown Heights" New York "United States" &lt;/example&gt; &lt;ruleref uri="#repeat"/&gt; &lt;ruleref uri="#ruleref"/&gt; &lt;ruleref uri="#Token"/&gt; &lt;ruleref uri="#TOKEN"/&gt; &lt;/rule&gt; &lt;/grammar&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload