Comment: | [build][core][lo][fx][fr] change data structure for conjugation tool |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | fr | core | build | major_change | fx | lo |
Files: | files | file ages | folders |
SHA3-256: |
a56f46447a36260199b02a46075211c6 |
User & Date: | olr on 2021-02-05 21:07:08 |
Other Links: | manifest | tags |
2021-02-06
| ||
01:52 | [fr] ajustements check-in: 111afef718 user: olr tags: trunk, fr | |
2021-02-05
| ||
21:07 | [build][core][lo][fx][fr] change data structure for conjugation tool check-in: a56f46447a user: olr tags: trunk, fr, core, build, major_change, fx, lo | |
19:41 | [core][fr] fix previous commit check-in: 47944f336f user: olr tags: trunk, fr, core | |
Modified doc/API.txt from [d7c5950527] to [8e533ff8ba].
︙ | |||
45 46 47 48 49 50 51 | 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 77 | + - + - - - - + + + + - + | .isVerb(word) Returns True is word exists in the list of verb (infinite form) .getConj(verb, tense, who) Returns conjugation of verb with subject who at tense (can be an empty string) tense has to be: :Y infinitif :P participe présent |
︙ |
Modified gc_lang/fr/build_data.py from [3eb0f89147] to [94a1ff7b31].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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 | + - - | #!python3 # FRENCH DATA BUILDER # # by Olivier R. # License: MPL 2 import json import os import itertools import traceback import platform import importlib import graphspell.ibdawg as ibdawg from graphspell.echo import echo from graphspell.str_transform import defineSuffixCode import graphspell.tokenizer as tkz |
︙ | |||
70 71 72 73 74 75 76 | 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 | - + - + - + - + + | print("(Python et JavaScript)" if bJS else "(Python seulement)") dVerb = {} lVinfo = []; dVinfo = {}; nVinfo = 0 lTags = []; dTags = {}; nTags = 0 dVerbNames = {} dPatternList = { |
︙ | |||
114 115 116 117 118 119 120 | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | - + | dVerbNames[sLemma] = { sLemma } break elif nTab == 2: # flexion _, sTag, sFlex = sLine.split("\t") if sTag.count(" ") == 0: if sTag == "ppre": |
︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | - + | elif sLine == "$": # we store the dictionary of rules for this lemma if dConj[":Ip"][":1ś"] == "2è": dConj[":Ip"][":1ś"] = "2é" elif sLemma == "pouvoir": dConj[":Ip"][":1ś"] = "6uis" lConjTags = [] |
︙ | |||
285 286 287 288 289 290 291 292 293 294 295 296 297 298 | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | + + | def makePhonetTable (sp, bJS=False): print("> Correspondances phonétiques ", end="") print("(Python et JavaScript)" if bJS else "(Python seulement)") loadDictionary() conj = importlib.import_module("gc_lang.fr.modules.conj") # set of homophonic words lSet = [] for sLine in readFile(sp+"/data/phonet_simil.txt"): lWord = sLine.split() for sWord in lWord: if sWord.endswith("er") and conj.isVerb(sWord): lWord.extend(conj.getConjSimilInfiV1(sWord)) |
︙ | |||
376 377 378 379 380 381 382 | 378 379 380 381 382 383 384 385 386 387 | - - + + | print("========== Build Hunspell dictionaries ==========") makeDictionaries(spLaunch, dVars['oxt_version']) def after (spLaunch, dVars, bJS=False): print("========== Build French data ==========") makeMfsp(spLaunch, bJS) |
Modified gc_lang/fr/modules-js/conj.js from [fd6082c64b] to [0c226f31fc].
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + | _dImpePro: new Map ([ [":2s", "-toi"], [":1p", "-nous"], [":2p", "-vous"] ]), _dImpeProNeg: new Map ([ [":2s", "ne te "], [":1p", "ne nous "], [":2p", "ne vous "] ]), _dImpeProEn: new Map ([ [":2s", "-t’en"], [":1p", "-nous-en"], [":2p", "-vous-en"] ]), _dImpeProNegEn: new Map ([ [":2s", "ne t’en "], [":1p", "ne nous en "], [":2p", "ne vous en "] ]), _dGroup: new Map ([ ["0", "auxiliaire"], ["1", "1ᵉʳ groupe"], ["2", "2ᵉ groupe"], ["3", "3ᵉ groupe"] ]), |
︙ | |||
100 101 102 103 104 105 106 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | - - - + + + - - + + - - + + | if (this._dVerbNames.hasOwnProperty(sVerb)) { // there are names derivated from the verb return this._dVerbNames[sVerb]; } else { // we suggest past participles let tTags = this._getTags(sVerb); if (tTags) { |
︙ | |||
210 211 212 213 214 215 216 | 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 | - + - + - - - - + + + + | } else { this.sProLabel = "# erreur #"; this.nPronominable = -1; } this.dConj = new Map ([ [":Y", new Map ([ ["label", "Infinitif"], |
︙ | |||
357 358 359 360 361 362 363 | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | - + - + - + | } participePasse (sWho) { return this.dConj.get(":Q").get(sWho); } participePresent (bPro, bNeg, bTpsCo, bInt, bFem) { |
︙ | |||
488 489 490 491 492 493 494 | 488 489 490 491 492 493 494 495 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 | - + - + - + - + - - - - + + + + | return sImpe + " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); } return sImpe; } _seekPpas (bPro, bFem, bPlur) { if (!bPro && this.sVerbAux == "avoir") { |
︙ |
Modified gc_lang/fr/modules-js/conj_data.json from [47ac86593a] to [d7e47e8b98].
cannot compute difference between binary files
Modified gc_lang/fr/modules-js/gce_suggestions.js from [e713e67341] to [dddc903a64].
︙ | |||
97 98 99 100 101 102 103 | 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 | - - - - + + + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - + | function suggVerbPpas (sFlex, sWhat=null) { let aSugg = new Set(); for (let sStem of gc_engine.oSpellChecker.getLemma(sFlex)) { let tTags = conj._getTags(sStem); if (tTags) { if (!sWhat) { |
︙ | |||
168 169 170 171 172 173 174 | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + | if (conj.hasConj(sStem, sTense, sWho)) { aSugg.add(conj.getConj(sStem, sTense, sWho)); } } } else { for (let [sTense, ] of lTenses) { |
︙ | |||
354 355 356 357 358 359 360 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | - + - + | if (mfsp.isMasForm(sStem)) { aSugg.add(sStem); } } } else { // a verb let sVerb = cregex.getLemmaOfMorph(sMorph); |
︙ | |||
390 391 392 393 394 395 396 | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | - - - - + + + + | if (mfsp.isMasForm(sStem)) { aSugg.add(suggPlur(sStem, true)); } } } else { // a verb let sVerb = cregex.getLemmaOfMorph(sMorph); |
︙ | |||
431 432 433 434 435 436 437 | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | - - + + | if (mfsp.isMasForm(sStem)) { mfsp.getFemForm(sStem, false).forEach(function(x) { aSugg.add(x); }); } } } else { // a verb let sVerb = cregex.getLemmaOfMorph(sMorph); |
︙ | |||
465 466 467 468 469 470 471 | 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - - + + | if (mfsp.isMasForm(sStem)) { mfsp.getFemForm(sStem, true).forEach(function(x) { aSugg.add(x); }); } } } else { // a verb let sVerb = cregex.getLemmaOfMorph(sMorph); |
︙ | |||
558 559 560 561 562 563 564 | 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 | - + - + | return oTokenDst["sValue"]; } return ""; } function hasFemForm (sFlex) { for (let sStem of gc_engine.oSpellChecker.getLemma(sFlex)) { |
︙ |
Modified gc_lang/fr/modules-js/phonet_data.json from [670718f9b4] to [b360af44eb].
cannot compute difference between binary files
Modified gc_lang/fr/modules/conj.py from [af72bab83b] to [bb0326be30].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | _dImpePro = { ":2s": "-toi", ":1p": "-nous", ":2p": "-vous" } _dImpeProNeg = { ":2s": "ne te ", ":1p": "ne nous ", ":2p": "ne vous " } _dImpeProEn = { ":2s": "-t’en", ":1p": "-nous-en", ":2p": "-vous-en" } _dImpeProNegEn = { ":2s": "ne t’en ", ":1p": "ne nous en ", ":2p": "ne vous en " } _dGroup = { "0": "auxiliaire", "1": "1ᵉʳ groupe", "2": "2ᵉ groupe", "3": "3ᵉ groupe" } |
︙ | |||
67 68 69 70 71 72 73 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - - - - - - - + + + + + + + | if sVerb in _dVerbNames: # there are names derivated from the verb return list(_dVerbNames[sVerb]) else: # we suggest past participles tTags = _getTags(sVerb) if tTags: |
︙ | |||
176 177 178 179 180 181 182 | 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 | - + - + - - - - + + + + | self.nPronominable = 2 else: self.sProLabel = "# erreur #" self.nPronominable = -1 self.dConj = { ":Y": { "label": "Infinitif", |
︙ | |||
329 330 331 332 333 334 335 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | - + - + - + | except KeyError: traceback.print_exc() return "# erreur" def participePresent (self, bPro, bNeg, bTpsCo, bInt, bFem): "returns string (conjugaison du participe présent)" try: |
︙ | |||
447 448 449 450 451 452 453 | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | - + - + - - + + - - - - + + + + | except (KeyError, TypeError, IndexError): traceback.print_exc() return "# erreur" def _seekPpas (self, bPro, bFem, bPlur): try: if not bPro and self.sVerbAux == "avoir": |
︙ |
Modified gc_lang/fr/modules/conj_data.py from [f52d7dbb37] to [f86856f4a3].
cannot compute difference between binary files
Modified gc_lang/fr/modules/gce_suggestions.py from [26290c5dd1] to [fdf32f5da9].
︙ | |||
71 72 73 74 75 76 77 | 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 | - - - - + + + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - - + + - + | def suggVerbPpas (sFlex, sPattern=None): "suggest past participles for <sFlex>" dSugg = {} for sStem in _oSpellChecker.getLemma(sFlex): tTags = conj._getTags(sStem) if tTags: if not sPattern: |
︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - + | lTenses = [ m.group(0) for m in re.finditer(":(?:Y|I[pqsf]|S[pq]|K|P)", sMorph) ] if sWho: for sTense in lTenses: if conj.hasConj(sStem, sTense, sWho): dSugg[conj.getConj(sStem, sTense, sWho)] = "" else: for sTense in lTenses: |
︙ | |||
267 268 269 270 271 272 273 | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | - + - + | else: sStem = cr.getLemmaOfMorph(sMorph) if mfsp.isMasForm(sStem): dSugg[sStem] = "" else: # a verb sVerb = cr.getLemmaOfMorph(sMorph) |
︙ | |||
294 295 296 297 298 299 300 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | - - - - + + + + | else: sStem = cr.getLemmaOfMorph(sMorph) if mfsp.isMasForm(sStem): dSugg[suggPlur(sStem, True)] = "" else: # a verb sVerb = cr.getLemmaOfMorph(sMorph) |
︙ | |||
324 325 326 327 328 329 330 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - - + + | else: sStem = cr.getLemmaOfMorph(sMorph) if mfsp.isMasForm(sStem): dSugg.update(dict.fromkeys(mfsp.getFemForm(sStem, False), "")) else: # a verb sVerb = cr.getLemmaOfMorph(sMorph) |
︙ | |||
349 350 351 352 353 354 355 | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | - - + + | else: sStem = cr.getLemmaOfMorph(sMorph) if mfsp.isMasForm(sStem): dSugg.update(dict.fromkeys(mfsp.getFemForm(sStem, True))) else: # a verb sVerb = cr.getLemmaOfMorph(sMorph) |
︙ | |||
416 417 418 419 420 421 422 | 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | - + - + | return dTokenDst["sValue"] return "" def hasFemForm (sFlex): "return True if there is a feminine form of <sFlex>" for sStem in _oSpellChecker.getLemma(sFlex): |
︙ |
Modified gc_lang/fr/modules/phonet_data.py from [5f1637f274] to [0784da10ed].
cannot compute difference between binary files
Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [28c9952b1e] to [eb9da137a5].
︙ | |||
556 557 558 559 560 561 562 | 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | - - - - + + + + - - - + + + - + | for sTag1, dFlex in oVerb.dConj.items(): if sTag1 != ":Q": for sTag2, sConj in dFlex.items(): if sTag2.startswith(":") and sConj: self.lGeneratedFlex.append((sConj, ":V" + oVerb.cGroup + "_" + sVerbTag + sTag1 + sTag2)) else: # participes passés |
︙ |
Modified gc_lang/fr/oxt/Dictionnaires/dictionaries/README_dict_fr.txt from [9b7087f211] to [a680cb95fb].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | _______________________________________________________________________________ DICTIONNAIRES ORTHOGRAPHIQUES FRANÇAIS |
︙ |
Modified gc_lang/fr/oxt/Dictionnaires/dictionaries/fr-classique.aff from [cfa2723c07] to [660ccbc5b3].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
︙ |
Modified gc_lang/fr/oxt/Dictionnaires/dictionaries/fr-reforme1990.aff from [520df6672c] to [4b9d5873a2].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
︙ |
Modified gc_lang/fr/oxt/Dictionnaires/dictionaries/fr-toutesvariantes.aff from [6ec4d6396a] to [6e3a94ad8b].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
︙ |
Modified gc_lang/fr/rules.grx from [c8824c64d1] to [70dea3980f].
︙ | |||
7119 7120 7121 7122 7123 7124 7125 | 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 | - + | TEST: {{acculé au pied du mur}} ->> acculé TEST: {{ajouter en plus}} ->> ajouter TEST: s’avérer {{vrai}} ->> exact TEST: {{contraint malgré lui}} ->> contraint TEST: {{contraindre malgré eux}} ->> contraindre TEST: {{applaudir des deux mains}} ->> applaudir TEST: {{Avancer en avant}}, pas le choix ->> Avancer |
︙ | |||
8405 8406 8407 8408 8409 8410 8411 | 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 | - + - + - + | TEST: comme des nuages ou des coteaux se reflétant dans l’eau (ligature fl) TEST: ces hommes qui avaient abusé de lui enfant. __conf_en_participes_présents__ en [ne|me|m’|te|t’|s’] @:[123][sp]¬:[PY] <<- /conf/ not \1.isupper() >>> |
︙ |
Modified gc_lang/fr/webext/panel/lex_editor.js from [ffa654539b] to [a73ece9f08].
︙ | |||
429 430 431 432 433 434 435 | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | - - - - + + + + - + - - + + - + | for (let [sTag2, sConj] of dFlex.entries()) { if (sTag2.startsWith(":") && sConj !== "") { this.lFlexion.push([sConj, ":V" + oVerb.cGroup + "_" + sVerbTag + sTag1 + sTag2]); } } } else { // participes passés |
︙ |
Modified lexicons/French.lex from [c776de0a50] to [044ca17631].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
︙ |