1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
-
-
+
+
-
|
// Grammar checker engine
${string}
${regex}
${map}
if (typeof(require) !== 'undefined') {
var IBDAWG = require("resource://grammalecte/ibdawg.js").IBDAWG;
var helpers = require("resource://grammalecte/helpers.js");
var helpers = require("resource://grammalecte/helpers.js");
var echo = require("resource://grammalecte/helpers.js").echo;
var gc_options = require("resource://grammalecte/${lang}/gc_options.js");
var gc_rules = require("resource://grammalecte/${lang}/gc_rules.js");
var cregex = require("resource://grammalecte/${lang}/cregex.js");
var text = require("resource://grammalecte/text.js");
var echo = require("resource://grammalecte/helpers.js").echo;
}
function capitalizeArray (aArray) {
// can’t map on user defined function??
let aNew = [];
for (let i = 0; i < aArray.length; i = i + 1) {
|
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
+
+
+
+
-
+
+
|
return gc_rules.lParagraphRules;
},
//// Initialization
load: function (sContext="JavaScript") {
try {
if (typeof(require) !== 'undefined') {
var ibdawg = require("resource://grammalecte/ibdawg.js");
_oDict = new ibdawg.IBDAWG("${dic_name}.json");
} else {
_oDict = new IBDAWG("${dic_name}.json");
_oDict = new IBDAWG("${dic_name}.json");
}
_sAppContext = sContext;
_dOptions = gc_options.getOptions(sContext).gl_shallowCopy(); // duplication necessary, to be able to reset to default
}
catch (e) {
helpers.logerror(e);
}
},
|