Grammalecte  Check-in [9ae8f0a042]

Overview
Comment:[js] Revert syntax change
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | njs | nodejs
Files: files | file ages | folders
SHA3-256: 9ae8f0a0427ade93bac7190838d32e50b70f4b5ef720c882b71f62e25b0c7eef
User & Date: IllusionPerdu on 2018-10-11 15:13:57
Other Links: branch diff | manifest | tags
Context
2018-10-11
15:39
[js] Revert syntax change (oubli) check-in: 977fd9b488 user: IllusionPerdu tags: njs, nodejs
15:13
[js] Revert syntax change check-in: 9ae8f0a042 user: IllusionPerdu tags: njs, nodejs
2018-10-10
12:23
[js] Minimal file to use in node check-in: a43e8d10eb user: IllusionPerdu tags: njs, nodejs
Changes

Modified gc_core/js/exemple-node.js from [393f0a3208] to [e34f3521aa].

Modified gc_core/js/lang_core/gc_options.js from [a80ff5a6ee] to [ece26d7264].

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

    dOptColor: ${dOptColor},

    dOptLabel: ${dOptLabel}
};


if (typeof exports !== 'undefined') {
	exports.getOptions = gc_options.getOptions;
	exports.getOptionsColors = gc_options.getOptionsColors;
	exports.lStructOpt = gc_options.lStructOpt;
	exports.dOpt = gc_options.dOpt;
	exports.dColorType = gc_options.dColorType;
	exports.dOptColor = gc_options.dOptColor;
	exports.dOptLabel = gc_options.dOptLabel;
}







|
|
|
|
|
|
|
|

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

    dOptColor: ${dOptColor},

    dOptLabel: ${dOptLabel}
};


if (typeof(exports) !== 'undefined') {
    exports.getOptions = gc_options.getOptions;
    exports.getOptionsColors = gc_options.getOptionsColors;
    exports.lStructOpt = gc_options.lStructOpt;
    exports.dOpt = gc_options.dOpt;
    exports.dColorType = gc_options.dColorType;
    exports.dOptColor = gc_options.dOptColor;
    exports.dOptLabel = gc_options.dOptLabel;
}

Modified gc_core/js/lang_core/gc_rules.js from [c719e5aff6] to [4a0b977685].

12
13
14
15
16
17
18
19
20
21
22
var gc_rules = {
    lParagraphRules: ${paragraph_rules_JS},

    lSentenceRules: ${sentence_rules_JS}
};


if (typeof exports !== 'undefined') {
    exports.lParagraphRules = gc_rules.lParagraphRules;
    exports.lSentenceRules = gc_rules.lSentenceRules;
}







|



12
13
14
15
16
17
18
19
20
21
22
var gc_rules = {
    lParagraphRules: ${paragraph_rules_JS},

    lSentenceRules: ${sentence_rules_JS}
};


if (typeof(exports) !== 'undefined') {
    exports.lParagraphRules = gc_rules.lParagraphRules;
    exports.lSentenceRules = gc_rules.lSentenceRules;
}

Modified gc_core/js/lang_core/gc_rules_graph.js from [41e4864e6c] to [6e7c6b0d6d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Grammar checker graph rules

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/*global exports*/

"use strict";

//${string}


var gc_rules_graph = {
    dAllGraph: ${rules_graphsJS},

    dRule: ${rules_actionsJS}
};


if (typeof exports !== 'undefined') {
    exports.dAllGraph = gc_rules_graph.dAllGraph;
    exports.dRule = gc_rules_graph.dRule;
}








|









|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Grammar checker graph rules

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/*global exports*/

"use strict";

${string}


var gc_rules_graph = {
    dAllGraph: ${rules_graphsJS},

    dRule: ${rules_actionsJS}
};


if (typeof(exports) !== 'undefined') {
    exports.dAllGraph = gc_rules_graph.dAllGraph;
    exports.dRule = gc_rules_graph.dRule;
}

Modified gc_lang/fr/modules-js/conj.js from [9586582de9] to [112ea76b9d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Grammalecte - Conjugueur
// License: GPL 3

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/*global require, exports, console, self, browser, chrome, __dirname */

"use strict";

//${map}


if(typeof process !== 'undefined') {
    var helpers = require('../graphspell/helpers.js');
} else if (typeof require !== 'undefined') {
    var helpers = require('resource://grammalecte/graphspell/helpers.js');
}

var conj = {
    _lVtyp: [],
    _lTags: [],
    _dPatternConj: {},
    _dVerb: {},









|


|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Grammalecte - Conjugueur
// License: GPL 3

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/*global require, exports, console, self, browser, chrome, __dirname */

"use strict";

${map}


if(typeof(process) !== 'undefined') {
    var helpers = require("../graphspell/helpers.js");
} else if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/graphspell/helpers.js");
}

var conj = {
    _lVtyp: [],
    _lTags: [],
    _dPatternConj: {},
    _dVerb: {},
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
        }
        return (this.dConj.get(":Q").get(":Q4")) ? this.dConj.get(":Q").get(":Q4") : this.dConj.get(":Q").get(":Q1");
    }
}


// Initialization
if(!conj.bInit && typeof process !== 'undefined') {
    // Work with nodejs
    conj.init(helpers.loadFile(__dirname+'/conj_data.json'));
} else if (!conj.bInit && typeof(browser) !== 'undefined') {
    // WebExtension Standard (but not in Worker)
    conj.init(helpers.loadFile(browser.extension.getURL('grammalecte/fr/conj_data.json')));
} else if (!conj.bInit && typeof chrome !== 'undefined') {
    // WebExtension Chrome (but not in Worker)
    conj.init(helpers.loadFile(chrome.extension.getURL('grammalecte/fr/conj_data.json')));
} else if (!conj.bInit && typeof require !== 'undefined') {
    // Add-on SDK and Thunderbird
    conj.init(helpers.loadFile('resource://grammalecte/fr/conj_data.json'));
} else if (!conj.bInit && typeof self !== 'undefined' && typeof self.port !== 'undefined' && typeof self.port.on !== 'undefined') {
    // used within Firefox content script (conjugation panel).
    // can’t load JSON from here, so we do it in ui.js and send it here.
    self.port.on('provideConjData', function (sJSONData) {
        conj.init(sJSONData);
    });
} else if (conj.bInit){
    console.log('Module conj déjà initialisé');
} else {
    //console.log("Module conj non initialisé");
}


if (typeof exports !== 'undefined') {
    exports._lVtyp = conj._lVtyp;
    exports._lTags = conj._lTags;
    exports._dPatternConj = conj._dPatternConj;
    exports._dVerb = conj._dVerb;
    exports.init = conj.init;
    exports._zStartVoy = conj._zStartVoy;
    exports._zNeedTeuph = conj._zNeedTeuph;







|

|


|
|

|
|

|
|












|







496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
        }
        return (this.dConj.get(":Q").get(":Q4")) ? this.dConj.get(":Q").get(":Q4") : this.dConj.get(":Q").get(":Q1");
    }
}


// Initialization
if(!conj.bInit && typeof(process) !== 'undefined') {
    // Work with nodejs
    conj.init(helpers.loadFile(__dirname+"/conj_data.json"));
} else if (!conj.bInit && typeof(browser) !== 'undefined') {
    // WebExtension Standard (but not in Worker)
    conj.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/conj_data.json")));
} else if (!conj.bInit && typeof(chrome) !== 'undefined') {
    // WebExtension Chrome (but not in Worker)
    conj.init(helpers.loadFile(chrome.extension.getURL("grammalecte/fr/conj_data.json")));
} else if (!conj.bInit && typeof(require) !== 'undefined') {
    // Add-on SDK and Thunderbird
    conj.init(helpers.loadFile("resource://grammalecte/fr/conj_data.json"));
} else if (!conj.bInit && typeof(self) !== 'undefined' && typeof(self.port) !== 'undefined' && typeof(self.port.on) !== 'undefined') {
    // used within Firefox content script (conjugation panel).
    // can’t load JSON from here, so we do it in ui.js and send it here.
    self.port.on('provideConjData', function (sJSONData) {
        conj.init(sJSONData);
    });
} else if (conj.bInit){
    console.log('Module conj déjà initialisé');
} else {
    //console.log("Module conj non initialisé");
}


if (typeof(exports) !== 'undefined') {
    exports._lVtyp = conj._lVtyp;
    exports._lTags = conj._lTags;
    exports._dPatternConj = conj._dPatternConj;
    exports._dVerb = conj._dVerb;
    exports.init = conj.init;
    exports._zStartVoy = conj._zStartVoy;
    exports._zNeedTeuph = conj._zNeedTeuph;

Modified gc_lang/fr/modules-js/cregex.js from [9727baa3eb] to [53af2cbc4f].

265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
            return false;
        }
        return lMorph.some(s  =>  this._zNPm.test(s));
    }
};


if (typeof exports !== 'undefined') {
    exports._zLemma = cregex._zLemma;
    exports._zGender = cregex._zGender;
    exports._zNumber = cregex._zNumber;
    exports._zNA = cregex._zNA;
    exports._zNAs = cregex._zNAs;
    exports._zNAp = cregex._zNAp;
    exports._zNAi = cregex._zNAi;







|







265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
            return false;
        }
        return lMorph.some(s  =>  this._zNPm.test(s));
    }
};


if (typeof(exports) !== 'undefined') {
    exports._zLemma = cregex._zLemma;
    exports._zGender = cregex._zGender;
    exports._zNumber = cregex._zNumber;
    exports._zNA = cregex._zNA;
    exports._zNAs = cregex._zNAs;
    exports._zNAp = cregex._zNAp;
    exports._zNAi = cregex._zNAi;

Modified gc_lang/fr/modules-js/gce_suggestions.js from [b2f66a0847] to [6c462561b6].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// GRAMMAR CHECKING ENGINE PLUGIN: Suggestion mechanisms

/* jshint esversion:6 */
/* jslint esversion:6 */
/* global require */

if(typeof process !== 'undefined') {
    var conj = require('./conj.js');
    var mfsp = require('./mfsp.js');
    var phonet = require('./phonet.js');
} else if (typeof require !== 'undefined') {
    var conj = require('resource://grammalecte/fr/conj.js');
    var mfsp = require('resource://grammalecte/fr/mfsp.js');
    var phonet = require('resource://grammalecte/fr/phonet.js');
}


//// verbs

function splitVerb (sVerb) {
    // renvoie le verbe et les pronoms séparément






|
|
|
|
|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// GRAMMAR CHECKING ENGINE PLUGIN: Suggestion mechanisms

/* jshint esversion:6 */
/* jslint esversion:6 */
/* global require */

if(typeof(process) !== 'undefined') {
    var conj = require("./conj.js");
    var mfsp = require("./mfsp.js");
    var phonet = require("./phonet.js");
} else if (typeof(require) !== 'undefined') {
    var conj = require("resource://grammalecte/fr/conj.js");
    var mfsp = require("resource://grammalecte/fr/mfsp.js");
    var phonet = require("resource://grammalecte/fr/phonet.js");
}


//// verbs

function splitVerb (sVerb) {
    // renvoie le verbe et les pronoms séparément

Modified gc_lang/fr/modules-js/mfsp.js from [d93c273b71] to [832f7c5e6f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Grammalecte

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, browser,__dirname */

"use strict";


if(typeof process !== 'undefined') {
    var helpers = require('../graphspell/helpers.js');
} else if (typeof require !== 'undefined') {
    var helpers = require('resource://grammalecte/graphspell/helpers.js');
}


var mfsp = {
    // list of affix codes
    _lTagMiscPlur: [],
    _lTagMasForm: [],









|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Grammalecte

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, browser,__dirname */

"use strict";


if(typeof(process) !== 'undefined') {
    var helpers = require("../graphspell/helpers.js");
} else if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/graphspell/helpers.js");
}


var mfsp = {
    // list of affix codes
    _lTagMiscPlur: [],
    _lTagMasForm: [],
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
            return "## erreur, code : " + sSfx + " ##";
        }
    }
};


// Initialization
if(!mfsp.bInit && typeof process !== 'undefined') {
    //Nodejs
    mfsp.init(helpers.loadFile(__dirname+'/mfsp_data.json'));
} else if (!mfsp.bInit && typeof(browser) !== 'undefined') {
    // WebExtension
    mfsp.init(helpers.loadFile(browser.extension.getURL('grammalecte/fr/mfsp_data.json')));
} else if (!mfsp.bInit && typeof(require) !== 'undefined') {
    // Add-on SDK and Thunderbird
    mfsp.init(helpers.loadFile('resource://grammalecte/fr/mfsp_data.json'));
} else if (mfsp.bInit){
    console.log('Module mfsp déjà initialisé');
} else {
    //console.log('Module mfsp non initialisé');
}


if (typeof exports !== 'undefined') {
    exports._lTagMiscPlur = mfsp._lTagMiscPlur;
    exports._lTagMasForm = mfsp._lTagMasForm;
    exports._dMiscPlur = mfsp._dMiscPlur;
    exports._dMasForm = mfsp._dMasForm;
    exports.init = mfsp.init;
    exports.isFemForm = mfsp.isFemForm;
    exports.getMasForm = mfsp.getMasForm;
    exports.hasMiscPlural = mfsp.hasMiscPlural;
    exports.getMiscPlural = mfsp.getMiscPlural;
    exports._whatSuffixCode = mfsp._whatSuffixCode;
    exports._modifyStringWithSuffixCode = mfsp._modifyStringWithSuffixCode;
}







|















|












104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
            return "## erreur, code : " + sSfx + " ##";
        }
    }
};


// Initialization
if(!mfsp.bInit && typeof(process) !== 'undefined') {
    //Nodejs
    mfsp.init(helpers.loadFile(__dirname+'/mfsp_data.json'));
} else if (!mfsp.bInit && typeof(browser) !== 'undefined') {
    // WebExtension
    mfsp.init(helpers.loadFile(browser.extension.getURL('grammalecte/fr/mfsp_data.json')));
} else if (!mfsp.bInit && typeof(require) !== 'undefined') {
    // Add-on SDK and Thunderbird
    mfsp.init(helpers.loadFile('resource://grammalecte/fr/mfsp_data.json'));
} else if (mfsp.bInit){
    console.log('Module mfsp déjà initialisé');
} else {
    //console.log('Module mfsp non initialisé');
}


if (typeof(exports) !== 'undefined') {
    exports._lTagMiscPlur = mfsp._lTagMiscPlur;
    exports._lTagMasForm = mfsp._lTagMasForm;
    exports._dMiscPlur = mfsp._dMiscPlur;
    exports._dMasForm = mfsp._dMasForm;
    exports.init = mfsp.init;
    exports.isFemForm = mfsp.isFemForm;
    exports.getMasForm = mfsp.getMasForm;
    exports.hasMiscPlural = mfsp.hasMiscPlural;
    exports.getMiscPlural = mfsp.getMiscPlural;
    exports._whatSuffixCode = mfsp._whatSuffixCode;
    exports._modifyStringWithSuffixCode = mfsp._modifyStringWithSuffixCode;
}

Modified gc_lang/fr/modules-js/phonet.js from [fb94b7fe43] to [58acb58e4e].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Grammalecte - Suggestion phonétique

/* jshint esversion:6 */
/* jslint esversion:6 */
/* global __dirname */

if(typeof process !== 'undefined') {
    var helpers = require("../graphspell/helpers.js");
} else if (typeof require  !== 'undefined') {
    var helpers = require("resource://grammalecte/graphspell/helpers.js");
}


var phonet = {
    _dWord: new Map(),
    _lSet: [],






|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Grammalecte - Suggestion phonétique

/* jshint esversion:6 */
/* jslint esversion:6 */
/* global __dirname */

if(typeof(process) !== 'undefined') {
    var helpers = require("../graphspell/helpers.js");
} else if (typeof(require)  !== 'undefined') {
    var helpers = require("resource://grammalecte/graphspell/helpers.js");
}


var phonet = {
    _dWord: new Map(),
    _lSet: [],
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
        }
        return aSelect;
    }
};


// Initialization
if (!phonet.bInit && typeof process !== 'undefined') {
    //Nodejs
    phonet.init(helpers.loadFile(__dirname+'/phonet_data.json'));
} else if (!phonet.bInit && typeof browser !== 'undefined') {
    // WebExtension
    phonet.init(helpers.loadFile(browser.extension.getURL('grammalecte/fr/phonet_data.json')));
} else if (!phonet.bInit && typeof require !== 'undefined') {
    // Add-on SDK and Thunderbird
    phonet.init(helpers.loadFile('resource://grammalecte/fr/phonet_data.json'));
} else if (phonet.bInit){
    console.log('Module phonet déjà initialisé');
} else {
    //console.log('Module phonet non initialisé');
}


if (typeof exports !== 'undefined') {
    exports._dWord = phonet._dWord;
    exports._lSet = phonet._lSet;
    exports._dMorph = phonet._dMorph;
    exports.init = phonet.init;
    exports.hasSimil = phonet.hasSimil;
    exports.getSimil = phonet.getSimil;
    exports.selectSimil = phonet.selectSimil;
}







|

|
|

|
|

|

|





|








85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
        }
        return aSelect;
    }
};


// Initialization
if (!phonet.bInit && typeof(process) !== 'undefined') {
    //Nodejs
    phonet.init(helpers.loadFile(__dirname+"/phonet_data.json"));
} else if (!phonet.bInit && typeof(browser) !== 'undefined') {
    // WebExtension
    phonet.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/phonet_data.json")));
} else if (!phonet.bInit && typeof(require) !== 'undefined') {
    // Add-on SDK and Thunderbird
    phonet.init(helpers.loadFile("resource://grammalecte/fr/phonet_data.json"));
} else if (phonet.bInit){
    console.log("Module phonet déjà initialisé");
} else {
    //console.log('Module phonet non initialisé');
}


if (typeof(exports) !== 'undefined') {
    exports._dWord = phonet._dWord;
    exports._lSet = phonet._lSet;
    exports._dMorph = phonet._dMorph;
    exports.init = phonet.init;
    exports.hasSimil = phonet.hasSimil;
    exports.getSimil = phonet.getSimil;
    exports.selectSimil = phonet.selectSimil;
}

Modified gc_lang/fr/modules-js/textformatter.js from [526f0b2382] to [c9c7a0f69c].

285
286
287
288
289
290
291
292
293
294
295

    getDefaultOptions () {
        return dTFDefaultOptions;
    }
}


if (typeof exports !== 'undefined') {
    exports.TextFormatter = TextFormatter;
    exports.oReplTable = oReplTable;
}







|



285
286
287
288
289
290
291
292
293
294
295

    getDefaultOptions () {
        return dTFDefaultOptions;
    }
}


if (typeof(exports) !== "undefined") {
    exports.TextFormatter = TextFormatter;
    exports.oReplTable = oReplTable;
}

Modified graphspell-js/char_player.js from [27827e9132] to [98e99c3ff4].

384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
    filterSugg: function (aSugg) {
        return aSugg.filter((sSugg) => { return !sSugg.endsWith("è") && !sSugg.endsWith("È"); });
    }

};


if (typeof exports !== 'undefined') {
    exports._xTransCharsForSpelling = char_player._xTransCharsForSpelling;
    exports.spellingNormalization = char_player.spellingNormalization;
    exports._xTransCharsForSimplification = char_player._xTransCharsForSimplification;
    exports.simplifyWord = char_player.simplifyWord;
    exports.aVowel = char_player.aVowel;
    exports.aConsonant = char_player.aConsonant;
    exports.aDouble = char_player.aDouble;







|







384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
    filterSugg: function (aSugg) {
        return aSugg.filter((sSugg) => { return !sSugg.endsWith("è") && !sSugg.endsWith("È"); });
    }

};


if (typeof(exports) !== 'undefined') {
    exports._xTransCharsForSpelling = char_player._xTransCharsForSpelling;
    exports.spellingNormalization = char_player.spellingNormalization;
    exports._xTransCharsForSimplification = char_player._xTransCharsForSimplification;
    exports.simplifyWord = char_player.simplifyWord;
    exports.aVowel = char_player.aVowel;
    exports.aConsonant = char_player.aConsonant;
    exports.aDouble = char_player.aDouble;

Modified graphspell-js/dawg.js from [56edbc7aa3] to [f36dfe75af].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, helpers */

"use strict";

if(typeof process !== 'undefined') {
    var str_transform = require('./str_transform.js');
} else if (typeof require !== 'undefined') {
    var str_transform = require('resource://grammalecte/graphspell/str_transform.js');
}

${map}


class DAWG {
    /*  DIRECT ACYCLIC WORD GRAPH







|
|
|
|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, helpers */

"use strict";

if(typeof(process) !== 'undefined') {
    var str_transform = require("./str_transform.js");
} else if (typeof(require) !== 'undefined') {
    var str_transform = require("resource://grammalecte/graphspell/str_transform.js");
}

${map}


class DAWG {
    /*  DIRECT ACYCLIC WORD GRAPH

Modified graphspell-js/helpers.js from [2ed0ee7e88] to [8e7a91003c].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    },

    loadFile: function (spf) {
        // load ressources in workers (suggested by Mozilla extensions reviewers)
        // for more options have a look here: https://gist.github.com/Noitidart/ec1e6b9a593ec7e3efed
        // if not in workers, use sdk/data.load() instead
        try {
            if(typeof process !== 'undefined' && typeof require !== 'undefined') {
                //console.log('loadFile(disque): ' + spf);
                let fs = require('fs');
                return fs.readFileSync(spf, 'utf8');
            } else {
                //console.log('loadFile: ' + spf);
                let xRequest;
                xRequest = new XMLHttpRequest();
                xRequest.open('GET', spf, false); // 3rd arg is false for synchronous, sync is acceptable in workers
                xRequest.overrideMimeType('text/json');
                xRequest.send();







|

|
|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    },

    loadFile: function (spf) {
        // load ressources in workers (suggested by Mozilla extensions reviewers)
        // for more options have a look here: https://gist.github.com/Noitidart/ec1e6b9a593ec7e3efed
        // if not in workers, use sdk/data.load() instead
        try {
            if(typeof(process) !== 'undefined') {
                //console.log('loadFile(disque): ' + spf);
                let fs = require("fs");
                return fs.readFileSync(spf, "utf8");
            } else {
                //console.log('loadFile: ' + spf);
                let xRequest;
                xRequest = new XMLHttpRequest();
                xRequest.open('GET', spf, false); // 3rd arg is false for synchronous, sync is acceptable in workers
                xRequest.overrideMimeType('text/json');
                xRequest.send();
64
65
66
67
68
69
70
71
72
73
74
75
76
            obj[k] = v;
        }
        return obj;
    }
};


if (typeof exports !== 'undefined') {
    exports.inspect = helpers.inspect;
    exports.loadFile = helpers.loadFile;
    exports.objectToMap = helpers.objectToMap;
    exports.mapToObject = helpers.mapToObject;
}







|





64
65
66
67
68
69
70
71
72
73
74
75
76
            obj[k] = v;
        }
        return obj;
    }
};


if (typeof(exports) !== 'undefined') {
    exports.inspect = helpers.inspect;
    exports.loadFile = helpers.loadFile;
    exports.objectToMap = helpers.objectToMap;
    exports.mapToObject = helpers.mapToObject;
}

Modified graphspell-js/ibdawg.js from [3da9a9daaf] to [c0fccb61bf].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// IBDAWG

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, __dirname */

"use strict";

if(typeof process !== 'undefined') {
    var str_transform = require('./str_transform.js');
    var helpers = require('./helpers.js');
    var char_player = require('./char_player.js');
} else if (typeof require !== 'undefined') {
    var str_transform = require('resource://grammalecte/graphspell/str_transform.js');
    var helpers = require('resource://grammalecte/graphspell/helpers.js');
    var char_player = require('resource://grammalecte/graphspell/char_player.js');
}

// Don’t remove <string>. Necessary in TB.
${string}
${map}
${set}









|
|
|
|
|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// IBDAWG

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, __dirname */

"use strict";

if(typeof(process) !== 'undefined') {
    var str_transform = require("./str_transform.js");
    var helpers = require("./helpers.js");
    var char_player = require("./char_player.js");
} else if (typeof(require) !== 'undefined') {
    var str_transform = require("resource://grammalecte/graphspell/str_transform.js");
    var helpers = require("resource://grammalecte/graphspell/helpers.js");
    var char_player = require("resource://grammalecte/graphspell/char_player.js");
}

// Don’t remove <string>. Necessary in TB.
${string}
${map}
${set}

636
637
638
639
640
641
642
643
644
645

    _lookupArcNode3 (nVal, iAddr) {
        // to do
    }
}


if (typeof exports !== 'undefined') {
    exports.IBDAWG = IBDAWG;
}







|


636
637
638
639
640
641
642
643
644
645

    _lookupArcNode3 (nVal, iAddr) {
        // to do
    }
}


if (typeof(exports) !== 'undefined') {
    exports.IBDAWG = IBDAWG;
}

Modified graphspell-js/spellchecker.js from [6b69161b99] to [a3d5cf0515].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, IBDAWG, Tokenizer */

"use strict";

if(typeof process !== 'undefined') {
    var ibdawg = require('./ibdawg.js');
    var tokenizer = require('./tokenizer.js');
} else if (typeof require !== 'undefined') {
    var ibdawg = require('resource://grammalecte/graphspell/ibdawg.js');
    var tokenizer = require('resource://grammalecte/graphspell/tokenizer.js');
}

${map}


const dDefaultDictionaries = new Map([
    ["fr", "fr-allvars.json"],







|
|
|
|
|
|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, IBDAWG, Tokenizer */

"use strict";

if(typeof(process) !== 'undefined') {
    var ibdawg = require("./ibdawg.js");
    var tokenizer = require("./tokenizer.js");
} else if (typeof(require) !== 'undefined') {
    var ibdawg = require("resource://grammalecte/graphspell/ibdawg.js");
    var tokenizer = require("resource://grammalecte/graphspell/tokenizer.js");
}

${map}


const dDefaultDictionaries = new Map([
    ["fr", "fr-allvars.json"],
301
302
303
304
305
306
307
308
309
310
        if (this.bPersonalDic) {
            lResult.push(...this.oPersonalDic.getSimilarEntries(sWord, nSuggLimit));
        }
        return lResult;
    }
}

if (typeof exports !== 'undefined') {
    exports.SpellChecker = SpellChecker;
}







|


301
302
303
304
305
306
307
308
309
310
        if (this.bPersonalDic) {
            lResult.push(...this.oPersonalDic.getSimilarEntries(sWord, nSuggLimit));
        }
        return lResult;
    }
}

if (typeof(exports) !== 'undefined') {
    exports.SpellChecker = SpellChecker;
}

Modified graphspell-js/str_transform.js from [2ff1a56a97] to [d8c3ab3e0d].

219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
        let [sPfxCode, sSfxCode] = sAffCode.split('/');
        sWord = sPfxCode.slice(1) + sWord.slice(sPfxCode.charCodeAt(0)-48);
        return sSfxCode[0] == '0' ? sWord + sSfxCode.slice(1) : sWord.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1);
    }
};


if (typeof exports !== 'undefined') {
    exports.longestCommonSubstring = str_transform.longestCommonSubstring;
    exports.distanceDamerauLevenshtein = str_transform.distanceDamerauLevenshtein;
    exports.distanceDamerauLevenshtein2 = str_transform.distanceDamerauLevenshtein2;
    exports.showDistance = str_transform.showDistance;
    exports.changeWordWithSuffixCode = str_transform.changeWordWithSuffixCode;
    exports.changeWordWithAffixCode = str_transform.changeWordWithAffixCode;
    exports.defineAffixCode = str_transform.defineAffixCode;







|







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
        let [sPfxCode, sSfxCode] = sAffCode.split('/');
        sWord = sPfxCode.slice(1) + sWord.slice(sPfxCode.charCodeAt(0)-48);
        return sSfxCode[0] == '0' ? sWord + sSfxCode.slice(1) : sWord.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1);
    }
};


if (typeof(exports) !== 'undefined') {
    exports.longestCommonSubstring = str_transform.longestCommonSubstring;
    exports.distanceDamerauLevenshtein = str_transform.distanceDamerauLevenshtein;
    exports.distanceDamerauLevenshtein2 = str_transform.distanceDamerauLevenshtein2;
    exports.showDistance = str_transform.showDistance;
    exports.changeWordWithSuffixCode = str_transform.changeWordWithSuffixCode;
    exports.changeWordWithAffixCode = str_transform.changeWordWithAffixCode;
    exports.defineAffixCode = str_transform.defineAffixCode;

Modified graphspell-js/tokenizer.js from [541689c69f] to [1dc7e255ce].

90
91
92
93
94
95
96
97
98
99
        if (bStartEndToken) {
            yield { "i": iToken+1, "sType": "INFO", "sValue": "<end>", "nStart": iEnd, "nEnd": iEnd, "lMorph": ["<end>"] };
        }
    }
}


if (typeof exports !== 'undefined') {
    exports.Tokenizer = Tokenizer;
}







|


90
91
92
93
94
95
96
97
98
99
        if (bStartEndToken) {
            yield { "i": iToken+1, "sType": "INFO", "sValue": "<end>", "nStart": iEnd, "nEnd": iEnd, "lMorph": ["<end>"] };
        }
    }
}


if (typeof(exports) !== 'undefined') {
    exports.Tokenizer = Tokenizer;
}