Hello Adam,
I agree that the feature you are suggesting is useful. In fact I think the VBWG was considering something like this at one time.
My concern is centers on specification and implementation. Most recognizers will be remote (even if the API is local), and thus they would need to somehow serialize the local ECMA state and send as part of the recognition. That sounds difficult.
Interested in hearing other opinions.
From: Adam Sobieski [mailto:adamsobieski@hotmail.com]
Sent: Tuesday, April 24, 2012 9:01 AM
To: public-speech-api@w3.org
Cc: public-speech-api-contrib@w3.org; www-voice@w3.org
Subject: Semantic Interpretation for Speech Recognition and JavaScript in Web Browsers
Speech API Community Group,
With regard to SISR scoping and visibility rules for script tag syntax grammars (http://www.w3.org/TR/semantic-interpretation/#SI6.3), it occurs that, for grammars loaded into web browsers, SISR could utilize web browser JavaScript functionalities and JavaScript libraries loaded in web browsers.
The important scenario of using semantic interpretation to generate XML-based results (http://www.w3.org/TR/semantic-interpretation/#SI7) could then make use of the document object model (http://www.w3.org/DOM/, http://www.w3.org/TR/dom/), for example, or make use of any JavaScript libraries loaded in the web browser.
Where the functionality described expands upon that of "semantics/1.0", a new tag-format value, e.g. "semantics/1.0-web", could describe the new functionality possible with SISR in web browsers. In web browsers, each grammar's global scope (http://www.w3.org/TR/semantic-interpretation/#SI4.2) could be a subscope of the scope that a grammar is loaded into or of the browser's global scope.
Kind regards,
Adam