Overview
Context
Changes
Modified gc_core/js/lang_core/gc_engine.js
from [fd075f5592]
to [950bb85046].
︙ | | |
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
+
-
-
-
-
-
-
|
${string}
${regex}
${map}
if (typeof(process) !== 'undefined') {
// NodeJS
var gc_options = require("./gc_options.js");
var gc_rules = require("./gc_rules.js");
var gc_rules_graph = require("./gc_rules_graph.js");
var cregex = require("./cregex.js");
var text = require("../text.js");
} else if (typeof(require) !== 'undefined') {
var gc_options = require("resource://grammalecte/${lang}/gc_options.js");
var gc_rules = require("resource://grammalecte/${lang}/gc_rules.js");
var gc_rules_graph = require("resource://grammalecte/${lang}/gc_rules_graph.js");
var cregex = require("resource://grammalecte/${lang}/cregex.js");
var text = require("resource://grammalecte/text.js");
}
function capitalizeArray (aArray) {
// can’t map on user defined function??
let aNew = [];
for (let i = 0; i < aArray.length; i = i + 1) {
|
︙ | | |
Modified gc_core/js/tests.js
from [147f1c4e7b]
to [5a6c382af8].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
+
-
-
|
// JavaScript
/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console */
"use strict";
if(typeof(process) !== 'undefined') {
if (typeof(process) !== 'undefined') {
var helpers = require("./graphspell/helpers.js");
} else if (typeof(require) !== 'undefined') {
var helpers = require("resource://grammalecte/graphspell/helpers.js");
}
class TestGrammarChecking {
constructor (gce, spfTests="") {
this.gce = gce;
|
︙ | | |
Modified gc_lang/fr/modules-js/conj.js
from [a010e7113e]
to [6b8df706bd].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-
+
-
-
+
|
// Grammalecte - Conjugueur
// License: GPL 3
/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, self, browser, chrome, __dirname */
"use strict";
${map}
${set}
if(typeof(process) !== 'undefined') {
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: {},
_dVerbNames: {},
|
︙ | | |
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
-
+
-
-
-
-
-
-
-
-
-
|
return oConjTable;
}
}
// Initialization
if(!conj.bInit && typeof(process) !== 'undefined') {
// Work with nodejs
// 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é");
}
|
︙ | | |
Modified gc_lang/fr/modules-js/mfsp.js
from [74f770c1bb]
to [abc12c1177].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
+
-
-
|
// Grammalecte
/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, exports, console, browser,__dirname */
"use strict";
if(typeof(process) !== 'undefined') {
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: [],
_lTagFemForm: [],
|
︙ | | |
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
-
-
+
+
-
-
-
|
return "## erreur, code : " + sSfx + " ##";
}
}
};
// Initialization
if(!mfsp.bInit && typeof(process) !== 'undefined') {
//Nodejs
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é");
}
|
︙ | | |
Modified gc_lang/fr/modules-js/phonet.js
from [71750ecf21]
to [591db698ab].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
+
-
-
|
// Grammalecte - Suggestion phonétique
/* jshint esversion:6 */
/* jslint esversion:6 */
/* global __dirname */
if(typeof(process) !== 'undefined') {
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: [],
_dMorph: new Map(),
|
︙ | | |
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
-
+
-
-
-
|
return aSelect;
}
};
// Initialization
if (!phonet.bInit && typeof(process) !== 'undefined') {
//Nodejs
// 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é");
}
|
︙ | | |