34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
}
// data
let _sAppContext = ""; // what software is running
let _dOptions = null;
let _aIgnoredRules = new Set();
let _oDict = null;
let _oSpellChecker = null;
let _dAnalyses = new Map(); // cache for data from dictionary
var gc_engine = {
//// Informations
|
<
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
}
// data
let _sAppContext = ""; // what software is running
let _dOptions = null;
let _aIgnoredRules = new Set();
let _oSpellChecker = null;
let _dAnalyses = new Map(); // cache for data from dictionary
var gc_engine = {
//// Informations
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
},
//// Initialization
load: function (sContext="JavaScript", sPath="") {
try {
if (typeof(require) !== 'undefined') {
//var ibdawg = require("resource://grammalecte/graphspell/ibdawg.js");
//_oDict = new ibdawg.IBDAWG("${dic_filename}.json");
console.log("<resource:>");
var spellchecker = require("resource://grammalecte/graphspell/spellchecker.js");
_oSpellChecker = new spellchecker.Spellchecker("${lang}", "${dic_filename}.json");
} else {
//_oDict = new IBDAWG("${dic_filename}.json", sPath);
console.log("no <resource:>");
_oSpellChecker = new Spellchecker("${lang}", "${dic_filename}.json", sPath);
}
_sAppContext = sContext;
_dOptions = gc_options.getOptions(sContext).gl_shallowCopy(); // duplication necessary, to be able to reset to default
}
catch (e) {
helpers.logerror(e);
}
|
<
<
<
|
<
<
|
|
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
},
//// 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_filename}.json");
} else {
_oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_filename}.json");
}
_sAppContext = sContext;
_dOptions = gc_options.getOptions(sContext).gl_shallowCopy(); // duplication necessary, to be able to reset to default
}
catch (e) {
helpers.logerror(e);
}
|