9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
var mfsp = {
// list of affix codes
_lTagMiscPlur: [],
_lTagMasForm: [],
// dictionary of words with uncommon plurals (-x, -ux, english, latin and italian plurals) and tags to generate them
_dMiscPlur: {},
// dictionary of feminine forms and tags to generate masculine forms (singular and plural)
_dMasForm: {},
init: function (sJSONData) {
try {
let _oData = JSON.parse(sJSONData);
this._lTagMiscPlur = _oData.lTagMiscPlur;
this._lTagMasForm = _oData.lTagMasForm;
this._dMiscPlur = helpers.objectToMap(_oData.dMiscPlur);
|
|
|
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
var mfsp = {
// list of affix codes
_lTagMiscPlur: [],
_lTagMasForm: [],
// dictionary of words with uncommon plurals (-x, -ux, english, latin and italian plurals) and tags to generate them
_dMiscPlur: new Map(),
// dictionary of feminine forms and tags to generate masculine forms (singular and plural)
_dMasForm: new Map(),
init: function (sJSONData) {
try {
let _oData = JSON.parse(sJSONData);
this._lTagMiscPlur = _oData.lTagMiscPlur;
this._lTagMasForm = _oData.lTagMasForm;
this._dMiscPlur = helpers.objectToMap(_oData.dMiscPlur);
|
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
if (typeof(browser) !== 'undefined') {
// WebExtension
mfsp.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/mfsp_data.json")));
} else if (typeof(require) !== 'undefined') {
// Add-on SDK and Thunderbird
mfsp.init(helpers.loadFile("resource://grammalecte/fr/mfsp_data.json"));
} else {
console.log("Error: Impossible d’initialiser le module mfsp");
}
if (typeof(exports) !== 'undefined') {
exports._lTagMiscPlur = mfsp._lTagMiscPlur;
exports._lTagMasForm = mfsp._lTagMasForm;
exports._dMiscPlur = mfsp._dMiscPlur;
|
|
|
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
if (typeof(browser) !== 'undefined') {
// WebExtension
mfsp.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/mfsp_data.json")));
} else if (typeof(require) !== 'undefined') {
// Add-on SDK and Thunderbird
mfsp.init(helpers.loadFile("resource://grammalecte/fr/mfsp_data.json"));
} else {
console.log("Module mfsp non initialisé");
}
if (typeof(exports) !== 'undefined') {
exports._lTagMiscPlur = mfsp._lTagMiscPlur;
exports._lTagMasForm = mfsp._lTagMasForm;
exports._dMiscPlur = mfsp._dMiscPlur;
|