Grammalecte  Check-in [05735bba7b]

Overview
Comment:[core][fx][tb][js] use colors defined by the rules file (+bugs fixed)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | core | tb | fx
Files: files | file ages | folders
SHA3-256: 05735bba7bbaea292d870a3995cb06a425736364f7df7c1d3cb8db9999c4b0e3
User & Date: olr on 2018-09-25 16:06:16
Other Links: manifest | tags
Context
2018-09-25
16:19
[fr] màj couleurs check-in: 634ca30225 user: olr tags: trunk, fr
16:06
[core][fx][tb][js] use colors defined by the rules file (+bugs fixed) check-in: 05735bba7b user: olr tags: trunk, core, tb, fx
15:51
[core][py] gc engine: no color by default (type is not certain) check-in: cdb1937a91 user: olr tags: trunk, core
Changes

Modified gc_core/js/lang_core/gc_engine.js from [bbb0967ee1] to [e6dde271f2].

27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
    return aNew;
}


// data
let _sAppContext = "";                                  // what software is running
let _dOptions = null;

let _oSpellChecker = null;
let _oTokenizer = null;
let _aIgnoredRules = new Set();



var gc_engine = {

    //// Informations

    lang: "${lang}",
    locales: ${loc},
    pkg: "${implname}",
    name: "${name}",
    version: "${version}",
    author: "${author}",

    //// Initialization

    load: function (sContext="JavaScript", sPath="") {
        try {
            if (typeof(require) !== 'undefined') {
                var spellchecker = require("resource://grammalecte/graphspell/spellchecker.js");
                _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
            } else {
                _oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
            }
            _sAppContext = sContext;
            _dOptions = gc_options.getOptions(sContext).gl_shallowCopy();     // duplication necessary, to be able to reset to default

            _oTokenizer = _oSpellChecker.getTokenizer();
            _oSpellChecker.activateStorage();
        }
        catch (e) {
            console.error(e);
        }
    },







>



















|









>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    return aNew;
}


// data
let _sAppContext = "";                                  // what software is running
let _dOptions = null;
let _dOptionsColors = null;
let _oSpellChecker = null;
let _oTokenizer = null;
let _aIgnoredRules = new Set();



var gc_engine = {

    //// Informations

    lang: "${lang}",
    locales: ${loc},
    pkg: "${implname}",
    name: "${name}",
    version: "${version}",
    author: "${author}",

    //// Initialization

    load: function (sContext="JavaScript", sColorType="aRGB", sPath="") {
        try {
            if (typeof(require) !== 'undefined') {
                var spellchecker = require("resource://grammalecte/graphspell/spellchecker.js");
                _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
            } else {
                _oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
            }
            _sAppContext = sContext;
            _dOptions = gc_options.getOptions(sContext).gl_shallowCopy();     // duplication necessary, to be able to reset to default
            _dOptionsColors = gc_options.getOptionsColors(sContext, sColorType);
            _oTokenizer = _oSpellChecker.getTokenizer();
            _oSpellChecker.activateStorage();
        }
        catch (e) {
            console.error(e);
        }
    },
748
749
750
751
752
753
754

755
756
757
758
759
760
761
    _createError (nStart, nEnd, sLineId, sRuleId, sOption, sMessage, lSugg, sURL, bContext) {
        let oErr = {
            "nStart": nStart,
            "nEnd": nEnd,
            "sLineId": sLineId,
            "sRuleId": sRuleId,
            "sType": sOption || "notype",

            "sMessage": sMessage,
            "aSuggestions": lSugg,
            "URL": sURL
        }
        if (bContext) {
            oErr['sUnderlined'] = this.sText0.slice(nStart, nEnd);
            oErr['sBefore'] = this.sText0.slice(Math.max(0,nStart-80), nStart);







>







750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
    _createError (nStart, nEnd, sLineId, sRuleId, sOption, sMessage, lSugg, sURL, bContext) {
        let oErr = {
            "nStart": nStart,
            "nEnd": nEnd,
            "sLineId": sLineId,
            "sRuleId": sRuleId,
            "sType": sOption || "notype",
            "aColor": _dOptionsColors[sOption],
            "sMessage": sMessage,
            "aSuggestions": lSugg,
            "URL": sURL
        }
        if (bContext) {
            oErr['sUnderlined'] = this.sText0.slice(nStart, nEnd);
            oErr['sBefore'] = this.sText0.slice(Math.max(0,nStart-80), nStart);

Modified gc_core/js/lang_core/gc_options.js from [7c4c47e8f5] to [aa3f5d62cd].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
        if (this.dOpt.hasOwnProperty(sContext)) {
            return this.dOpt[sContext];
        }
        return this.dOpt["JavaScript"];
    },

    getOptionsColors: function (sTheme="Default", sColorType="aRGB") {
        let dOptColor = (this.dOptColor.hasOwnProperty()) ? this.dOptColor[sTheme] : this.dOptColor["Default"];
        let dColorType = (this.dColorType.hasOwnProperty(sColorType)) ? this.dColorType[sColorType] : this.dColorType["aRGB"];
        let dColor = {};
        try {
            for (let [sOpt, sColor] of Object.entries(this.dOptColor)) {
                dColor[sOpt] = dColorType[sColor];
            }
            console.log(dColor);
            return dColor;
        }
        catch (e) {
            console.error(e);
            return {}
        }
    },







|



|


<







10
11
12
13
14
15
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
        if (this.dOpt.hasOwnProperty(sContext)) {
            return this.dOpt[sContext];
        }
        return this.dOpt["JavaScript"];
    },

    getOptionsColors: function (sTheme="Default", sColorType="aRGB") {
        let dOptColor = (this.dOptColor.hasOwnProperty(sTheme)) ? this.dOptColor[sTheme] : this.dOptColor["Default"];
        let dColorType = (this.dColorType.hasOwnProperty(sColorType)) ? this.dColorType[sColorType] : this.dColorType["aRGB"];
        let dColor = {};
        try {
            for (let [sOpt, sColor] of Object.entries(dOptColor)) {
                dColor[sOpt] = dColorType[sColor];
            }

            return dColor;
        }
        catch (e) {
            console.error(e);
            return {}
        }
    },

Modified gc_lang/fr/tb/content/overlay.css from [8c73a24356] to [89e250c93b].

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
    cursor: pointer;
}
.debug_info {
    color: hsl(0, 50%, 50%);
    font-style: italic;
}


/* elems */
.spell {
    background-color: hsl(0, 50%, 50%);
    color: hsl(0, 0%, 96%);
    border-radius: 3px;
}

/* elems */
.typo, .esp, .nbsp, .eif, .maj, .virg, .tu, .num, .unit, .nf, .liga, .mapos, .chim {
    background-color: hsl(30, 70%, 50%);
    color: hsl(30, 10%, 96%);
    border-radius: 3px;
}

/* elems */
.apos {
    background-color: hsl(40, 90%, 50%);
    color: hsl(40, 10%, 96%);
    border-radius: 3px;
}

/* elems */
.gn, .sgpl {
    background-color: hsl(210, 50%, 50%);
    color: hsl(210, 10%, 96%);
    border-radius: 3px;
}

/* elems */
.conj, .infi, .imp, .inte, .ppas, .vmode  {
    background-color: hsl(300, 30%, 40%);
    color: hsl(300, 10%, 96%);
    border-radius: 3px;
}

/* elems */
.conf, .ocr {
    background-color: hsl(270, 40%, 30%);
    color: hsl(270, 10%, 96%);
    border-radius: 3px;
}

/* elems */
.bs, .pleo, .neg, .redon1, .redon2, .mc, .date, .notype {
    background-color: hsl(180, 50%, 40%);
    color: hsl(180, 10%, 96%);
    border-radius: 3px;
}


/*
    TB Next: fix dialogheaders
*/
dialogheader {
  -moz-binding: url("chrome://messenger/content/generalBindings.xml#dialogheader");
  margin: 0 5px 5px;







<
<






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







134
135
136
137
138
139
140


141
142
143
144
145
146










































147
148
149
150
151
152
153
    cursor: pointer;
}
.debug_info {
    color: hsl(0, 50%, 50%);
    font-style: italic;
}



.spell {
    background-color: hsl(0, 50%, 50%);
    color: hsl(0, 0%, 96%);
    border-radius: 3px;
}












































/*
    TB Next: fix dialogheaders
*/
dialogheader {
  -moz-binding: url("chrome://messenger/content/generalBindings.xml#dialogheader");
  margin: 0 5px 5px;

Modified gc_lang/fr/tb/content/overlay.js from [7e5b745ad7] to [df736903aa].

220
221
222
223
224
225
226
227
228

229
230
231
232
233
234
235
            for (let dErr of aGrammErr) {
                let nStart = dErr["nStart"];
                let nEnd = dErr["nEnd"];
                if (nStart >= nEndLastErr) {
                    xParagraphNode.appendChild(document.createTextNode(this._purgeTags(sParagraph.slice(nEndLastErr, nStart))));
                    let xNodeError = document.createElement("b");
                    if (dErr['sType'] !== 'WORD') {
                        xNodeError.setAttribute("class", "error " + dErr["sType"]);
                        xNodeError.textContent = oConverterToExponent.convert(nError.toString()) + sParagraph.slice(nStart, nEnd);

                        xParagraphNode.appendChild(xNodeError);
                        lNodeError.push(this._createNodeGCErrorDescription(xEditor, nError, dErr, iParagraph));
                    }
                    else {
                        xNodeError.setAttribute("class", "error spell");
                        xNodeError.textContent = oConverterToExponent.convert(nError.toString()) + sParagraph.slice(nStart, nEnd);
                        xParagraphNode.appendChild(xNodeError);







|

>







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
            for (let dErr of aGrammErr) {
                let nStart = dErr["nStart"];
                let nEnd = dErr["nEnd"];
                if (nStart >= nEndLastErr) {
                    xParagraphNode.appendChild(document.createTextNode(this._purgeTags(sParagraph.slice(nEndLastErr, nStart))));
                    let xNodeError = document.createElement("b");
                    if (dErr['sType'] !== 'WORD') {
                        xNodeError.setAttribute("class", "error");
                        xNodeError.textContent = oConverterToExponent.convert(nError.toString()) + sParagraph.slice(nStart, nEnd);
                        xNodeError.style.backgroundColor = dErr["aColor"];
                        xParagraphNode.appendChild(xNodeError);
                        lNodeError.push(this._createNodeGCErrorDescription(xEditor, nError, dErr, iParagraph));
                    }
                    else {
                        xNodeError.setAttribute("class", "error spell");
                        xNodeError.textContent = oConverterToExponent.convert(nError.toString()) + sParagraph.slice(nStart, nEnd);
                        xParagraphNode.appendChild(xNodeError);

Modified gc_lang/fr/tb/worker/gce_worker.js from [f3dbabaa73] to [086c0afb9f].

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
        try {
            gce = require("resource://grammalecte/fr/gc_engine.js");
            helpers = require("resource://grammalecte/graphspell/helpers.js");
            text = require("resource://grammalecte/text.js");
            tkz = require("resource://grammalecte/graphspell/tokenizer.js");
            //lxg = require("resource://grammalecte/fr/lexicographe.js");
            oTokenizer = new tkz.Tokenizer("fr");
            gce.load(sContext);
            oSpellChecker = gce.getSpellChecker();
            if (sGCOptions !== "") {
                gce.setOptions(helpers.objectToMap(JSON.parse(sGCOptions)));
            }
            // we always retrieve options from the gce, for setOptions filters obsolete options
            return gce.getOptions().gl_toString();
        }







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
        try {
            gce = require("resource://grammalecte/fr/gc_engine.js");
            helpers = require("resource://grammalecte/graphspell/helpers.js");
            text = require("resource://grammalecte/text.js");
            tkz = require("resource://grammalecte/graphspell/tokenizer.js");
            //lxg = require("resource://grammalecte/fr/lexicographe.js");
            oTokenizer = new tkz.Tokenizer("fr");
            gce.load(sContext, "sCSS");
            oSpellChecker = gce.getSpellChecker();
            if (sGCOptions !== "") {
                gce.setOptions(helpers.objectToMap(JSON.parse(sGCOptions)));
            }
            // we always retrieve options from the gce, for setOptions filters obsolete options
            return gce.getOptions().gl_toString();
        }

Modified gc_lang/fr/webext/content_scripts/panel_gc.css from [4ec3ab92b0] to [755062f1e5].

245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
    text-shadow: unset;
    text-align: left;
    hyphens: none;
}
mark.grammalecte_error_ignored {
    background-color: hsla(30, 20%, 80%, 1);
}


/* elems */
mark.grammalecte_error_WORD {
    /*border-bottom: 2px solid hsl(0, 10%, 30%);*/
    background-color: hsl(0, 50%, 50%);
    color: hsl(0, 0%, 96%);
    /*text-decoration: underline wavy hsl(0, 50%, 50%);*/
}
mark.grammalecte_error_WORD:hover {
    background-color: hsl(0, 60%, 40%);
    color: hsl(0, 0%, 100%);
    box-shadow: 0px 0px 0px 3px hsla(0, 50%, 50%, 0.2);
}

/* elems */
mark.grammalecte_error_typo,
mark.grammalecte_error_esp,
mark.grammalecte_error_nbsp,
mark.grammalecte_error_eif,
mark.grammalecte_error_maj,
mark.grammalecte_error_virg,
mark.grammalecte_error_tu,
mark.grammalecte_error_num,
mark.grammalecte_error_unit,
mark.grammalecte_error_nf,
mark.grammalecte_error_liga,
mark.grammalecte_error_mapos,
mark.grammalecte_error_chim {
    background-color: hsl(30, 70%, 50%);
    color: hsl(30, 10%, 96%);
    /*text-decoration: underline wavy hsl(30, 70%, 50%);*/
}

mark.grammalecte_error_typo:hover,
mark.grammalecte_error_esp:hover,
mark.grammalecte_error_nbsp:hover,
mark.grammalecte_error_eif:hover,
mark.grammalecte_error_maj:hover,
mark.grammalecte_error_virg:hover,
mark.grammalecte_error_tu:hover,
mark.grammalecte_error_num:hover,
mark.grammalecte_error_unit:hover,
mark.grammalecte_error_nf:hover,
mark.grammalecte_error_liga:hover,
mark.grammalecte_error_mapos:hover,
mark.grammalecte_error_chim:hover {
    background-color: hsl(30, 80%, 45%);
    color: hsl(30, 10%, 96%);
    box-shadow: 0px 0px 0px 3px hsla(30, 50%, 50%, 0.2);
}

/* elems */
mark.grammalecte_error_apos {
    background-color: hsl(40, 90%, 50%);
    color: hsl(40, 10%, 96%);
    /*text-decoration: underline wavy hsl(40, 70%, 45%);*/
}
mark.grammalecte_error_apos:hover {
    background-color: hsl(40, 100%, 45%);
    color: hsl(40, 10%, 96%);
    box-shadow: 0px 0px 0px 3px hsla(40, 50%, 50%, 0.2);
}

/* elems */
mark.grammalecte_error_gn,
mark.grammalecte_error_sgpl {
    background-color: hsl(210, 50%, 50%);
    color: hsl(210, 10%, 96%);
    /*text-decoration: underline wavy hsl(210, 50%, 50%);*/
}
mark.grammalecte_error_gn:hover,
mark.grammalecte_error_sgpl:hover {
    background-color: hsl(210, 60%, 40%);
    color: hsl(210, 10%, 96%);
    box-shadow: 0px 0px 0px 3px hsla(210, 50%, 50%, 0.2);
}

/* elems */
mark.grammalecte_error_conj,
mark.grammalecte_error_infi,
mark.grammalecte_error_imp,
mark.grammalecte_error_inte,
mark.grammalecte_error_ppas,
mark.grammalecte_error_vmode  {
    background-color: hsl(300, 30%, 40%);
    color: hsl(300, 10%, 96%);
    /*text-decoration: underline wavy hsl(300, 40%, 40%);*/
}

mark.grammalecte_error_conj:hover,
mark.grammalecte_error_infi:hover,
mark.grammalecte_error_imp:hover,
mark.grammalecte_error_inte:hover,
mark.grammalecte_error_ppas:hover,
mark.grammalecte_error_vmode:hover {
    background-color: hsl(300, 40%, 30%);
    color: hsl(300, 10%, 96%);
    box-shadow: 0px 0px 0px 3px hsla(300, 50%, 50%, 0.2);
}

/* elems */
mark.grammalecte_error_conf,
mark.grammalecte_error_ocr {
    background-color: hsl(270, 40%, 30%);
    color: hsl(270, 10%, 96%);
    /*text-decoration: underline wavy hsl(270, 40%, 30%);*/
}

mark.grammalecte_error_conf:hover,
mark.grammalecte_error_ocr:hover {
    background-color: hsl(270, 50%, 20%);
    color: hsl(270, 10%, 96%);
    box-shadow: 0px 0px 0px 3px hsla(270, 50%, 50%, 0.2);
}

/* elems */
mark.grammalecte_error_bs,
mark.grammalecte_error_pleo,
mark.grammalecte_error_neg,
mark.grammalecte_error_redon1,
mark.grammalecte_error_redon2,
mark.grammalecte_error_mc,
mark.grammalecte_error_date,
mark.grammalecte_error_notype {
    background-color: hsl(180, 50%, 40%);
    color: hsl(180, 10%, 96%);
    /*text-decoration: underline wavy hsl(180, 50%, 40%);*/
}

mark.grammalecte_error_bs:hover,
mark.grammalecte_error_pleo:hover,
mark.grammalecte_error_neg:hover,
mark.grammalecte_error_redon1:hover,
mark.grammalecte_error_redon2:hover,
mark.grammalecte_error_mc:hover,
mark.grammalecte_error_date:hover,
mark.grammalecte_error_notype:hover {
    background-color: hsl(180, 60%, 30%);
    color: hsl(180, 10%, 96%);
    box-shadow: 0px 0px 0px 3px hsla(180, 50%, 50%, 0.2);
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
245
246
247
248
249
250
251














































































































































    text-shadow: unset;
    text-align: left;
    hyphens: none;
}
mark.grammalecte_error_ignored {
    background-color: hsla(30, 20%, 80%, 1);
}














































































































































Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [1162a03a3e] to [271c87ea03].

184
185
186
187
188
189
190
191

192
193
194
195
196
197
198
            xNodeErr.dataset.gc_url = oErr['URL'];
            if (xNodeErr.dataset.gc_message.includes(" #")) {
                xNodeErr.dataset.line_id = oErr['sLineId'];
                xNodeErr.dataset.rule_id = oErr['sRuleId'];
            }
            xNodeErr.dataset.suggestions = oErr["aSuggestions"].join("|");
        }
        xNodeErr.className = (this.aIgnoredErrors.has(xNodeErr.dataset.ignored_key)) ? "grammalecte_error_ignored" : "grammalecte_error grammalecte_error_" + oErr['sType'];

        return xNodeErr;
    }

    blockParagraph (xParagraph) {
        xParagraph.contentEditable = "false";
        document.getElementById("grammalecte_check"+xParagraph.dataset.para_num).textContent = "Analyse…";
        document.getElementById("grammalecte_check"+xParagraph.dataset.para_num).style.backgroundColor = "hsl(0, 50%, 50%)";







|
>







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
            xNodeErr.dataset.gc_url = oErr['URL'];
            if (xNodeErr.dataset.gc_message.includes(" #")) {
                xNodeErr.dataset.line_id = oErr['sLineId'];
                xNodeErr.dataset.rule_id = oErr['sRuleId'];
            }
            xNodeErr.dataset.suggestions = oErr["aSuggestions"].join("|");
        }
        xNodeErr.className = (this.aIgnoredErrors.has(xNodeErr.dataset.ignored_key)) ? "grammalecte_error_ignored" : "grammalecte_error";
        xNodeErr.style.backgroundColor = (oErr['sType'] === "WORD") ? "hsl(0, 50%, 50%)" : oErr["aColor"];
        return xNodeErr;
    }

    blockParagraph (xParagraph) {
        xParagraph.contentEditable = "false";
        document.getElementById("grammalecte_check"+xParagraph.dataset.para_num).textContent = "Analyse…";
        document.getElementById("grammalecte_check"+xParagraph.dataset.para_num).style.backgroundColor = "hsl(0, 50%, 50%)";

Modified gc_lang/fr/webext/gce_worker.js from [49bb10d99d] to [f9f8b2256b].

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
    try {
        if (!bInitDone) {
            //console.log("[Worker] Loading… Extension path: " + sExtensionPath);
            conj.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/conj_data.json"));
            phonet.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/phonet_data.json"));
            mfsp.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/mfsp_data.json"));
            //console.log("[Worker] Modules have been initialized…");
            gc_engine.load(sContext, sExtensionPath+"grammalecte/graphspell/_dictionaries");
            oSpellChecker = gc_engine.getSpellChecker();
            oTest = new TestGrammarChecking(gc_engine, sExtensionPath+"/grammalecte/fr/tests_data.json");
            oTokenizer = new Tokenizer("fr");
            oLocution =  helpers.loadFile(sExtensionPath + "/grammalecte/fr/locutions_data.json");
            oLxg = new Lexicographe(oSpellChecker, oTokenizer, oLocution);
            if (dOptions !== null) {
                if (!(dOptions instanceof Map)) {







|







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
    try {
        if (!bInitDone) {
            //console.log("[Worker] Loading… Extension path: " + sExtensionPath);
            conj.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/conj_data.json"));
            phonet.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/phonet_data.json"));
            mfsp.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/mfsp_data.json"));
            //console.log("[Worker] Modules have been initialized…");
            gc_engine.load(sContext, "sCSS", sExtensionPath+"grammalecte/graphspell/_dictionaries");
            oSpellChecker = gc_engine.getSpellChecker();
            oTest = new TestGrammarChecking(gc_engine, sExtensionPath+"/grammalecte/fr/tests_data.json");
            oTokenizer = new Tokenizer("fr");
            oLocution =  helpers.loadFile(sExtensionPath + "/grammalecte/fr/locutions_data.json");
            oLxg = new Lexicographe(oSpellChecker, oTokenizer, oLocution);
            if (dOptions !== null) {
                if (!(dOptions instanceof Map)) {