define(['paperdialoghelper'], function (paperDialogHelper) {
var currentRecognition;
var lang = 'en-US';
var commandgroups;
function getCommandGroups() {
if (commandgroups) {
return Promise.resolve(commandgroups);
}
return new Promise(function (resolve, reject) {
var file = "grammar";
//if (language && language.length > 0)
// file = language;
var xhr = new XMLHttpRequest();
xhr.open('GET', "voice/grammar/" + file + ".json", true);
xhr.onload = function (e) {
commandgroups = JSON.parse(this.response);
resolve(commandgroups);
}
xhr.onerror = reject;
xhr.send();
});
}
///