rosaenlg-commons
Version:
Common technical elements for RosaeNLG
35 lines • 1.14 kB
JavaScript
;
/**
* @license
* Copyright 2019 Ludan Stoecklé
* SPDX-License-Identifier: Apache-2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.LanguageCommon = void 0;
const Constants_1 = require("./Constants");
const DictManager_1 = require("./DictManager");
class LanguageCommon {
constructor() {
this.iso2 = null;
this.validPropsWord = null; // MUST override
this.validPropsAdj = null; // MUST override
this.allPunctList = Constants_1.Constants.stdPunctList; // override e.g. for Spanish ¡¿
this.constants = null;
this.dictManager = null;
}
init() {
this.dictManager = new DictManager_1.DictManager(this.iso2, this.validPropsWord, this.validPropsAdj);
this.constants = new Constants_1.Constants(this.allPunctList);
}
setIso2(_iso2) {
const err = new Error();
err.name = 'InvalidArgumentException';
err.message = `cannot set iso2`;
throw err;
}
getIso2() {
return this.iso2;
}
}
exports.LanguageCommon = LanguageCommon;
//# sourceMappingURL=LanguageCommon.js.map