Grammalecte  Changes On Branch ba941ad2d4cd8b21

Changes In Branch nodejs Through [ba941ad2d4] Excluding Merge-Ins

This is equivalent to a diff from 453f4dcb62 to ba941ad2d4

2018-10-22
11:08
[fr] nouvelles règles diverses check-in: 09466339c5 user: olr tags: trunk, fr
2018-10-21
17:31
[njs] Cli update doc with new command check-in: c4df2bb8f2 user: IllusionPerdu tags: nodejs
15:16
[njs] Export noew function getIgnoreRules check-in: ba941ad2d4 user: IllusionPerdu tags: nodejs
15:04
[njs] Add *ignoreRule(s) check-in: ec3136d1bc user: IllusionPerdu tags: nodejs
14:37
Sync to trunk check-in: 18924f57b4 user: IllusionPerdu tags: nodejs
2018-10-20
12:52
[fr] amélioration: quel +être +det check-in: 453f4dcb62 user: olr tags: trunk, fr
12:37
[fx] update manifest.json check-in: 0927ac4d38 user: olr tags: trunk, fx

Modified gc_core/js/lang_core/gc_engine.js from [5c503d2a3c] to [8734a07c32].

89
90
91
92
93
94
95




96
97
98
99
100
101
102

    getRules: function (bParagraph) {
        if (!bParagraph) {
            return gc_rules.lSentenceRules;
        }
        return gc_rules.lParagraphRules;
    },





    ignoreRule: function (sRuleId) {
        _aIgnoredRules.add(sRuleId);
    },

    resetIgnoreRules: function () {
        _aIgnoredRules.clear();







>
>
>
>







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

    getRules: function (bParagraph) {
        if (!bParagraph) {
            return gc_rules.lSentenceRules;
        }
        return gc_rules.lParagraphRules;
    },

    getIgnoreRules: function (bParagraph) {
        return gc_rules._aIgnoredRules;
    },

    ignoreRule: function (sRuleId) {
        _aIgnoredRules.add(sRuleId);
    },

    resetIgnoreRules: function () {
        _aIgnoredRules.clear();
1413
1414
1415
1416
1417
1418
1419

1420
1421
1422
1423
1424
1425
1426
    exports.getSpellChecker = gc_engine.getSpellChecker;
    // sentence
    exports._zEndOfSentence = gc_engine._zEndOfSentence;
    exports._zBeginOfParagraph = gc_engine._zBeginOfParagraph;
    exports._zEndOfParagraph = gc_engine._zEndOfParagraph;
    exports.getSentenceBoundaries = gc_engine.getSentenceBoundaries;
    // rules

    exports.ignoreRule = gc_engine.ignoreRule;
    exports.resetIgnoreRules = gc_engine.resetIgnoreRules;
    exports.reactivateRule = gc_engine.reactivateRule;
    exports.listRules = gc_engine.listRules;
    exports.getRules = gc_engine.getRules;
    // options
    exports.setOption = gc_engine.setOption;







>







1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
    exports.getSpellChecker = gc_engine.getSpellChecker;
    // sentence
    exports._zEndOfSentence = gc_engine._zEndOfSentence;
    exports._zBeginOfParagraph = gc_engine._zBeginOfParagraph;
    exports._zEndOfParagraph = gc_engine._zEndOfParagraph;
    exports.getSentenceBoundaries = gc_engine.getSentenceBoundaries;
    // rules
    exports.getIgnoreRules = gc_engine.getIgnoreRules;
    exports.ignoreRule = gc_engine.ignoreRule;
    exports.resetIgnoreRules = gc_engine.resetIgnoreRules;
    exports.reactivateRule = gc_engine.reactivateRule;
    exports.listRules = gc_engine.listRules;
    exports.getRules = gc_engine.getRules;
    // options
    exports.setOption = gc_engine.setOption;

Modified gc_lang/fr/nodejs/cli/bin/gramma-cli.js from [d5a9326889] to [e6be35662d].

293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
                    repText += "\nErreur(s) grammaticale(s)";
                    for (let gramma of toAff.reponse.lGrammarErrors) {
                        numRep1++;
                        if (numRep1 == replength) {
                            ascii1 = "└";
                            ascii1a = " ";
                        }
                        repText += "\n " + ascii1 + " " + gramma.nStart + "->" + gramma.nEnd + " " + gramma.sMessage;
                        ascii2 = "├";
                        numRep2 = 0;
                        for (let suggestion of gramma.aSuggestions) {
                            numRep2++;
                            if (numRep2 == gramma.aSuggestions.length) {
                                ascii2 = "└";
                            }







|







293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
                    repText += "\nErreur(s) grammaticale(s)";
                    for (let gramma of toAff.reponse.lGrammarErrors) {
                        numRep1++;
                        if (numRep1 == replength) {
                            ascii1 = "└";
                            ascii1a = " ";
                        }
                        repText += "\n " + ascii1 + " " + gramma.nStart + "->" + gramma.nEnd + " [" + gramma.sRuleId + "]\n " + ascii1a + " " + gramma.sMessage;
                        ascii2 = "├";
                        numRep2 = 0;
                        for (let suggestion of gramma.aSuggestions) {
                            numRep2++;
                            if (numRep2 == gramma.aSuggestions.length) {
                                ascii2 = "└";
                            }
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
    for (const action of ["json", "perf"]) {
        if (getArg(aArg, [action])) {
            repPreference[action] = getArgVal(aArg, [action]);
            repAction[action] = repPreference[action] ? "ON" : "OFF";
        }
    }

    for (const action of ["gceoption", "tfoption"]) {
        if (getArg(aArg, [action])) {
            let sFonction = action == "gceoption" ? "GceOption" : "TfOption";
            let sOpt = sText.split(" ");
            if (sOpt[0] == "reset") {
                oGrammarChecker["reset" + sFonction + "s"]();
                repAction[action] = "reset";
            } else {
                for (const optAction of sOpt) {
                    let bOptVal = optAction[0] == "+" ? true : false;







|

|







406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
    for (const action of ["json", "perf"]) {
        if (getArg(aArg, [action])) {
            repPreference[action] = getArgVal(aArg, [action]);
            repAction[action] = repPreference[action] ? "ON" : "OFF";
        }
    }

    for (const action of ["gceoption", "tfoption", "gcerule"]) {
        if (getArg(aArg, [action])) {
            let sFonction = (action == "gceoption") ? "GceOption" : (action == "tfoption") ? "TfOption" : "GceIgnoreRule";
            let sOpt = sText.split(" ");
            if (sOpt[0] == "reset") {
                oGrammarChecker["reset" + sFonction + "s"]();
                repAction[action] = "reset";
            } else {
                for (const optAction of sOpt) {
                    let bOptVal = optAction[0] == "+" ? true : false;

Modified gc_lang/fr/nodejs/core/api.js from [a782304429] to [83bcbb9eeb].

138
139
140
141
142
143
144













































145
146
147
148
149
150
151
    resetGceOptions () {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        this._oGce.resetOptions();
        return this._helpers.mapToObject(this._oGce.getOptions());
    }














































    //Fonctions concernant: Graphspell
    getGraphspell(){
        if (!this.isInit.Graphspell) {
            this.load(["Graphspell"]);
        }
        return this.oSpellChecker;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
    resetGceOptions () {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        this._oGce.resetOptions();
        return this._helpers.mapToObject(this._oGce.getOptions());
    }

    getGceRules (bParagraph) {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        return this._oGce.getRules(bParagraph);
    }

    getGceIgnoreRules () {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        return Array.from(this._oGce.getIgnoreRules());
    }

    setGceIgnoreRules (dRules) {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        if (!(dRules instanceof Set)) {
            dRules = new Set(dRules);
        }
        this._oGce._aIgnoredRules = dRules;
        return Array.from(this._oGce.getIgnoreRules());
    }

    setGceIgnoreRule (sRuleId, bValue) {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        if (bValue){ //Add
            this._oGce.ignoreRule(sRuleId);
        } else {     //Delete
            this._oGce.reactivateRule(sRuleId);
        }
        return Array.from(this._oGce.getIgnoreRules());
    }

    resetGceIgnoreRules () {
        if (!this.isInit.Grammalecte) {
            this.load(["Grammalecte"]);
        }
        this._oGce.resetIgnoreRules();
        return Array.from(this._oGce.getIgnoreRules());
    }

    //Fonctions concernant: Graphspell
    getGraphspell(){
        if (!this.isInit.Graphspell) {
            this.load(["Graphspell"]);
        }
        return this.oSpellChecker;