Overview
Comment: | [core][build][js] replace nbsp by nnbsp within the GC, instead of replacing them at build |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | fr | core | build |
Files: | files | file ages | folders |
SHA3-256: |
bd2ff57bf894cbc948a4c44606c696b0 |
User & Date: | olr on 2021-01-23 13:03:40 |
Other Links: | manifest | tags |
Context
2021-01-23
| ||
14:02 | [core][fr][js] fix getGenderNumber() check-in: 3607227671 user: olr tags: trunk, fr, core | |
13:03 | [core][build][js] replace nbsp by nnbsp within the GC, instead of replacing them at build check-in: bd2ff57bf8 user: olr tags: trunk, fr, core, build | |
2021-01-22
| ||
11:34 | [core][fr] fix bug in suggestions for JS check-in: a6f73e3a7b user: olr tags: trunk, fr, core | |
Changes
Modified compile_rules_js_convert.py from [48401df6d7] to [bddec8a9b3].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - | """ Convert Python code and regexes to JavaScript code """ import copy import re import json def py2js (sCode): "convert Python code to JavaScript code" # Python strings |
︙ | |||
123 124 125 126 127 128 129 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | - - + + | # graph rules if lRuleJS[0] == "@@@@": return lRuleJS del lRule[-1] # tGroups positioning codes are useless for Python # error messages for aAction in lRuleJS[6]: if aAction[1] == "-": |
︙ |
Modified gc_core/js/lang_core/gc_engine.js from [a6cc51f719] to [a05d9994e2].
︙ | |||
301 302 303 304 305 306 307 | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | - | if (!gc_engine.aIgnoredRules.has(sRuleId)) { while ((m = zRegex.gl_exec2(sText, lGroups, lNegLookBefore)) !== null) { let bCondMemo = null; for (let [sFuncCond, cActionType, sWhat, ...eAct] of lActions) { // action in lActions: [ condition, action type, replacement/suggestion/action[, iGroup[, message, URL]] ] try { bCondMemo = (!sFuncCond || gc_functions[sFuncCond](sText, sText0, m, this.dTokenPos, sCountry, bCondMemo)); |
︙ | |||
327 328 329 330 331 332 333 | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - | console.log("~ " + sText + " -- " + m[eAct[0]] + " # " + sLineId); } break; case "=": // disambiguation //console.log("-> disambiguation by " + sLineId + "\nzRegex: " + zRegex.source); gc_functions[sWhat](sText, m, this.dTokenPos); |
︙ | |||
660 661 662 663 664 665 666 | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | - | // TextProcessor [ option, condition, "~", replacement/suggestion/action, iTokenStart, iTokenEnd, bCaseSvty ] // Disambiguator [ option, condition, "=", replacement/suggestion/action ] // Tag [ option, condition, "/", replacement/suggestion/action, iTokenStart, iTokenEnd ] // Immunity [ option, condition, "!", "", iTokenStart, iTokenEnd ] // Test [ option, condition, ">", "" ] if (!sOption || dOptions.gl_get(sOption, false)) { bCondMemo = !sFuncCond || gc_functions[sFuncCond](this.lTokens, nTokenOffset, nLastToken, sCountry, bCondMemo, this.dTags, this.sSentence, this.sSentence0); |
︙ | |||
694 695 696 697 698 699 700 | 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | - | if (bDebug) { console.log(` TEXT_PROCESSOR: [${this.lTokens[nTokenStart]["sValue"]}:${this.lTokens[nTokenEnd]["sValue"]}] > ${sWhat}`); } } else if (cActionType == "=") { // disambiguation gc_functions[sWhat](this.lTokens, nTokenOffset, nLastToken); |
︙ | |||
778 779 780 781 782 783 784 | 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | - - + - + - - - + - + - | _createErrorFromRegex (sText, sText0, sSugg, nOffset, m, iGroup, sLineId, sRuleId, bCaseSvty, sMsg, sURL, bShowRuleId, sOption, bContext) { let nStart = nOffset + m.start[iGroup]; let nEnd = nOffset + m.end[iGroup]; // suggestions let lSugg = []; if (sSugg.startsWith("=")) { sSugg = gc_functions[sSugg.slice(1)](sText, m); |
︙ | |||
870 871 872 873 874 875 876 | 862 863 864 865 866 867 868 869 870 871 872 873 874 875 | - | sNew = "_".repeat(ln); } else if (sRepl === "@") { sNew = "@".repeat(ln); } else if (sRepl.slice(0,1) === "=") { sNew = gc_functions[sRepl.slice(1)](sText, m); |
︙ | |||
917 918 919 920 921 922 923 | 908 909 910 911 912 913 914 915 916 917 918 919 920 921 | - | this.lTokens[i]["sNewValue"] = "_"; } } } else { if (sWhat.startsWith("=")) { sWhat = gc_functions[sWhat.slice(1)](this.lTokens, nTokenOffset, nLastToken); |
︙ |
Modified gc_lang/fr/rules.grx from [08e4bb7dc6] to [4ade6e87a4].
︙ | |||
1303 1304 1305 1306 1307 1308 1309 | 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 | - - + + - + + + + + + | !!!! Grands nombres !! !! !! __[s]/num(num_grand_nombre_soudé)__ \d\d\d\d+ <<- not before("NF[ -]?(C|E|P|Q|X|Z|EN(?:[ -]ISO|)) *$") >>> |
︙ |