Grammalecte  Check-in [c55ae247e7]

Overview
Comment:[core][js] test if <exports> exists
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | webext
Files: files | file ages | folders
SHA3-256: c55ae247e74c24a284f06e87111b5ab98a91c0e8cb3701330670947989cb421c
User & Date: olr on 2017-07-29 08:06:31
Other Links: branch diff | manifest | tags
Context
2017-07-29
09:13
[core][js] helpers as object check-in: a5d2fe7405 user: olr tags: core, webext
08:06
[core][js] test if <exports> exists check-in: c55ae247e7 user: olr tags: core, webext
07:54
[core][js] helpers: inspect check-in: 8820c8ab4d user: olr tags: core, webext
2017-07-27
10:10
[core][js] test if variable <exports> exists check-in: f9a034e6ce user: olr tags: trunk, core
Changes

Modified gc_core/js/ibdawg.js from [2d42754063] to [e119c6b02d].

284
285
286
287
288
289
290

291


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



exports.IBDAWG = IBDAWG;








>
|
>
284
285
286
287
288
289
290
291
292
293

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


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

Modified gc_core/js/lang_core/gc_engine.js from [e250bfaf63] to [23856850af].

602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623

${pluginsJS}


${callablesJS}




exports.load = load;
exports.parse = parse;
exports.lang = lang;
exports.version = version;
exports.getDictionary = getDictionary;
exports.setOption = setOption;
exports.setOptions = setOptions;
exports.getOptions = getOptions;
exports.getDefaultOptions = getDefaultOptions;
exports.resetOptions = resetOptions;
exports.ignoreRule = ignoreRule;
exports.reactivateRule = reactivateRule;
exports.resetIgnoreRules = resetIgnoreRules;
exports.listRules = listRules;








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
${pluginsJS}


${callablesJS}



if (typeof(exports) !== 'undefined') {
    exports.load = load;
    exports.parse = parse;
    exports.lang = lang;
    exports.version = version;
    exports.getDictionary = getDictionary;
    exports.setOption = setOption;
    exports.setOptions = setOptions;
    exports.getOptions = getOptions;
    exports.getDefaultOptions = getDefaultOptions;
    exports.resetOptions = resetOptions;
    exports.ignoreRule = ignoreRule;
    exports.reactivateRule = reactivateRule;
    exports.resetIgnoreRules = resetIgnoreRules;
    exports.listRules = listRules;
}

Modified gc_core/js/lang_core/gc_options.js from [a6bfab9180] to [6e45d077d4].

15
16
17
18
19
20
21


22
23
24

    "JavaScript": new Map (${dOptJavaScript}),
    "Firefox": new Map (${dOptFirefox}),
    "Thunderbird": new Map (${dOptThunderbird}),
}

const dOptLabel = ${dOptLabel};



exports.getOptions = getOptions;
exports.lStructOpt = lStructOpt;
exports.dOptLabel = dOptLabel;








>
>
|
|
|
>
15
16
17
18
19
20
21
22
23
24
25
26
27
    "JavaScript": new Map (${dOptJavaScript}),
    "Firefox": new Map (${dOptFirefox}),
    "Thunderbird": new Map (${dOptThunderbird}),
}

const dOptLabel = ${dOptLabel};


if (typeof(exports) !== 'undefined') {
	exports.getOptions = getOptions;
	exports.lStructOpt = lStructOpt;
	exports.dOptLabel = dOptLabel;
}

Modified gc_core/js/lang_core/gc_rules.js from [c85bd666a1] to [03bc540fb7].

1
2
3
4
5
6
7
8
9
10
11

12
13

// Grammar checker rules
"use strict";

${string}
${regex}

const lParagraphRules = ${paragraph_rules_JS};

const lSentenceRules = ${sentence_rules_JS};



exports.lParagraphRules = lParagraphRules;
exports.lSentenceRules = lSentenceRules;












>
|
|
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Grammar checker rules
"use strict";

${string}
${regex}

const lParagraphRules = ${paragraph_rules_JS};

const lSentenceRules = ${sentence_rules_JS};


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

Modified gc_core/js/str_transform.js from [572c35f46a] to [0fafeda9a5].

50
51
52
53
54
55
56

57
58

    }
    var [sPfxCode, sSfxCode] = sAffCode.split('/');
    sFlex = sPfxCode.slice(1) + sFlex.slice(sPfxCode.charCodeAt(0)-48);
    return sSfxCode[0] == '0' ? sFlex + sSfxCode.slice(1) : sFlex.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1);
}



exports.getStemFromSuffixCode = getStemFromSuffixCode;
exports.getStemFromAffixCode = getStemFromAffixCode;








>
|
|
>
50
51
52
53
54
55
56
57
58
59
60
    }
    var [sPfxCode, sSfxCode] = sAffCode.split('/');
    sFlex = sPfxCode.slice(1) + sFlex.slice(sPfxCode.charCodeAt(0)-48);
    return sSfxCode[0] == '0' ? sFlex + sSfxCode.slice(1) : sFlex.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1);
}


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

Modified gc_core/js/tests.js from [24427fff6b] to [f2f737b523].

143
144
145
146
147
148
149


150

            helpers.logerror(e);
        }
        return [" ".repeat(sLine.length), ""];
    };

}



exports.TestGrammarChecking = TestGrammarChecking;








>
>
|
>
143
144
145
146
147
148
149
150
151
152
153
            helpers.logerror(e);
        }
        return [" ".repeat(sLine.length), ""];
    };

}


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

Modified gc_core/js/text.js from [f8cb0efb57] to [035788e8ab].

166
167
168
169
170
171
172

173
174
175
176
177

    catch (e) {
        helpers.logerror(e);
        return '# Error. Data: ' + oErr.toString();
    }
}



exports.getParagraph = getParagraph;
exports.addHtmlEntities = addHtmlEntities;
exports.createHTMLBlock = createHTMLBlock;
exports.tagParagraph = tagParagraph;
exports.getReadableError = getReadableError;








>
|
|
|
|
|
>
166
167
168
169
170
171
172
173
174
175
176
177
178
179
    catch (e) {
        helpers.logerror(e);
        return '# Error. Data: ' + oErr.toString();
    }
}


if (typeof(exports) !== 'undefined') {
    exports.getParagraph = getParagraph;
    exports.addHtmlEntities = addHtmlEntities;
    exports.createHTMLBlock = createHTMLBlock;
    exports.tagParagraph = tagParagraph;
    exports.getReadableError = getReadableError;
}

Modified gc_core/js/tokenizer.js from [d06151ccd7] to [4c307bc446].

68
69
70
71
72
73
74


75

            }
            i += nCut;
            sText = sText.slice(nCut);
        }
    }
}



exports.Tokenizer = Tokenizer;








>
>
|
>
68
69
70
71
72
73
74
75
76
77
78
            }
            i += nCut;
            sText = sText.slice(nCut);
        }
    }
}


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

Modified gc_lang/fr/modules-js/conj.js from [82dfb400da] to [617a828712].

483
484
485
486
487
488
489

490
491
492
493
494
495
496
        }
        if (!bPlur) {
            return (this.dConj.get(":PQ").get(":Q3")) ? this.dConj.get(":PQ").get(":Q3") : this.dConj.get(":PQ").get(":Q1");
        }
        return (this.dConj.get(":PQ").get(":Q4")) ? this.dConj.get(":PQ").get(":Q4") : this.dConj.get(":PQ").get(":Q1");
    }
}


if (typeof(exports) !== 'undefined') {
    // Used for Grammalecte library.
    // In content scripts, these variable are directly reachable
    exports.Verb = Verb;
    exports.isVerb = isVerb;
    exports.getConj = getConj;







>







483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
        }
        if (!bPlur) {
            return (this.dConj.get(":PQ").get(":Q3")) ? this.dConj.get(":PQ").get(":Q3") : this.dConj.get(":PQ").get(":Q1");
        }
        return (this.dConj.get(":PQ").get(":Q4")) ? this.dConj.get(":PQ").get(":Q4") : this.dConj.get(":PQ").get(":Q1");
    }
}


if (typeof(exports) !== 'undefined') {
    // Used for Grammalecte library.
    // In content scripts, these variable are directly reachable
    exports.Verb = Verb;
    exports.isVerb = isVerb;
    exports.getConj = getConj;

Modified gc_lang/fr/modules-js/cregex.js from [eb814cc494] to [266ea45a85].

260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300

    if (lMorph.some(s  =>  zNPf.test(s))) {
        return false;
    }
    return lMorph.some(s  =>  zNPm.test(s));
}



exports.getLemmaOfMorph = getLemmaOfMorph;
exports.checkAgreement = checkAgreement;
exports.checkConjVerb = checkConjVerb;
exports.getGender = getGender;
exports.getNumber = getNumber;
exports.isNom = isNom;
exports.isNomNotAdj = isNomNotAdj;
exports.isAdj = isAdj;
exports.isNomAdj = isNomAdj;
exports.isNomVconj = isNomVconj;
exports.isInv = isInv;
exports.isSg = isSg;
exports.isPl = isPl;
exports.isEpi = isEpi;
exports.isMas = isMas;
exports.isFem = isFem;
exports.mbNom = mbNom;
exports.mbAdj = mbAdj;
exports.mbAdjNb = mbAdjNb;
exports.mbNomAdj = mbNomAdj;
exports.mbNomNotAdj = mbNomNotAdj;
exports.mbPpasNomNotAdj = mbPpasNomNotAdj;
exports.mbVconj = mbVconj;
exports.mbVconj123 = mbVconj123;
exports.mbMG = mbMG;
exports.mbInv = mbInv;
exports.mbSg = mbSg;
exports.mbPl = mbPl;
exports.mbEpi = mbEpi;
exports.mbMas = mbMas;
exports.mbFem = mbFem;
exports.mbNpr = mbNpr;
exports.mbNprMasNotFem = mbNprMasNotFem;








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
    if (lMorph.some(s  =>  zNPf.test(s))) {
        return false;
    }
    return lMorph.some(s  =>  zNPm.test(s));
}


if (typeof(exports) !== 'undefined') {
    exports.getLemmaOfMorph = getLemmaOfMorph;
    exports.checkAgreement = checkAgreement;
    exports.checkConjVerb = checkConjVerb;
    exports.getGender = getGender;
    exports.getNumber = getNumber;
    exports.isNom = isNom;
    exports.isNomNotAdj = isNomNotAdj;
    exports.isAdj = isAdj;
    exports.isNomAdj = isNomAdj;
    exports.isNomVconj = isNomVconj;
    exports.isInv = isInv;
    exports.isSg = isSg;
    exports.isPl = isPl;
    exports.isEpi = isEpi;
    exports.isMas = isMas;
    exports.isFem = isFem;
    exports.mbNom = mbNom;
    exports.mbAdj = mbAdj;
    exports.mbAdjNb = mbAdjNb;
    exports.mbNomAdj = mbNomAdj;
    exports.mbNomNotAdj = mbNomNotAdj;
    exports.mbPpasNomNotAdj = mbPpasNomNotAdj;
    exports.mbVconj = mbVconj;
    exports.mbVconj123 = mbVconj123;
    exports.mbMG = mbMG;
    exports.mbInv = mbInv;
    exports.mbSg = mbSg;
    exports.mbPl = mbPl;
    exports.mbEpi = mbEpi;
    exports.mbMas = mbMas;
    exports.mbFem = mbFem;
    exports.mbNpr = mbNpr;
    exports.mbNprMasNotFem = mbNprMasNotFem;
}

Modified gc_lang/fr/modules-js/lexicographe.js from [7e54b6b49b] to [762e5e6b63].

260
261
262
263
264
265
266

267

        }
        let nPos = s.indexOf("-");
        return _dAD.get(s.slice(0, nPos)) + " +" + _dAD.get(s.slice(nPos+1));
    };
}



exports.Lexicographe = Lexicographe;








>
|
>
260
261
262
263
264
265
266
267
268
269
        }
        let nPos = s.indexOf("-");
        return _dAD.get(s.slice(0, nPos)) + " +" + _dAD.get(s.slice(nPos+1));
    };
}


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

Modified gc_lang/fr/modules-js/mfsp.js from [eacc870aa5] to [404b1b695d].

75
76
77
78
79
80
81

82
83
84
85

    catch (e) {
        console.log(e);
        return "## erreur, code : " + sSfx + " ##";
    }
}



exports.isFemForm = isFemForm;
exports.getMasForm = getMasForm;
exports.hasMiscPlural = hasMiscPlural;
exports.getMiscPlural = getMiscPlural;








>
|
|
|
|
>
75
76
77
78
79
80
81
82
83
84
85
86
87
    catch (e) {
        console.log(e);
        return "## erreur, code : " + sSfx + " ##";
    }
}


if (typeof(exports) !== 'undefined') {
    exports.isFemForm = isFemForm;
    exports.getMasForm = getMasForm;
    exports.hasMiscPlural = hasMiscPlural;
    exports.getMiscPlural = getMiscPlural;
}

Modified gc_lang/fr/modules-js/phonet.js from [7cb5eceb49] to [d425c9d552].

64
65
66
67
68
69
70

71
72
73

            }
        }
    }
    return aSelect;
}



exports.hasSimil = hasSimil;
exports.getSimil = getSimil;
exports.selectSimil = selectSimil;








>
|
|
|
>
64
65
66
67
68
69
70
71
72
73
74
75
            }
        }
    }
    return aSelect;
}


if (typeof(exports) !== 'undefined') {
    exports.hasSimil = hasSimil;
    exports.getSimil = getSimil;
    exports.selectSimil = selectSimil;
}

Modified gc_lang/fr/modules-js/textformatter.js from [fcd9e4b1a6] to [b59d078241].

274
275
276
277
278
279
280

281
282
283
284
285
        return sText;
    };

    getDefaultOptions () {
        return dDefaultOptions;
    }
}


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







>





274
275
276
277
278
279
280
281
282
283
284
285
286
        return sText;
    };

    getDefaultOptions () {
        return dDefaultOptions;
    }
}


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