Web API Issue 5

F2F Agenda issues last issue next issue

Raised by: Robert in mail.

Raised by: Glen in mail.

The array of SpeechGrammar objects is too cumbersome.

Discussion: Robert: The array of SpeechGrammar objects is too cumbersome. In most cases I'd like to write something simple like:

mySR.speechGrammars.push("USstates.grxml","majorUScities.grxml","majorInternationalCities.grxml"); But I can't. I have new-up a separate object for each one then add it to the array, even when I don't care about the other attributes.

Better to just make it an array of URI strings, and add functions for the edge cases. e.g. void enableGrammar(in DOMString uri, in boolean enabled); void setWeight(in DOMString grammarUri, in float weight);

And yeah, I remember arguing the opposite on the phone call. But that's before I tried writing sample code.

Glen: "The uri of a grammar associated with this reco. If unset, this defaults to the default builtin uri."

Presumably using the grammar attribute overwrites the default grammar, so if a developer wishes to add a grammar that supplements the default grammar, then this alternative should work: reco.request.addGrammar(url). A note to this effect would add clarity.

Michael: If you view source on the web api document you'll see the grammar functions and descriptions are there commented out as I anticipated, and agree, with this comment. We should have both functions and array/collections and this makes the things that Robert and Glen describe much easier/better.

New issue: What about no grammars?

Resolution 1: We should have a defined builtin:default, when people don't have any grammars defined the emantics are to use the builin:default grammars.

Resolution 2: We should bring back the functions addGrammarURL, addGrammarElement, addGrammarString complete with weights. Same with customparameter.

next