Comment: | [core][fr][js] ajout des ; oubliés et ajustement des ; en trop |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core | webext2_fix |
Files: | files | file ages | folders |
SHA3-256: |
1800ac6b982303075b16b8b05f80080d |
User & Date: | IllusionPerdu on 2017-08-06 01:32:04 |
Original Comment: | [FIX JS] ajout des ; oubliés et ajustement des ; en trop |
Other Links: | branch diff | manifest | tags |
2017-08-06
| ||
01:43 | [core][fr][js] Remplacement des “compréhensions de tableau” par du code supporté par un plus grand nombre d’interpréteurs JS : permet de fonctionner sur Chrome et NodeJS check-in: 51348d75f8 user: IllusionPerdu tags: core, webext2_fix | |
01:32 | [core][fr][js] ajout des ; oubliés et ajustement des ; en trop check-in: 1800ac6b98 user: IllusionPerdu tags: core, webext2_fix | |
2017-08-05
| ||
16:01 | [fx] test with Nightly again check-in: 578863e008 user: olr tags: fx, webext2 | |
Modified gc_core/js/helpers.js from [a78485e9a7] to [8fee48eb89].
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - + | } xRequest.open('GET', spf, false); // 3rd arg is false for synchronous, sync is acceptable in workers xRequest.send(); return xRequest.responseText; } catch (e) { this.logerror(e); |
Modified gc_core/js/ibdawg.js from [10dd14ace9] to [cdddd20c84].
︙ | |||
72 73 74 75 76 77 78 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + - + - + | break; default: throw ValueError("# Error: unknown code: " + this.nVersion); } //console.log(this.getInfo()); this.bOptNumSigle = true; this.bOptNumAtLast = false; |
︙ | |||
123 124 125 126 127 128 129 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 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 | - + - + - + - + - + | } return !!this.lookup(sWord.slice(0, 1).toLowerCase() + sWord.slice(1)); } else { return !!this.lookup(sWord.toLowerCase()); } } return false; |
︙ | |||
205 206 207 208 209 210 211 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | - + | } } iAddr = iEndArcAddr + this.nBytesNodeAddress; } return l; } return []; |
︙ | |||
235 236 237 238 239 240 241 | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 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 | - + - + - + - + - + - + - + - + | l.push(this.funcStemming(sWord, this.lArcVal[nArc])); } iAddr = iEndArcAddr + this.nBytesNodeAddress; } return l; } return []; |
Modified gc_core/js/jsex_map.js from [985754ee9e] to [ca76af0666].
1 2 3 4 5 6 7 8 9 10 | 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 46 47 | - + - + - + - + - + - + | // Map if (Map.prototype.grammalecte === undefined) { Map.prototype.gl_shallowCopy = function () { let oNewMap = new Map(); for (let [key, val] of this.entries()) { oNewMap.set(key, val); } return oNewMap; |
Modified gc_core/js/jsex_regex.js from [b8b02d05dd] to [8feeee694f].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + - + - + - + | m.end.push(m.index + codePos + m[i].length); } else if (codePos === "$") { // at the end of the pattern m.start.push(this.lastIndex - m[i].length); m.end.push(this.lastIndex); } else if (codePos === "w") { // word in the middle of the pattern |
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 | - + | if (typeof(helpers) !== "undefined") { helpers.logerror(e); } else { console.error(e); } } return m; |
Modified gc_core/js/jsex_string.js from [1e9c89a872] to [86533aa4da].
︙ | |||
11 12 13 14 15 16 17 | 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 46 47 48 49 50 51 52 53 54 55 56 57 | - + - + - + - + - + - + - + - + - + - + | let iPos = 0; let nStep = (bOverlapping) ? 1 : sSearch.length; while ((iPos = this.indexOf(sSearch, iPos)) >= 0) { nOccur++; iPos += nStep; } return nOccur; |
Modified gc_core/js/lang_core/gc_engine.js from [2f4877bef2] to [46c54e0aa3].
︙ | |||
100 101 102 103 104 105 106 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - + | }, _zEndOfSentence: new RegExp ('([.?!:;…][ .?!… »”")]*|.$)', "g"), _zBeginOfParagraph: new RegExp ("^[- –—.,;?!…]*", "ig"), _zEndOfParagraph: new RegExp ("[- .,;?!…–—]*$", "ig"), _getSentenceBoundaries: function* (sText) { |
︙ | |||
130 131 132 133 134 135 136 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + | /*if (bDebug) { echo(">>>> Rule # " + sLineId + " - Text: " + s + " opt: "+ sOption); }*/ for (let [sFuncCond, cActionType, sWhat, ...eAct] of lActions) { // action in lActions: [ condition, action type, replacement/suggestion/action[, iGroup[, message, URL]] ] try { //echo(oEvalFunc[sFuncCond]); |
︙ | |||
219 220 221 222 223 224 225 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | - + | } else { oErr["aSuggestions"] = sRepl.gl_expand(m).split("|"); } } // Message let sMessage = ""; if (sMsg.slice(0,1) === "=") { |
︙ | |||
351 352 353 354 355 356 357 | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | - + | getDefaultOptions: function () { return gc_options.getOptions(_sAppContext).gl_shallowCopy(); }, resetOptions: function () { _dOptions = gc_options.getOptions(_sAppContext).gl_shallowCopy(); } |
︙ |
Modified gc_core/js/str_transform.js from [9b41fc7a14] to [3f33d76266].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + | if (!sAffCode.includes("/")) { return "# error #"; } let [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); } |
Modified gc_core/js/tests.js from [4a9fbec06f] to [abe05a3485].
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + - + - - + + | } class TestGrammarChecking { constructor (gce, spfTests="") { this.gce = gce; |
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + | if (sExpectedErrors !== sFoundErrors) { yield "\n" + i.toString() + "\n# Line num: " + sLineNum + "\n> to check: " + sTextToCheck + "\n expected: " + sExpectedErrors + "\n found: " + sFoundErrors + "\n errors: \n" + sListErr; |
︙ | |||
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + | yield sUntestedRules + "\n[" + i.toString() + " untested rules]"; } } const t1 = Date.now(); yield "Tests parse finished in " + ((t1-t0)/1000).toString() + " s\nTotal errors: " + nInvalid.toString() + " / " + nTotal.toString(); |
︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - + | } return sRes; } catch (e) { helpers.logerror(e); } return " ".repeat(sLine.length); |
︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | - + | } return [sRes, sListErr]; } catch (e) { helpers.logerror(e); } return [" ".repeat(sLine.length), ""]; |
Modified gc_core/js/text.js from [03f872e8ba] to [46a1749c2b].
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + | return sResult; } catch (e) { helpers.logerror(e); return "\n# Error. Data: " + oErr.toString(); } } |
Modified gc_core/js/tokenizer.js from [02266194ef] to [fcd058bf6a].
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - + - + | [/^&\w+;(?:\w+;|)/, 'HTMLENTITY'], [/^(?:l|d|n|m|t|s|j|c|ç|lorsqu|puisqu|jusqu|quoiqu|qu)['’`]/i, 'ELPFX'], [/^\d\d?[hm]\d\d\b/, 'HOUR'], [/^\d+(?:er|nd|e|de|ième|ème|eme)s?\b/, 'ORDINAL'], [/^-?\d+(?:[.,]\d+|)/, 'NUM'], [/^[a-zA-Zà-öÀ-Ö0-9ø-ÿØ-ßĀ-ʯfi-st]+(?:[’'`-][a-zA-Zà-öÀ-Ö0-9ø-ÿØ-ßĀ-ʯfi-st]+)*/, 'WORD'] ] |
︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | - + | catch (e) { helpers.logerror(e); } } i += nCut; sText = sText.slice(nCut); } |
︙ |
Modified gc_lang/fr/modules-js/conj.js from [526a57d214] to [4d0235196d].
︙ | |||
166 167 168 169 170 171 172 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - + | } } catch (e) { console.log(e); return "## erreur, code : " + sSfx + " ##"; } } |
︙ | |||
268 269 270 271 272 273 274 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | - + | [":E", new Map ([ ["label", "Impératif"], [":2s", conj._getConjWithTags(sVerb, this._tTags, ":E", ":2s")], [":1p", conj._getConjWithTags(sVerb, this._tTags, ":E", ":1p")], [":2p", conj._getConjWithTags(sVerb, this._tTags, ":E", ":2p")] ])] ]); |
︙ | |||
296 297 298 299 300 301 302 | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | - + | if (this._sRawInfo.slice(6,7) == "m") { sInfo = sInfo + " impersonnel"; } if (sInfo === "") { sInfo = "# erreur - code : " + this._sRawInfo; } return sGroup + " · " + sInfo; |
︙ | |||
322 323 324 325 326 327 328 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | - + - + | if (bTpsCo) { sInfi += " " + this._seekPpas(bPro, bFem, (this._sRawInfo[5] == "r")); } if (bInt) { sInfi += " … ?"; } return sInfi; |
︙ | |||
359 360 361 362 363 364 365 | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | - + | if (bTpsCo) { sPartPre += " " + this._seekPpas(bPro, bFem, this._sRawInfo[5] == "r"); } if (bInt) { sPartPre += " … ?"; } return sPartPre; |
︙ | |||
410 411 412 413 414 415 416 | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 | - + - + | if (bTpsCo) { sConj += " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); } if (bInt) { sConj += " … ?"; } return sConj; |
︙ | |||
456 457 458 459 460 461 462 | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | - + | } else if (bPro) { sImpe = (this.bProWithEn) ? sImpe + conj._dImpeProEn.get(sWho) : sImpe + conj._dImpePro.get(sWho); } if (bTpsCo) { return sImpe + " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); } return sImpe; |
︙ |
Modified gc_lang/fr/modules-js/cregex.js from [6a54cddafc] to [7faa9e5e5e].
︙ | |||
259 260 261 262 263 264 265 | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | - + | mbNprMasNotFem: function (lMorph) { if (lMorph.some(s => this._zNPf.test(s))) { return false; } return lMorph.some(s => this._zNPm.test(s)); } |
︙ |
Modified gc_lang/fr/modules-js/gce_analyseur.js from [973aa5af1d] to [0ad6fe5843].
︙ | |||
71 72 73 74 75 76 77 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - + | } return true; } function isVeryAmbiguousAndWrong (sWord1, sWord2, sReqMorphNA, sReqMorphConj, bLastHopeCond) { //// use it if sWord1 can be also a verb; word2 is assumed to be true via isAmbiguousNAV // We don’t check if word exists in _dAnalyses, for it is assumed it has been done before |
︙ | |||
99 100 101 102 103 104 105 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | - + | return true; } return false; } function checkAgreement (sWord1, sWord2) { // We don’t check if word exists in _dAnalyses, for it is assumed it has been done before |
︙ |
Modified gc_lang/fr/modules-js/lexicographe.js from [cfbfcc7fa9] to [ec41f2c317].
︙ | |||
195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - + | class Lexicographe { constructor (oDict) { this.oDict = oDict; this._zElidedPrefix = new RegExp ("^([dljmtsncç]|quoiqu|lorsqu|jusqu|puisqu|qu)['’](.+)", "i"); this._zCompoundWord = new RegExp ("([a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ]+)-((?:les?|la)-(?:moi|toi|lui|[nv]ous|leur)|t-(?:il|elle|on)|y|en|[mts][’'](?:y|en)|les?|l[aà]|[mt]oi|leur|lui|je|tu|ils?|elles?|on|[nv]ous)$", "i"); this._zTag = new RegExp ("[:;/][a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ*][^:;/]*", "g"); |
︙ | |||
242 243 244 245 246 247 248 | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 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 | - + - + - + | break; } } catch (e) { helpers.logerror(e); } return null; |
Modified gc_lang/fr/modules-js/mfsp.js from [efd19b51da] to [caaf79f7f1].
︙ | |||
84 85 86 87 88 89 90 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + | } } catch (e) { console.log(e); return "## erreur, code : " + sSfx + " ##"; } } |
︙ |
Modified gc_lang/fr/modules-js/phonet.js from [8f4c2c4be2] to [742b1a34db].
︙ | |||
73 74 75 76 77 78 79 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + | if (sMorph.search(sPattern) >= 0) { aSelect.add(sSimil); } } } return aSelect; } |
︙ |
Modified gc_lang/fr/modules-js/textformatter.js from [6dfa91f96e] to [c6e77daf98].
︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | - + - + | const dTFOptions = dTFDefaultOptions.gl_shallowCopy(); class TextFormatter { constructor () { this.sLang = "fr"; |
︙ |