Minor wording changes to add clarity: result and nomatch event, stop method, consistent headings.
authorGlen Shires <gshires@google.com>
Fri, 12 Oct 2012 23:30:32 -0700
changeset 50 a561a5ec2d65
parent 49 d04767158d4c
child 51 18ba5d8b0530
Minor wording changes to add clarity: result and nomatch event, stop method, consistent headings.
speechapi.html
--- a/speechapi.html	Wed Oct 10 15:02:14 2012 -0700
+++ b/speechapi.html	Fri Oct 12 23:30:32 2012 -0700
@@ -343,7 +343,7 @@
       <p><a href="http://www.w3.org/"><img alt=W3C height=48 src="http://www.w3.org/Icons/w3c_home" width=72></a></p>
       <!--end-logo-->
       <h1 id="title_heading">Speech JavaScript API Specification</h1>
-      <h2 class="no-num no-toc" id="draft_date">Editor's Draft: 9 October 2012</h2>
+      <h2 class="no-num no-toc" id="draft_date">Editor's Draft: 12 October 2012</h2>
       <dl>
         <dt>Editors:</dt>
         <dd>Glen Shires, Google Inc.</dd>
@@ -618,7 +618,7 @@
     interface <dfn id="dfn-speechgrammarlist">SpeechGrammarList</dfn> {
         readonly attribute unsigned long <a href="#dfn-speechgrammarlistlength">length</a>;
         getter <a href="#dfn-speechgrammar">SpeechGrammar</a> <a href="#dfn-speechgrammarlistitem">item</a>(in unsigned long index);
-        void <a href="#dfn-addGrammar">addFromUri</a>(in DOMString <a href="#dfn-grammarSrc">src</a>,
+        void <a href="#dfn-addGrammar">addFromURI</a>(in DOMString <a href="#dfn-grammarSrc">src</a>,
                         optional float <a href="#dfn-grammarWeight">weight</a>);
         void <a href="#dfn-addGrammarstring">addFromString</a>(in DOMString <a href="#dfn-grammarString">string</a>,
                         optional float <a href="#dfn-grammarWeight">weight</a>);
@@ -668,21 +668,21 @@
     <h4 id="speechreco-methods"><span class=secno>5.1.2 </span>SpeechRecognition Methods</h4>
 
     <dl>
-      <dt>The <dfn id="dfn-start">start</dfn> method</dt>
+      <dt><dfn id="dfn-start">start</dfn> method</dt>
       <dd>When the start method is called it represents the moment in time the web application wishes to begin recognition.
       When the speech input is streaming live through the input media stream, then this start call represents the moment in time that the service <em class="rfc2119" title="must">must</em> begin to listen and try to match the grammars associated with this request.
       Once the system is successfully listening to the recognition the user agent <em class="rfc2119" title="must">must</em> raise a start event.
       If the start method is called on an already started object (that is, start has previously been called, and no error or end event has fired on the object), the user agent <em class="rfc2119" title="must">must</em> throw an <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#invalidstateerror">InvalidStateError</a> exception and ignore the call.</dd>
 
-      <dt>The <dfn id="dfn-stop">stop</dfn> method</dt>
-      <dd>The stop method represents an instruction to the recognition service to stop listening to more audio, and to try and return a result using just the audio that it has received to date.
+      <dt><dfn id="dfn-stop">stop</dfn> method</dt>
+      <dd>The stop method represents an instruction to the recognition service to stop listening to more audio, and to try and return a result using just the audio that it has already received for this recognition.
       A typical use of the stop method might be for a web application where the end user is doing the end pointing, similar to a walkie-talkie.
       The end user might press and hold the space bar to talk to the system and on the space down press the start call would have occurred and when the space bar is released the stop method is called to ensure that the system is no longer listening to the user.
       Once the stop method is called the speech service <em class="rfc2119" title="must not">must not</em> collect additional audio and <em class="rfc2119" title="must not">must not</em> continue to listen to the user.
-      The speech service <em class="rfc2119" title="must">must</em> attempt to return a recognition result (or a nomatch) based on the audio that it has collected to date.
+      The speech service <em class="rfc2119" title="must">must</em> attempt to return a recognition result (or a nomatch) based on the audio that it has already collected for this recognition.
       If the stop method is called on an object which is already stopped or being stopped (that is, start was never called on it, the end or error event has fired on it, or stop was previously called on it), the user agent <em class="rfc2119" title="must">must</em> ignore the call.</dd>
 
-      <dt>The <dfn id="dfn-abort">abort</dfn> method</dt>
+      <dt><dfn id="dfn-abort">abort</dfn> method</dt>
       <dd>The abort method is a request to immediately stop listening and stop recognizing and do not return any information but that the system is done.
       When the abort method is called, the speech service <em class="rfc2119" title="must">must</em> stop recognizing.
       The user agent <em class="rfc2119" title="must">must</em> raise an end event once the speech service is no longer connected.
@@ -728,15 +728,16 @@
 
       <dt><dfn id="dfn-onresult">result</dfn> event</dt>
       <dd>Fired when the speech recognizer returns a result.
-      See <a href="#speechreco-event">here</a> for more information.</dd>
+      The event <em class="rfc2119" title="must">must</em> use the <a href="#speechreco-event">SpeechRecognitionEvent</a> interface.</dd>
 
       <dt><dfn id="dfn-onnomatch">nomatch</dfn> event</dt>
       <dd>Fired when the speech recognizer returns a final result with no recognition hypothesis that meet or exceed the confidence threshold.
-      The result field in the event <em class="rfc2119" title="may">may</em> contain speech recognition results that are below the confidence threshold or <em class="rfc2119" title="may">may</em> be null.</dd>
+      The event <em class="rfc2119" title="must">must</em> use the <a href="#speechreco-event">SpeechRecognitionEvent</a> interface.
+      The <a href="#dfn-results">results</a> attribute in the event <em class="rfc2119" title="may">may</em> contain speech recognition results that are below the confidence threshold or <em class="rfc2119" title="may">may</em> be null.</dd>
 
       <dt><dfn id="dfn-onerror">error</dfn> event</dt>
       <dd>Fired when a speech recognition error occurs.
-      The event <em class="rfc2119" title="must">must</em> use the SpeechRecognitionError interface.</dd>
+      The event <em class="rfc2119" title="must">must</em> use the <a href="#speechreco-error">SpeechRecognitionError</a> interface.</dd>
 
       <dt><dfn id="dfn-onstart">start</dfn> event</dt>
       <dd>Fired when the recognition service has begun to listen to the audio with the intention of recognizing.
@@ -748,9 +749,9 @@
 
     <h4 id="speechreco-error"><span class=secno>5.1.4 </span>SpeechRecognitionError</h4>
 
-    <p>The speech recognition error object has two attributes <code>code</code> and <code>message</code>.</p>
+    <p>The SpeechRecognitionError event is the interface used for the <a href="#dfn-onerror">error</a> event.</p>
     <dl>
-      <dt><dfn id="dfn-error">error</dfn></dt>
+      <dt><dfn id="dfn-error">error</dfn> attribute</dt>
       <dd>The errorCode is an enumeration indicating what has gone wrong.
       The values are:
       <dl>
@@ -780,7 +781,7 @@
       </dl>
       </dd>
 
-      <dt><dfn id="dfn-message">message</dfn></dt>
+      <dt><dfn id="dfn-message">message</dfn> attribute</dt>
       <dd>The message content is implementation specific.
       This attribute is primarily intended for debugging and developers should not use it directly in their application user interface.</dd>
     </dl>
@@ -790,11 +791,11 @@
     <p>The SpeechRecognitionAlternative represents a simple view of the response that gets used in a n-best list.
 
     <dl>
-      <dt><dfn id="dfn-transcript">transcript</dfn></dt>
+      <dt><dfn id="dfn-transcript">transcript</dfn> attribute</dt>
       <dd>The transcript string represents the raw words that the user spoke.
       For continuous recognition, leading or trailing whitespace MUST be included where necessary such that concatenation of consecutive SpeechRecognitionResults produces a proper transcript of the session.</dd>
 
-      <dt><dfn id="dfn-confidence">confidence</dfn></dt>
+      <dt><dfn id="dfn-confidence">confidence</dfn> attribute</dt>
       <dd>The confidence represents a numeric estimate between 0 and 1 of how confident the recognition system is that the recognition is correct.
       A higher number means the system is more confident.
       <i>[Editor note: The group is currently discussing whether confidence can be specified in a speech-recognition-engine-independent manner and whether confidence threshold and nomatch should be included, because this is not a dialog API.] <a href="#ref-4">[4]</a></i></dd>
@@ -805,16 +806,16 @@
     <p>The SpeechRecognitionResult object represents a single one-shot recognition match, either as one small part of a continuous recognition or as the complete return result of a non-continuous recognition.</p>
 
     <dl>
-      <dt><dfn id="dfn-length">length</dfn></dt>
+      <dt><dfn id="dfn-length">length</dfn> attribute</dt>
       <dd>The long attribute represents how many n-best alternatives are represented in the item array.</dd>
 
-      <dt><dfn id="dfn-item">item</dfn></dt><dt>
-      </dt><dd>The item getter returns a SpeechRecognitionAlternative from the index into an array of n-best values.
+      <dt><dfn id="dfn-item">item</dfn> getter</dt>
+      <dd>The item getter returns a SpeechRecognitionAlternative from the index into an array of n-best values.
       If index is greater than or equal to length, this returns null.
       The user agent <em class="rfc2119" title="must">must</em> ensure that the length attribute is set to the number of elements in the array.
       The user agent <em class="rfc2119" title="must">must</em> ensure that the n-best list is sorted in non-increasing confidence order (each element must be less than or equal to the confidence of the preceding elements).</dd>
 
-      <dt><dfn id="dfn-final">final</dfn></dt>
+      <dt><dfn id="dfn-final">final</dfn> attribute</dt>
       <dd>The final boolean <em class="rfc2119" title="must">must</em> be set to true if this is the final time the speech service will return this particular index value.
       If the value is false, then this represents an interim result that could still be changed.</dd>
     </dl>
@@ -825,10 +826,10 @@
     For a non-continuous recognition it will hold only a single value.</p>
 
     <dl>
-      <dt><dfn id="dfn-speechrecognitionresultlistlength">length</dfn></dt>
+      <dt><dfn id="dfn-speechrecognitionresultlistlength">length</dfn> attribute</dt>
       <dd>The length attribute indicates how many results are represented in the item array.</dd>
 
-      <dt><dfn id="dfn-speechrecognitionresultlistitem">item</dfn></dt>
+      <dt><dfn id="dfn-speechrecognitionresultlistitem">item</dfn> getter</dt>
       <dd>The item getter returns a SpeechRecognitionResult from the index into an array of result values.
       If index is greater than or equal to length, this returns null.
       The user agent <em class="rfc2119" title="must">must</em> ensure that the length attribute is set to the number of elements in the array.</dd>
@@ -839,10 +840,10 @@
     <p>The SpeechRecognitionEvent is the event that is raised each time there are any changes to interim or final results.</p>
 
     <dl>
-      <dt><dfn id="dfn-resultIndex">resultIndex</dfn></dt>
+      <dt><dfn id="dfn-resultIndex">resultIndex</dfn> attribute</dt>
       <dd>The resultIndex <em class="rfc2119" title="must">must</em> be set to the lowest index in the "results" array that has changed.</dd>
 
-      <dt><dfn id="dfn-results">results</dfn></dt>
+      <dt><dfn id="dfn-results">results</dfn> attribute</dt>
       <dd>The array of all current recognition results for this session.
       Specifically all final results that have been returned, followed by the current best hypothesis for all interim results.
       It <em class="rfc2119" title="must">must</em> consist of zero or more final results followed by zero or more interim results.
@@ -853,13 +854,13 @@
       The length of the "results" array may increase or decrease, but <em class="rfc2119" title="must">must</em> not be less than resultIndex.
       Note that when resultIndex equals results.length, no new results are returned, this may occur when the array length decreases to remove one or more interim results.</dd>
 
-      <dt><dfn id="dfn-interpretation">interpretation</dfn></dt>
+      <dt><dfn id="dfn-interpretation">interpretation</dfn> attribute</dt>
       <dd>The interpretation represents the semantic meaning from what the user said.
       This might be determined, for instance, through the SISR specification of semantics in a grammar.
       <i>[Editor note: The group is currently discussing options for the value of the interpretation attribute when no interpretation has been returned by the recognizer.
       Current options are 'null' or a copy of the transcript.] <a href="#ref-2">[2]</a></i></dd>
 
-      <dt><dfn id="dfn-emma">emma</dfn></dt>
+      <dt><dfn id="dfn-emma">emma</dfn> attribute</dt>
       <dd>EMMA 1.0 representation of this result. <a href="#ref-emma">[EMMA]</a>
       The contents of this result could vary across user agents and recognition engines, but all implementations <em class="rfc2119" title="must">must</em> expose a valid XML document complete with EMMA namespace.
       User agent implementations for recognizers that supply EMMA <em class="rfc2119" title="must">must</em> contain all annotations and content generated by the recognition resources utilized for recognition, except where infeasible due to conflicting attributes.
@@ -889,22 +890,22 @@
     This structure has the following attributes:</p>
 
     <dl>
-      <dt><dfn id="dfn-speechgrammarlistlength">length</dfn></dt>
+      <dt><dfn id="dfn-speechgrammarlistlength">length</dfn> attribute</dt>
       <dd>The length attribute represents how many grammars are currently in the array.</dd>
 
-      <dt><dfn id="dfn-speechgrammarlistitem">item</dfn></dt>
+      <dt><dfn id="dfn-speechgrammarlistitem">item</dfn> getter</dt>
       <dd>The item getter returns a SpeechGrammar from the index into an array of grammars.
       The user agent <em class="rfc2119" title="must">must</em> ensure that the length attribute is set to the number of elements in the array.
       The user agent <em class="rfc2119" title="must">must</em> ensure that the index order from smallest to largest matches the order in which grammars were added to the array.</dd>
 
-      <dt>The <dfn id="dfn-addGrammar">addFromURI</dfn> method</dt>
+      <dt><dfn id="dfn-addGrammar">addFromURI</dfn> method</dt>
       <dd>This method appends a grammar to the grammars array parameter based on URI.
       The URI for the grammar is specified by the <a href="#dfn-grammarSrc">src</a> parameter, which represents the URI for the grammar.
       Note, some services may support builtin grammars that can be specified by URI.
       If the <a href="#dfn-grammarWeight">weight</a> parameter is present it represents this grammar's weight relative to the other grammar.
       If the weight parameter is not present, the default value of 1.0 is used.</dd>
 
-      <dt>The <dfn id="dfn-addGrammarstring">addFromString</dfn> method</dt>
+      <dt><dfn id="dfn-addGrammarstring">addFromString</dfn> method</dt>
       <dd>This method appends a grammar to the grammars array parameter based on text.
       The content of the grammar is specified by the <dfn id="dfn-grammarString">string</dfn> parameter.
       This content should be encoded into a data: URI when the SpeechGrammar object is created.
@@ -1149,10 +1150,10 @@
     <p>The SpeechSynthesisVoiceList object holds a collection of SpeechSynthesisVoice objects. This structure has the following attributes.</p>
 
     <dl>
-      <dt><dfn id="dfn-voicelistlength">length</dfn></dt>
+      <dt><dfn id="dfn-voicelistlength">length</dfn> attribute</dt>
       <dd>The length attribute indicates how many results are represented in the item array.</dd>
 
-      <dt><dfn id="dfn-voicelistitem">item</dfn></dt>
+      <dt><dfn id="dfn-voicelistitem">item</dfn> getter</dt>
       <dd>The item getter returns a SpeechSynthesisVoice from the index into an array of result values.
       If index is greater than or equal to length, this returns null.
       The user agent <em class="rfc2119" title="must">must</em> ensure that the length attribute is set to the number of elements in the array.</dd>