Grammalecte  Diff

Differences From Artifact [305b9fc724]:

To Artifact [a345135237]:


544
545
546
547
548
549
550
551

552

















553
554
555
556
557
558
559
560
            console.error(e);
        }
    },


    // Other functions

    filterSugg: function (aSugg) {

        return aSugg.filter((sSugg) => { return !sSugg.endsWith("è") && !sSugg.endsWith("È"); });

















    }
}



if (typeof(exports) !== 'undefined') {
    exports.lexgraph_fr = lexgraph_fr;
}







|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
            console.error(e);
        }
    },


    // Other functions

    isValidSugg: function (sSugg, oSpellChecker) {
        "return True if <sSugg> is valid"
        if (sSugg.endsWith("è") || sSugg.endsWith("È")) {
            return false;
        }
        if (sSugg.includes("’")) {
            if (sSugg.search(/^[dD]’/) == 0 && !oSpellChecker.morph(sSugg.slice(2), ":[YNAW]")) {
                return false;
            }
            if (sSugg.search(/^[nmtsNMTS]’/) == 0 && !oSpellChecker.morph(sSugg.slice(2), ":V")) {
                return false;
            }
            if (sSugg.search(/^[jJ]’/) == 0 && !oSpellChecker.morph(sSugg.slice(2), ":(?:Y|[123][sp])")) {
                return false;
            }
            if (sSugg.search(/^[cçCÇ]’/) == 0  && !oSpellChecker.morph(sSugg.slice(2), ":3[sp]")) {
                return false;
            }
        }
        return true;
    }
}



if (typeof(exports) !== 'undefined') {
    exports.lexgraph_fr = lexgraph_fr;
}