Changes In Branch multid Through [5dc606a9bd] Excluding Merge-Ins
This is equivalent to a diff from 62c389aedf to 5dc606a9bd
2018-02-16
| ||
15:46 | [fx][graphspell] merge multid: multi-dictionaries > editable personal dictionary check-in: 607d532bca user: olr tags: trunk, new_feature, fx, graphspell | |
2018-02-13
| ||
18:34 | [graphspell] add space in comments check-in: 6a6c2f6878 user: olr tags: graphspell, multid | |
16:57 | [graphspell][py][bug] ibdawg: fix dictionary of chars check-in: 5dc606a9bd user: olr tags: graphspell, multid | |
16:05 | [graphspell][py] drawPath() for spellchecker check-in: ad736fa52b user: olr tags: graphspell, multid | |
13:39 | [core][js] multi-dictionaries check-in: d8959f76a4 user: olr tags: core, multid | |
13:38 | [graphspell][js] rename vars check-in: 62c389aedf user: olr tags: trunk, graphspell | |
10:47 | [graphspell][js] spellchecker wrapper for ibdawg check-in: c989c20101 user: olr tags: trunk, graphspell | |
Modified compile_rules.py from [7fa2e820bf] to [9bd1433006].
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + | s = re.sub(r"textarea0\(\s*", 'look(sx, ', s) # textarea0(s) s = re.sub(r"before0_chk1\(\s*", 'look_chk1(dDA, sx[:m.start()], 0, ', s) # before0_chk1(s) s = re.sub(r"after0_chk1\(\s*", 'look_chk1(dDA, sx[m.end():], m.end(), ', s) # after0_chk1(s) s = re.sub(r"textarea0_chk1\(\s*", 'look_chk1(dDA, sx, 0, ', s) # textarea0_chk1(s) s = re.sub(r"isEndOfNG\(\s*\)", 'isEndOfNG(dDA, s[m.end():], m.end())', s) # isEndOfNG(s) s = re.sub(r"isNextNotCOD\(\s*\)", 'isNextNotCOD(dDA, s[m.end():], m.end())', s) # isNextNotCOD(s) s = re.sub(r"isNextVerb\(\s*\)", 'isNextVerb(dDA, s[m.end():], m.end())', s) # isNextVerb(s) |
︙ |
Modified gc_core/js/lang_core/gc_engine.js from [2f5e964b5d] to [454f9a423d].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - + | } // data let _sAppContext = ""; // what software is running let _dOptions = null; let _aIgnoredRules = new Set(); |
︙ | |||
318 319 320 321 322 323 324 | 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 | - - + + - + - - + + | }, //// Initialization load: function (sContext="JavaScript", sPath="") { try { if (typeof(require) !== 'undefined') { |
︙ | |||
386 387 388 389 390 391 392 | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | - - - + + + | helpers.echo("DA: " + dDA.get(aWord[0])); } helpers.echo("FSA: " + _dAnalyses.get(aWord[1])); return true; } function _storeMorphFromFSA (sWord) { |
︙ | |||
640 641 642 643 644 645 646 | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | - + | exports._rewrite = gc_engine._rewrite; exports.ignoreRule = gc_engine.ignoreRule; exports.resetIgnoreRules = gc_engine.resetIgnoreRules; exports.reactivateRule = gc_engine.reactivateRule; exports.listRules = gc_engine.listRules; exports._getRules = gc_engine._getRules; exports.load = gc_engine.load; |
Modified gc_core/py/lang_core/gc_engine.py from [9fc11201d4] to [eded256052].
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 | - + - + - + | # Grammalecte # Grammar checker engine import re import sys import os import traceback #import unicodedata from itertools import chain |
︙ | |||
284 285 286 287 288 289 290 | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | - + - + | #import lightproof_handler_${implname} as opt _createError = _createWriterError except ImportError: _createError = _createDictError def load (sContext="Python"): |
︙ | |||
329 330 331 332 333 334 335 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | - - + + | def resetOptions (): global _dOptions _dOptions = dict(gc_options.getOptions(_sAppContext)) |
︙ | |||
394 395 396 397 398 399 400 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - + - + | if tWord[0] in dDA: echo("DA: " + str(dDA[tWord[0]])) echo("FSA: " + str(_dAnalyses[tWord[1]])) return True def _storeMorphFromFSA (sWord): |
︙ |
Modified gc_lang/fr/modules-js/gce_suggestions.js from [d955978cbc] to [0c31bc1a27].
︙ | |||
206 207 208 209 210 211 212 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | - + - + - + - + - + - + - + | } else if (sGender == ":f") { return suggFemPlur(sFlex); } } let aSugg = new Set(); if (!sFlex.includes("-")) { if (sFlex.endsWith("l")) { |
︙ |
Modified gc_lang/fr/modules-js/lexicographe.js from [be510450a4] to [e3263a5103].
︙ | |||
222 223 224 225 226 227 228 | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - - + + | ['<', "inférieur à"], ['>', "supérieur à"], ]); class Lexicographe { |
︙ | |||
337 338 339 340 341 342 343 | 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | - + | sValue: oToken.sValue, aLabel: ["forme verbale interrogative"], aSubElem: [ { sType: oToken.sType, sValue: m[1], aLabel: this._getMorph(m[1]) }, { sType: oToken.sType, sValue: "-" + m[2], aLabel: [this._formatSuffix(m[2].toLowerCase())] } ] }; |
︙ | |||
360 361 362 363 364 365 366 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | - + | helpers.logerror(e); } return null; } _getMorph (sWord) { let aElem = []; |
︙ |
Modified gc_lang/fr/modules/gce_suggestions.py from [50fbeb414d] to [79835965e4].
︙ | |||
155 156 157 158 159 160 161 | 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | - + - + - + - + - + - + - + | if sGender == ":m": return suggMasPlur(sFlex) elif sGender == ":f": return suggFemPlur(sFlex) aSugg = set() if "-" not in sFlex: if sFlex.endswith("l"): |
︙ |
Modified gc_lang/fr/modules/lexicographe.py from [7b36598d08] to [75ede82f17].
︙ | |||
153 154 155 156 157 158 159 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - - + + | "t'en": " (te) pronom personnel objet + (en) pronom adverbial", "s'en": " (se) pronom personnel objet + (en) pronom adverbial", } class Lexicographe: |
︙ | |||
179 180 181 182 183 184 185 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - + | sWord = m.group(2) aMorph.append( "{}’ : {}".format(m.group(1), _dPFX.get(m.group(1).lower(), "[?]")) ) # mots composés m2 = self._zCompoundWord.match(sWord) if m2: sWord = m2.group(1) # Morphologies |
︙ |
Modified gc_lang/fr/webext/gce_worker.js from [2a64cce6de] to [fb2b2e5711].
︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + | //console.log("[Worker] GC Engine Worker [start]"); //console.log(self); importScripts("grammalecte/graphspell/helpers.js"); importScripts("grammalecte/graphspell/str_transform.js"); importScripts("grammalecte/graphspell/char_player.js"); importScripts("grammalecte/graphspell/ibdawg.js"); importScripts("grammalecte/graphspell/spellchecker.js"); importScripts("grammalecte/text.js"); importScripts("grammalecte/graphspell/tokenizer.js"); importScripts("grammalecte/fr/conj.js"); importScripts("grammalecte/fr/mfsp.js"); importScripts("grammalecte/fr/phonet.js"); importScripts("grammalecte/fr/cregex.js"); importScripts("grammalecte/fr/gc_options.js"); |
︙ | |||
132 133 134 135 136 137 138 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | } } let bInitDone = false; |
︙ | |||
157 158 159 160 161 162 163 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | - + - + | if (!bInitDone) { //console.log("[Worker] Loading… Extension path: " + sExtensionPath); conj.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/conj_data.json")); phonet.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/phonet_data.json")); mfsp.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/mfsp_data.json")); //console.log("[Worker] Modules have been initialized…"); gc_engine.load(sContext, sExtensionPath+"grammalecte/graphspell/_dictionaries"); |
︙ | |||
196 197 198 199 200 201 202 | 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 | - + - + | } function parseAndSpellcheck (sText, sCountry, bDebug, bContext, dInfo={}) { let i = 0; sText = sText.replace(//g, "").normalize("NFC"); for (let sParagraph of text.getParagraph(sText)) { let aGrammErr = gc_engine.parse(sParagraph, sCountry, bDebug, bContext); |
︙ | |||
287 288 289 290 291 292 293 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | - + + - - + + + + | postMessage(createResponse("fullTests", sMsg, dInfo, true)); } // Spellchecker function getSpellSuggestions (sWord, dInfo) { |
︙ |
Modified grammalecte-cli.py from [07800caa2b] to [d66b04b565].
︙ | |||
40 41 42 43 44 45 46 | 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 65 66 67 68 69 70 71 72 73 74 75 76 | - + - + - + + + - - + + - - + + | if sys.platform == "win32": # Apparently, the console transforms «’» in «'». # So we reverse it to avoid many useless warnings. sText = sText.replace("'", "’") return sText |
︙ | |||
126 127 128 129 130 131 132 | 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 | - + - + - - - - - - + + + + + + | xParser.add_argument("-roff", "--rule_off", nargs="+", help="deactivate rules") xParser.add_argument("-d", "--debug", help="debugging mode (only in interactive mode)", action="store_true") xArgs = xParser.parse_args() gce.load() if not xArgs.json: echo("Grammalecte v{}".format(gce.version)) |
︙ | |||
177 178 179 180 181 182 183 | 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 229 230 231 232 233 234 235 236 237 238 239 | - + - + - + - + - + - - + + - + - + | for i, sText in enumerate(readfile(sFile), 1): if xArgs.textformatter or xArgs.textformatteronly: sText = oTF.formatText(sText) if xArgs.textformatteronly: output(sText, hDst) else: if xArgs.json: |
︙ | |||
262 263 264 265 266 267 268 | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - + | elif sText.startswith("/rl"): # reload (todo) pass else: for sParagraph in txt.getParagraph(sText): if xArgs.textformatter: sText = oTF.formatText(sText) |
Modified grammalecte-server.py from [6dbdf10c60] to [3253a2b2ff].
︙ | |||
125 126 127 128 129 130 131 | 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 | - + - + - + | def genUserId (): i = 0 while True: yield str(i) i += 1 |
︙ | |||
195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - + | dOptions.update(json.loads(request.forms.options)) except: sError = "request options not used" sJSON = '{ "program": "grammalecte-fr", "version": "'+gce.version+'", "lang": "'+gce.lang+'", "error": "'+sError+'", "data" : [\n' for i, sText in enumerate(txt.getParagraph(request.forms.text), 1): if bTF: sText = oTF.formatText(sText) |
︙ |
Modified graphspell-js/ibdawg.js from [cea88b04de] to [508f46740c].
︙ | |||
85 86 87 88 89 90 91 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | - - + | // 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") { |
︙ |
Modified graphspell-js/spellchecker.js from [ee0b03faf8] to [cfdad9918e].
︙ | |||
21 22 23 24 25 26 27 | 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 58 59 60 61 62 63 64 | - + - + - - - + - - + - - - + + + - | const dDefaultDictionaries = new Map([ ["fr", "fr.json"], ["en", "en.json"] ]); |
︙ | |||
95 96 97 98 99 100 101 | 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 | - + - + - + - + - + - + - + - + - + | return true; } return false; } isValid (sWord) { // checks if sWord is valid (different casing tested if the first letter is a capital) |
︙ |
Modified graphspell-js/tokenizer.js from [d6429837c4] to [c3f0ee8c90].
︙ | |||
84 85 86 87 88 89 90 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - + - + | } } i += nCut; sText = sText.slice(nCut); } } |
︙ |
Modified graphspell/ibdawg.py from [6527ad55bf] to [3bf18d8144].
︙ | |||
160 161 162 163 164 165 166 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - + | self.nNode = int(l.pop(0)) self.nArc = int(l.pop(0)) self.nAff = int(l.pop(0)) self.cStemming = l.pop(0) self.nTag = self.nArcVal - self.nChar - self.nAff # <dChar> to get the value of an arc, <dCharVal> to get the char of an arc with its value self.dChar = {} |
︙ |
Modified graphspell/spellchecker.py from [19c7dd4df2] to [17be6ccea2].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + - | dDefaultDictionaries = { "fr": "fr.bdic", "en": "en.bdic" } |
︙ | |||
68 69 70 71 72 73 74 | 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 | - + - + - + - + - + - + - + - + - + + + + + + + + + + | return True if self.oPersonalDic and self.oPersonalDic.isValidToken(sToken): return True return False def isValid (self, sWord): "checks if sWord is valid (different casing tested if the first letter is a capital)" |