13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
_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);
this._dMasForm = helpers.objectToMap(_oData.dMasForm);
}
catch (e) {
console.error(e);
}
},
isFemForm: function (sWord) {
|
>
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
_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(),
isInit: false,
init: function (sJSONData) {
try {
let _oData = JSON.parse(sJSONData);
this._lTagMiscPlur = _oData.lTagMiscPlur;
this._lTagMasForm = _oData.lTagMasForm;
this._dMiscPlur = helpers.objectToMap(_oData.dMiscPlur);
this._dMasForm = helpers.objectToMap(_oData.dMasForm);
this.isInit = true;
}
catch (e) {
console.error(e);
}
},
isFemForm: function (sWord) {
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
return "## erreur, code : " + sSfx + " ##";
}
}
};
// Initialization
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;
|
|
|
>
>
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
return "## erreur, code : " + sSfx + " ##";
}
}
};
// Initialization
if (!mfsp.isInit && typeof(browser) !== 'undefined') {
// WebExtension
mfsp.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/mfsp_data.json")));
} else if (!mfsp.isInit && typeof(require) !== 'undefined') {
// Add-on SDK and Thunderbird
mfsp.init(helpers.loadFile("resource://grammalecte/fr/mfsp_data.json"));
} else if (mfsp.isInit){
console.log("Module mfsp déjà initialisé");
} else {
console.log("Module mfsp non initialisé");
}
if (typeof(exports) !== 'undefined') {
exports._lTagMiscPlur = mfsp._lTagMiscPlur;
|