Grammalecte  Diff

Differences From Artifact [07c481136a]:

To Artifact [65b854aa07]:


252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
                        let c_n = (document.getElementById("up_v_n").checked) ? "n" : "_";
                        let c_p = (document.getElementById("up_v_p").checked) ? "p" : "_";
                        let c_m = (document.getElementById("up_v_m").checked) ? "m" : "_";
                        let c_ae = (document.getElementById("up_v_ae").checked) ? "e" : "_";
                        let c_aa = (document.getElementById("up_v_aa").checked) ? "a" : "_";
                        let sVerbTag = c_i + c_t + c_n + c_p + c_m + c_ae + c_aa;
                        if (!sVerbTag.endsWith("__") && !sVerbTag.startsWith("____")) {
                            if (sWord.endsWith("ir")) {
                                for (let [nCut, sAdd, sFlexTags] of oConj["V2"]) {
                                    this.addFlexion(sWord.slice(0,-nCut)+sAdd, sWord, ":V" + c_g + "_" + sVerbTag+sFlexTags);
                                }
                            } else {
                                this.addFlexion(sWord, sWord, ":V" + c_g + "_" + sVerbTag+":Y");
                            }
                        }
                        break;
                    }
                    case "W":
                        sWord = sWord.toLowerCase();
                        this.addFlexion(sWord, sWord, ":W");







<
|
|
<
<
<







252
253
254
255
256
257
258

259
260



261
262
263
264
265
266
267
                        let c_n = (document.getElementById("up_v_n").checked) ? "n" : "_";
                        let c_p = (document.getElementById("up_v_p").checked) ? "p" : "_";
                        let c_m = (document.getElementById("up_v_m").checked) ? "m" : "_";
                        let c_ae = (document.getElementById("up_v_ae").checked) ? "e" : "_";
                        let c_aa = (document.getElementById("up_v_aa").checked) ? "a" : "_";
                        let sVerbTag = c_i + c_t + c_n + c_p + c_m + c_ae + c_aa;
                        if (!sVerbTag.endsWith("__") && !sVerbTag.startsWith("____")) {

                            for (let [nCut, sAdd, sFlexTags] of this._getConjRule(sWord)) {
                                this.addFlexion(sWord.slice(0,-nCut)+sAdd, sWord, ":V" + c_g + "_" + sVerbTag+sFlexTags);



                            }
                        }
                        break;
                    }
                    case "W":
                        sWord = sWord.toLowerCase();
                        this.addFlexion(sWord, sWord, ":W");
301
302
303
304
305
306
307




















308
309
310
311
312
313
314
            }
            this.show();
        }
        catch (e) {
            showError(e);
        }
    },





















    getRadioValue: function (sName) {
        if (document.querySelector('input[name="' + sName + '"]:checked')) {
            return document.querySelector('input[name="' + sName + '"]:checked').value;
        }
        return null;
    },







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
            }
            this.show();
        }
        catch (e) {
            showError(e);
        }
    },

    _getConjRule: function (sVerb) {
        if (sVerb.endsWith("ir")) {
            return oConj["V2"];
        } else {
            if (sVerb.slice(-5) in oConj["V1"]) {
                return oConj["V1"][sVerb.slice(-5)];
            }
            if (sVerb.slice(-4) in oConj["V1"]) {
                if (sVerb.endsWith("eler") || sVerb.endsWith("eter")) {
                    return oConj["V1"][sVerb.slice(-4)]["1"];
                }
                return oConj["V1"][sVerb.slice(-4)];
            }
            if (sVerb.slice(-3) in oConj["V1"]) {
                return oConj["V1"][sVerb.slice(-3)];
            }
            return oConj["V1"]["er"];
        }
    },

    getRadioValue: function (sName) {
        if (document.querySelector('input[name="' + sName + '"]:checked')) {
            return document.querySelector('input[name="' + sName + '"]:checked').value;
        }
        return null;
    },
425
426
427
428
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
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
483
484
485
486
487
        browser.downloads.download({ filename: "grammalecte_dictionnaire_personnel.json", url: sURL, saveAs: true });
    }
}


oLexicon.load();
oLexicon.display();


/*
    DATA
*/

const oConj = {
    // deuxième groupe (le seul groupe régulier)
    "V2": [
        [2,     "ir",           ":Y/*"],
        [2,     "issant",       ":P/*"],
        [2,     "is",           ":Ip:Is:1s:2s/*"],
        [2,     "it",           ":Ip:Is:3s/*"],
        [2,     "issons",       ":Ip:1p/*"],
        [2,     "issez",        ":Ip:2p/*"],
        [2,     "issent",       ":Ip:Sp:Sq:3p/*"],
        [2,     "issais",       ":Iq:1s:2s/*"],
        [2,     "issait",       ":Iq:3s/*"],
        [2,     "issions",      ":Iq:Sp:Sq:1p/*"],
        [2,     "issiez",       ":Iq:Sp:Sq:2p/*"],
        [2,     "issaient",     ":Iq:3p/*"],
        [2,     "îmes",         ":Is:1p/*"],
        [2,     "îtes",         ":Is:2p/*"],
        [2,     "irent",        ":Is:3p!/*"],
        [2,     "irai",         ":If:1s/*"],
        [2,     "iras",         ":If:2s/*"],
        [2,     "ira",          ":If:3s/*"],
        [2,     "irons",        ":If:1p/*"],
        [2,     "irez",         ":If:2p/*"],
        [2,     "iront",        ":If:3p!/*"],
        [2,     "irais",        ":K:1s:2s/*"],
        [2,     "irait",        ":K:3s/*"],
        [2,     "irions",       ":K:1p/*"],
        [2,     "iriez",        ":K:2p/*"],
        [2,     "iraient",      ":K:3p/*"],
        [2,     "isse",         ":Sp:Sq:1s/*"],
        [2,     "isses",        ":Sp:Sq:2s/*"],
        [2,     "isse",         ":Sp:3s/*"],
        [2,     "ît",           ":Sq:3s/*"],
        [2,     "is",           ":E:2s/*"],
        [2,     "issons",       ":E:1p/*"],
        [2,     "issez",        ":E:2p/*"],
    ],
    


    // premier groupe
    "V1": {

    },
    "V1ger": {

    }
};









<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
441
442
443
444
445
446
447
























































        browser.downloads.download({ filename: "grammalecte_dictionnaire_personnel.json", url: sURL, saveAs: true });
    }
}


oLexicon.load();
oLexicon.display();