speech-rule-engine
Version:
A standalone speech rule engine for XML structures, based on the original engine from ChromeVox.
21 lines • 878 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addStore = addStore;
exports.getStore = getStore;
const dynamic_cstr_js_1 = require("../rule_engine/dynamic_cstr.js");
const funcStore = new Map();
function addStore(constr, inherit, store) {
const values = {};
if (inherit) {
const inherits = funcStore.get(inherit) || {};
Object.assign(values, inherits);
}
funcStore.set(constr, Object.assign(values, store));
}
function getStore(locale, modality, domain) {
return (funcStore.get([locale, modality, domain].join('.')) ||
funcStore.get([dynamic_cstr_js_1.DynamicCstr.DEFAULT_VALUES[dynamic_cstr_js_1.Axis.LOCALE], modality, domain].join('.')) ||
funcStore.get([dynamic_cstr_js_1.DynamicCstr.BASE_LOCALE, modality, domain].join('.')) ||
{});
}
//# sourceMappingURL=speech_rules.js.map