Grammalecte  Check-in [392ae92308]

Overview
Comment:[core][fr] fix getLemmaOfMorph()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fr | core | mtok
Files: files | file ages | folders
SHA3-256: 392ae92308ba27c70b3632b5d45c8dbfb5456dcd21f3a38bf428016de57633cb
User & Date: olr on 2021-03-13 08:07:33
Other Links: branch diff | manifest | tags
Context
2021-03-13
09:53
[core] gc engine: fix morphx() check-in: cb404dd67a user: olr tags: core, mtok
08:07
[core][fr] fix getLemmaOfMorph() check-in: 392ae92308 user: olr tags: fr, core, mtok
2021-03-12
16:49
[build] fix build [fr] remove useless tests check-in: 00bb2f9999 user: olr tags: fr, build, mtok
Changes

Modified gc_lang/fr/modules-js/cregex.js from [c1ba0b4cea] to [2376d50b6d].

78
79
80
81
82
83
84
85





86
87
88
89
90
91
92
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
94
95
96







-
+
+
+
+
+







    _zNPf: new RegExp(":(?:M[12P]|T):f"),
    _zNPe: new RegExp(":(?:M[12P]|T):e"),


    ///// FONCTIONS

    getLemmaOfMorph: function (sMorph) {
        return this._zLemma.exec(sMorph)[1];
        let m = this._zLemma.exec(sMorph);
        if (m) {
            return m[1];
        }
        return "";
    },

    agreement: function (l1, l2) {
        // returns True if agreement in gender and number is possible between morphologies <l1> and <l2>
        let [sGender1, sNumber1] = this.getGenderNumber(l1);
        let [sGender2, sNumber2] = this.getGenderNumber(l2);
        if (sNumber1 !== ":i" && sNumber2 !== ":i" && sNumber1 !== sNumber2) {

Modified gc_lang/fr/modules/cregex.py from [d34aee52e1] to [412242b1dc].

78
79
80
81
82
83
84
85




86
87
88
89
90
91
92
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
94
95







-
+
+
+
+







NPe = re.compile(":(?:M[12P]|T):e")


#### FONCTIONS

def getLemmaOfMorph (s):
    "return lemma in morphology <s>"
    return Lemma.search(s).group(1)
    m = Lemma.search(s)
    if m:
        return m.group(1)
    return ""

def agreement (l1, l2):
    "returns True if agreement in gender and number is possible between morphologies <l1> and <l2>"
    sGender1, sNumber1 = getGenderNumber(l1)
    sGender2, sNumber2 = getGenderNumber(l2)
    if sNumber1 != ":i" and sNumber2 != ":i" and sNumber1 != sNumber2:
        return False