Overview
Comment: | [core][cli][server][graphspell][fx] use spellchecker instead of ibdawg |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | cli | core | server | fx | graphspell | multid |
Files: | files | file ages | folders |
SHA3-256: |
18db5d65f059826efb9bcdcfbdeb7645 |
User & Date: | olr on 2018-02-13 15:44:31 |
Other Links: | branch diff | manifest | tags |
Context
2018-02-13
| ||
15:57 | [cli] suggest() in spellchecker is a generator check-in: 966babe645 user: olr tags: cli, multid | |
15:44 | [core][cli][server][graphspell][fx] use spellchecker instead of ibdawg check-in: 18db5d65f0 user: olr tags: cli, core, server, fx, graphspell, multid | |
14:26 | [core] use spellchecker instead of ibdawg directly check-in: 62304c0cd5 user: olr tags: core, multid | |
Changes
Modified gc_core/js/lang_core/gc_engine.js from [dcb651b444] to [454f9a423d].
︙ | |||
331 332 333 334 335 336 337 | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - + | _dOptions = gc_options.getOptions(sContext).gl_shallowCopy(); // duplication necessary, to be able to reset to default } catch (e) { helpers.logerror(e); } }, |
︙ | |||
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 [e36972dc16] to [eded256052].
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + | from ..graphspell.spellchecker import SpellChecker from ..graphspell.echo import echo from . import gc_options __all__ = [ "lang", "locales", "pkg", "name", "version", "author", \ |
︙ | |||
329 330 331 332 333 334 335 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | - + | def resetOptions (): global _dOptions _dOptions = dict(gc_options.getOptions(_sAppContext)) |
︙ |
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/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 [30916bedcd] to [fb2b2e5711].
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | } } let bInitDone = false; |
︙ | |||
158 159 160 161 162 163 164 | 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"); |
︙ | |||
197 198 199 200 201 202 203 | 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); |
︙ | |||
288 289 290 291 292 293 294 | 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 [93945e25e2].
︙ | |||
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 | - + - + - + - - + + - - + + | 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 | 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 | - + - + - + | 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 | 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 229 230 231 232 233 234 235 236 237 | - + - + - + - + - + - - + + - + - + | 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 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - + | 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/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); } } |
︙ |