W3C home > Mailing lists > Public > public-speech-api@w3.org > May 2012

Re: Revised SpeechRecognitionResult

From: Satish S <satish@google.com>
Date: Wed, 23 May 2012 15:01:35 +0100
Message-ID: <CAHZf7RmHLOHV5_MnupPeW1fLonJvaSh0NZM8MWcoc_t7o5ZbNw@mail.gmail.com>
To: Hans Wennborg <hwennborg@google.com>
Cc: "Young, Milan" <Milan.Young@nuance.com>, "public-speech-api@w3.org" <public-speech-api@w3.org>
I'd prefer not having such shortcuts in the API. As a parallel, see the W3C
File API's FileList interface
http://www.w3.org/TR/FileAPI/#dfn-filelist

To read the size of a file you'd have to do:
    var size = document.forms['uploadData']['fileChooser'].files[0].size;
but that hasn't resulted in a shorter version like
    var size = document.forms['uploadData']['fileChooser'].size;

If developers are accessing "item[0].utterance" more than once in their
code they'd usually do
  var item = event.result.item[0];
  .. = item.utterance

Cheers
Satish


On Wed, May 23, 2012 at 12:11 PM, Hans Wennborg <hwennborg@google.com>
wrote:
>
> On Tue, May 22, 2012 at 7:22 PM, Young, Milan <Milan.Young@nuance.com>
wrote:
> > Hello Hans,
> >
> > It's not uncommon for recognition engines to return a guess at what the
user said/meant even for a nomatch result.  So we shouldn't rule this out
in the API.
>
> Right. The spec currently says "nomatch event: [...] The result field
> in the event may contain speech recognition results that are below the
> confidence threshold or may be null."
>
> So that covers both cases.
>
> > As far as communicating this with a null vs event, I have a slight
preference for an event.  Two reasons:
>
> I'm not sure what you mean by "communication this with a null vs
> event". I was talking about returning null or throwing an exception.
> Is that what you mean?
>
> >  * Easier for implementers.  This is a true alias.
>
> I'm not sure what you mean by true alias.
>
> >  * We may want to allow empty interpretations or utterances, and thus a
null would be ambiguous.
>
> Ah, yes. So throwing an exception seems like the better option.
>
> Thanks,
> Hans
>
Received on Wednesday, 23 May 2012 14:02:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 23 May 2012 14:02:12 GMT