Overview
Comment: | [core][fr] tests suggestions for JS, suggestions update |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | fr | core |
Files: | files | file ages | folders |
SHA3-256: |
fb8de11c89bac99c911f9fa9836a2fa9 |
User & Date: | olr on 2021-01-21 18:04:41 |
Other Links: | manifest | tags |
Context
2021-01-21
| ||
21:12 | [build] nnbsp in py2js() also check-in: b217bc2731 user: olr tags: trunk, build | |
18:04 | [core][fr] tests suggestions for JS, suggestions update check-in: fb8de11c89 user: olr tags: trunk, fr, core | |
10:30 | [fr] ajustements (tests) check-in: 8e7a1e20da user: olr tags: trunk, fr | |
Changes
Modified gc_core/js/tests.js from [5a6c382af8] to [9717be7ff0].
︙ | |||
19 20 21 22 23 24 25 | 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 | - + - + + + + + | this.spfTests = spfTests; this._aRuleTested = new Set(); } * testParse (bDebug=false) { const t0 = Date.now(); let sURL; |
︙ | |||
53 54 55 56 57 58 59 | 57 58 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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 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 | - + - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - | sOption = false; m = zOption.exec(sLine); if (m) { sLine = sLine.slice(sLine.indexOf(" ")+1); sOption = m[1]; } if (sLine.includes("->>")) { |
︙ | |||
128 129 130 131 132 133 134 | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | - - - - + + + + - - - - + - - - - - + + + + - - - - - - + + + - - - + - | } catch (e) { console.error(e); } return " ".repeat(sLine.length); } |
Modified gc_core/py/lang_core/tests_core.py from [f2f8ff9a94] to [335b223b65].
︙ | |||
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | - + - + + + | if not self._checkSuggestions(sExceptedSuggs, sFoundSuggs): print("\n# Line num: " + sLineNum + \ "\n> to check: " + _fuckBackslashUTF8(sTextToCheck) + \ "\n expected: " + sExceptedSuggs + \ "\n found: " + sFoundSuggs + \ "\n errors: \n" + sListErr) nUnexpectedErrors += 1 |
︙ | |||
165 166 167 168 169 170 171 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | - - - + + + | sRes = " " * len(sLine) for i, m in enumerate(self._zError.finditer(sLine)): nStart = m.start() - (4 * i) nEnd = m.end() - (4 * (i+1)) sRes = sRes[:nStart] + "~" * (nEnd - nStart) + sRes[nEnd:-4] return sRes |
︙ |
Modified gc_lang/fr/modules-js/gce_suggestions.js from [916bb2d5db] to [807177b0cf].
︙ | |||
77 78 79 80 81 82 83 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - - + + - + | } return Array.from(aSugg).join("|"); } return ""; } function joinVerbAndSuffix (sFlex, sSfx) { |
︙ | |||
160 161 162 163 164 165 166 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - + - + | function suggVerbFrom (sStem, sFlex, sWho="") { "conjugate <sStem> according to <sFlex> (and eventually <sWho>)" let aSugg = new Set(); for (let sMorph of gc_engine.oSpellChecker.getMorph(sFlex)) { let lTenses = [ ...sMorph.matchAll(/:(?:Y|I[pqsf]|S[pq]|K|P|Q)/g) ]; if (sWho) { |
︙ | |||
221 222 223 224 225 226 227 | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - - - + - + | } const _dQuiEst = new Map ([ ["je", ":1s"], ["j’", ":1s"], ["tu", ":2s"], ["il", ":3s"], ["on", ":3s"], ["elle", ":3s"], ["iel", ":3s"], ["nous", ":1p"], ["vous", ":2p"], ["ils", ":3p"], ["elles", ":3p"], ["iels", ":3p"] ]); |
︙ | |||
255 256 257 258 259 260 261 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | - + - - - - - - - - - - - - | return Array.from(aSugg).join("|"); } return ""; } //// Nouns and adjectives |
︙ | |||
295 296 297 298 299 300 301 | 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | - + - + - + | aSugg.add(sFlex+"s"); } if (gc_engine.oSpellChecker.isValid(sFlex+"x")) { aSugg.add(sFlex+"x"); } } else { if (gc_engine.oSpellChecker.isValid(sFlex+"S")) { |
︙ | |||
393 394 395 396 397 398 399 | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | - + | if (!sMorph.includes(":V")) { // not a verb if (sMorph.includes(":m") || sMorph.includes(":e")) { aSugg.add(suggPlur(sFlex)); } else { let sStem = cregex.getLemmaOfMorph(sMorph); if (mfsp.isMasForm(sStem)) { |
︙ |
Modified gc_lang/fr/modules/gce_suggestions.py from [af90e8e3f3] to [8bef0dbc3f].
︙ | |||
166 167 168 169 170 171 172 | 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 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 | - - - + - + - + - - - - - - - - - - + - + | def suggVerbInfi (sFlex): "returns infinitive forms of <sFlex>" return "|".join([ sStem for sStem in _oSpellChecker.getLemma(sFlex) if conj.isVerb(sStem) ]) _dQuiEst = { "je": ":1s", "j’": ":1s", "tu": ":2s", "il": ":3s", "on": ":3s", "elle": ":3s", "iel": ":3s", \ "nous": ":1p", "vous": ":2p", "ils": ":3p", "elles": ":3p", "iels": ":3p" } |
︙ | |||
298 299 300 301 302 303 304 | 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | - + | if not ":V" in sMorph: # not a verb if ":m" in sMorph or ":e" in sMorph: aSugg.add(suggPlur(sFlex)) else: sStem = cr.getLemmaOfMorph(sMorph) if mfsp.isMasForm(sStem): |
︙ |
Modified gc_lang/fr/rules.grx from [aeba1ed251] to [6130f02351].
︙ | |||
2577 2578 2579 2580 2581 2582 2583 | 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 | - + | TEST: {{Prend-lui}} le pouls. ->> Prends-lui|Prenons-lui|Prenez-lui TEST: {{apport-lui}}. ->> TEST: {{Expliques-leur}} comment faire. ->> Explique-leur|Expliquons-leur|Expliquez-leur TEST: {{fou-leur}} la paix ->> fous-leur TEST: {{explique-leurs}} de quoi il est question. ->> explique-leur TEST: {{calcul-leurs}} ça. ->> calcul-leur TEST: {{aller-y}} ->> allez-y|vas-y|allons-y |
︙ | |||
6883 6884 6885 6886 6887 6888 6889 | 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 | - + | avenir devant [moi|toi|soi|lui|elle|nous|vous|eux|elles] <<- /pleo/ morph(<1, ":A.*:[me]:[si]") ->> avenir && Pléonasme. >coup de foudre [immédiat+s|instantané+ses|soudain] <<- /pleo/ ->> \1 \2 \3 && Pléonasme. [paire+s] de >jumeau |
︙ |