Changes In Branch nodejs Through [977fd9b488] Excluding Merge-Ins
This is equivalent to a diff from 4d2953e2f6 to 977fd9b488
2018-10-12
| ||
10:33 | [build] Apply change in build check-in: 9cd97ae91f user: IllusionPerdu tags: build, nodejs | |
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
| ||
09:19 | Some change to javascript to work in node check-in: a3687f4fd3 user: IllusionPerdu tags: graphspell, njs, nodejs | |
09:03 | [fr] test faux positif check-in: bdcc97b45b user: olr tags: trunk, fr | |
2018-10-09
| ||
11:07 | [graphspell][js] useless comments check-in: 4d2953e2f6 user: olr tags: trunk, graphspell | |
08:54 | [graphspell][js] performance tests check-in: 14ed269c7c user: olr tags: trunk, graphspell | |
Added gc_core/js/exemple-node.js version [e34f3521aa].
|
Modified gc_core/js/lang_core/gc_engine.js from [e6dde271f2] to [5c503d2a3c].
1 | 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 26 27 | + + - - + + + + + + + + - + | // Grammar checker engine /* jshint esversion:6, -W097 */ |
︙ | |||
49 50 51 52 53 54 55 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | + + + - + | version: "${version}", author: "${author}", //// Initialization load: function (sContext="JavaScript", sColorType="aRGB", sPath="") { try { if(typeof(process) !== 'undefined') { var spellchecker = require("../graphspell/spellchecker.js"); _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}"); |
︙ | |||
177 178 179 180 181 182 183 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | - + | this.dTokenPos = new Map(); this.dTags = new Map(); this.dError = new Map(); this.dErrorPriority = new Map(); // Key = position; value = priority } asString () { |
︙ |
Modified gc_core/js/lang_core/gc_options.js from [aa3f5d62cd] to [ece26d7264].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 | + + - - + + | // Options for Grammalecte /* jshint esversion:6 */ |
︙ | |||
21 22 23 24 25 26 27 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - + - + - + - + - + | for (let [sOpt, sColor] of Object.entries(dOptColor)) { dColor[sOpt] = dColorType[sColor]; } return dColor; } catch (e) { console.error(e); |
Modified gc_core/js/lang_core/gc_rules.js from [cdb121423e] to [4a0b977685].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + + - + - + | // Grammar checker rules /* jshint esversion:6, -W097 */ |
Modified gc_core/js/lang_core/gc_rules_graph.js from [7405261f29] to [3efb8afd5c].
1 | 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 */ |
Modified gc_core/js/tests.js from [1eda44faf6] to [147f1c4e7b].
1 | 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + + - - + + + + - + + + + + - + + | // JavaScript /* jshint esversion:6, -W097 */ |
︙ |
Modified gc_core/js/text.js from [c9e7670db8] to [1251d5448b].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 | + + - - + + | // JavaScript /* jshint esversion:6, -W097 */ |
︙ |
Modified gc_lang/fr/modules-js/conj.js from [8124143953] to [98b99c75fa].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + + - - + + + + - + | // Grammalecte - Conjugueur // License: GPL 3 /* jshint esversion:6, -W097 */ |
︙ | |||
492 493 494 495 496 497 498 | 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 | + + + - + - + - + | } 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")); |
︙ |
Modified gc_lang/fr/modules-js/conj_generator.js from [058e3de2f7] to [5e8295b732].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - - - - + + + + + + | // JavaScript |
︙ | |||
135 136 137 138 139 140 141 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + | [2, "isses", ":Sp:Sq:2s/*", false], [2, "isse", ":Sp:3s/*", false], [2, "ît", ":Sq:3s/*", false], [2, "is", ":E:2s/*", false], [2, "issons", ":E:1p/*", false], [2, "issez", ":E:2p/*", false] ], |
︙ |
Modified gc_lang/fr/modules-js/cregex.js from [97d67d03aa] to [53af2cbc4f].
| 1 2 3 4 5 6 7 8 9 10 11 | - - + + + + |
|
︙ |
Modified gc_lang/fr/modules-js/gce_analyseur.js from [427ee71140] to [09241345b5].
| 1 2 3 4 5 6 7 8 9 10 11 | - - + + + + |
|
︙ | |||
126 127 128 129 130 131 132 | 128 129 130 131 132 133 134 135 136 137 138 139 140 | - + | if (s.length > 1 && s.length < 16 && s.slice(0, 1).gl_isLowerCase() && (!s.slice(1).gl_isLowerCase() || /[0-9]/.test(s))) { return true; } return false; } |
Modified gc_lang/fr/modules-js/gce_date_verif.js from [f30dbe242e] to [8555f52be9].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + - + - + + |
|
︙ |
Modified gc_lang/fr/modules-js/gce_suggestions.js from [ae7eaca80b] to [6c462561b6].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - - + + + + + + + + + - + |
|
︙ |
Modified gc_lang/fr/modules-js/lexicographe.js from [3f0da2f1ff] to [50f4dc02f6].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | + + - - + + | // Grammalecte - Lexicographe // License: MPL 2 /* jshint esversion:6, -W097 */ |
︙ |
Modified gc_lang/fr/modules-js/mfsp.js from [9d6124ec70] to [7cfc8c21b3].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + + - - + + + + - + | // Grammalecte /* jshint esversion:6, -W097 */ |
︙ | |||
100 101 102 103 104 105 106 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | + + + - + | return "## erreur, code : " + sSfx + " ##"; } } }; // Initialization if(!mfsp.bInit && typeof(process) !== 'undefined') { //Nodejs mfsp.init(helpers.loadFile(__dirname+"/mfsp_data.json")); |
︙ |
Modified gc_lang/fr/modules-js/phonet.js from [07bba03053] to [71750ecf21].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | + + - + + - + + + | // Grammalecte - Suggestion phonétique /* jshint esversion:6 */ |
︙ | |||
80 81 82 83 84 85 86 | 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 phonet.init(helpers.loadFile(__dirname+"/phonet_data.json")); |
︙ |
Modified gc_lang/fr/modules-js/textformatter.js from [a9dd9e148e] to [eee97306e0].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 | + + - - + + | // Grammalecte - text formatter /* jshint esversion:6, -W097 */ |
︙ | |||
81 82 83 84 85 86 87 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + | "erase_non_breaking_hyphens": [ [//g, ""] ], //// typographic signs "ts_apostrophe": [ [/\b([ldnjmtscç])['´‘′`](?=[a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ])/ig, "$1’"], [/\b(qu|jusqu|lorsqu|puisqu|quoiqu|quelqu|presqu|entr|aujourd|prud)['´‘′`]/ig, "$1’"] ], "ts_ellipsis": [ [/\.\.\./g, "…"], [/…\.\./g, "……"], [/…\.(?!\.)/g, "…"] ], |
︙ |
Modified graphspell-js/char_player.js from [626d7d161b] to [98e99c3ff4].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | + + + | // list of similar chars // useful for suggestion mechanism /* jshint esversion:6 */ /* jslint esversion:6 */ ${map} var char_player = { _xTransCharsForSpelling: new Map([ ['ſ', 's'], ['ffi', 'ffi'], ['ffl', 'ffl'], ['ff', 'ff'], ['ſt', 'ft'], ['fi', 'fi'], ['fl', 'fl'], ['st', 'st'] |
︙ | |||
21 22 23 24 25 26 27 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | _xTransCharsForSimplification: new Map([ ['à', 'a'], ['é', 'e'], ['î', 'i'], ['ô', 'o'], ['û', 'u'], ['ÿ', 'i'], ['y', 'i'], ['â', 'a'], ['è', 'e'], ['ï', 'i'], ['ö', 'o'], ['ù', 'u'], ['ŷ', 'i'], ['ä', 'a'], ['ê', 'e'], ['í', 'i'], ['ó', 'o'], ['ü', 'u'], ['ý', 'i'], ['á', 'a'], ['ë', 'e'], ['ì', 'i'], ['ò', 'o'], ['ú', 'u'], ['ỳ', 'i'], ['ā', 'a'], ['ē', 'e'], ['ī', 'i'], ['ō', 'o'], ['ū', 'u'], ['ȳ', 'i'], ['ç', 'c'], ['ñ', 'n'], ['k', 'q'], ['w', 'v'], |
︙ | |||
100 101 102 103 104 105 106 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + | ["Ë", "EeÉéÈèÊêËëĒēŒœ"], ["f", "fF"], ["F", "Ff"], ["g", "gGjJĵĴ"], ["G", "GgJjĴĵ"], |
︙ | |||
378 379 380 381 382 383 384 | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | - + | }, // Other functions filterSugg: function (aSugg) { return aSugg.filter((sSugg) => { return !sSugg.endsWith("è") && !sSugg.endsWith("È"); }); } |
︙ |
Modified graphspell-js/dawg.js from [d94e6b7163] to [f36dfe75af].
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 20 21 22 23 24 25 26 27 28 | + + + + - - + + + - | // JavaScript // FSA DICTIONARY BUILDER // // by Olivier R. // License: MPL 2 // // This tool encodes lexicon into an indexable binary dictionary // Input files MUST be encoded in UTF-8. /* jshint esversion:6, -W097 */ /* jslint esversion:6 */ /* global require, exports, console, helpers */ "use strict"; |
︙ | |||
96 97 98 99 100 101 102 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - + | let lWord = []; for (let [sFlex, iAff, iTag] of lEntry) { let lTemp = []; for (let c of sFlex) { lTemp.push(dChar.get(c)); } lTemp.push(iAff+nChar); |
︙ | |||
426 427 428 429 430 431 432 | 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | - + | this.nNextId += 1; return this.nNextId-1; }, reset: function () { this.nNextId = 0; } |
︙ | |||
540 541 542 543 544 545 546 | 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | - + | convValueToHexString (nVal, nByte) { // nVal: value to convert, nByte: number of bytes let sHexVal = nVal.toString(16); // conversion to hexadecimal string //console.log(`value: ${nVal} in ${nByte} bytes`); if (sHexVal.length < (nByte*2)) { return "0".repeat((nByte*2) - sHexVal.length) + sHexVal; } else if (sHexVal.length == (nByte*2)) { |
︙ |
Modified graphspell-js/helpers.js from [6ccb02c60d] to [3e56cf75fd].
| 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + + - - + + + + + + + - - - - - - - + + + + + + + + |
|
︙ |
Modified graphspell-js/ibdawg.js from [26e5034903] to [4598bbd432].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - + + + + + - - + + + + + - |
|
︙ | |||
93 94 95 96 97 98 99 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | + + + + - + + | // INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH constructor (param1, sPath="") { // param1 can be a filename or a object with all the necessary data. try { let oData = null; if (typeof(param1) == "string") { let sURL; if(typeof(process) !== 'undefined') { sURL = (sPath !== "") ? sPath + "/" + param1 : __dirname + "/_dictionaries/"+param1; } else { |
︙ | |||
219 220 221 222 223 224 225 | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | - + | "l2grams": this.l2grams }; return oJSON; } isValidToken (sToken) { // checks if sToken is valid (if there is hyphens in sToken, sToken is split, each part is checked) |
︙ | |||
296 297 298 299 300 301 302 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | - + - - + + - + - - + | } } return Boolean(this._convBytesToInteger(this.byDic.slice(iAddr, iAddr+this.nBytesArc)) & this._finalNodeMask); } getMorph (sWord) { // retrieves morphologies list, different casing allowed |
︙ | |||
587 588 589 590 591 592 593 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | - + | } iAddr = iEndArcAddr + this.nBytesNodeAddress; } } } * _getArcs1 (iAddr) { |
︙ |
Modified graphspell-js/spellchecker.js from [b26374afa0] to [a3d5cf0515].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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 26 27 28 29 30 | + + + - - + + + + - | // Spellchecker // Wrapper for the IBDAWG class. // Useful to check several dictionaries at once. // To avoid iterating over a pile of dictionaries, it is assumed that 3 are enough: // - the main dictionary, bundled with the package // - the extended dictionary // - the community dictionary, added by an organization // - the personal dictionary, created by the user for its own convenience /* jshint esversion:6, -W097 */ /* jslint esversion:6 */ /* global require, exports, console, IBDAWG, Tokenizer */ "use strict"; |
︙ | |||
62 63 64 65 66 67 68 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - + | } } catch (e) { let sfDictionary = (typeof(dictionary) == "string") ? dictionary : dictionary.sLangName + "/" + dictionary.sFileName; if (bNecessary) { throw "Error: <" + sfDictionary + "> not loaded. " + e.message; } |
︙ | |||
193 194 195 196 197 198 199 | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | - + - + | // checks if sWord is valid (different casing tested if the first letter is a capital) if (this.oMainDic.isValid(sWord)) { return true; } if (this.bExtendedDic && this.oExtendedDic.isValid(sWord)) { return true; } |
︙ | |||
269 270 271 272 273 274 275 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - + | if (this.bPersonalDic) { yield this.oPersonalDic.suggest(sWord, nSuggLimit); } } * select (sFlexPattern="", sTagsPattern="") { // generator: returns all entries which flexion fits <sFlexPattern> and morphology fits <sTagsPattern> |
︙ |
Modified graphspell-js/str_transform.js from [63ae767339] to [d8c3ab3e0d].
| 1 2 3 4 5 6 7 8 9 10 11 12 | - - + + + + + |
|
︙ |
Added graphspell-js/test/minimal.js version [9a28cea93b].
|
Modified graphspell-js/tokenizer.js from [88bacac87d] to [1dc7e255ce].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | + + - - + + | // JavaScript // Very simple tokenizer /* jshint esversion:6, -W097 */ |
︙ | |||
68 69 70 71 72 73 74 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - + | while (sText) { let iCut = 1; for (let [zRegex, sType] of this.aRules) { if (sType !== "SPACE" || bWithSpaces) { try { if ((m = zRegex.exec(sText)) !== null) { iToken += 1; |
︙ |