Grammalecte  Check-in [3cd9cfbedf]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[core][fr] fix suggestions in suggSing(): check flexion and returns it if nothing found
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr | core
Files: files | file ages | folders
SHA3-256:3cd9cfbedfbdd222730b32f31b6de57b0b94ef20b982d5ffa4e6e4bdb5f314ab
User & Date: olr 2019-09-20 09:29:39
Context
2019-09-20
14:12
[fr] ajustements (couleurs), nr: conditionnels check-in: c01c145f51 user: olr tags: fr, trunk
09:29
[core][fr] fix suggestions in suggSing(): check flexion and returns it if nothing found check-in: 3cd9cfbedf user: olr tags: core, fr, trunk
09:28
[fr] couleurs: ajustements check-in: 15259ba400 user: olr tags: fr, trunk
Changes

Changes to gc_lang/fr/modules-js/gce_suggestions.js.

271
272
273
274
275
276
277

278







279
280
281
282

283
284

285
286
287
288
289
290
291
        if (_oSpellChecker.isValid(sFlex.slice(0,-2)+"l")) {
            aSugg.add(sFlex.slice(0,-2)+"l");
        }
        if (_oSpellChecker.isValid(sFlex.slice(0,-2)+"il")) {
            aSugg.add(sFlex.slice(0,-2)+"il");
        }
    }

    if (_oSpellChecker.isValid(sFlex.slice(0,-1))) {







        aSugg.add(sFlex.slice(0,-1));
    }
    if (aSugg.size > 0) {
        return Array.from(aSugg).join("|");

    }
    return "";

}

function suggMasSing (sFlex, bSuggSimil=false) {
    // returns masculine singular forms
    let aSugg = new Set();
    for (let sMorph of _oSpellChecker.getMorph(sFlex)) {
        if (!sMorph.includes(":V")) {







>
|
>
>
>
>
>
>
>


|
<
>

<
>







271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

290
291

292
293
294
295
296
297
298
299
        if (_oSpellChecker.isValid(sFlex.slice(0,-2)+"l")) {
            aSugg.add(sFlex.slice(0,-2)+"l");
        }
        if (_oSpellChecker.isValid(sFlex.slice(0,-2)+"il")) {
            aSugg.add(sFlex.slice(0,-2)+"il");
        }
    }
    if (sFlex.endsWith("UX")) {
        if (_oSpellChecker.isValid(sFlex.slice(0,-2)+"L")) {
            aSugg.add(sFlex.slice(0,-2)+"L");
        }
        if (_oSpellChecker.isValid(sFlex.slice(0,-2)+"IL")) {
            aSugg.add(sFlex.slice(0,-2)+"IL");
        }
    }
    if ((sFlex.endsWith("s") || sFlex.endsWith("x") || sFlex.endsWith("S") || sFlex.endsWith("X")) && _oSpellChecker.isValid(sFlex.slice(0,-1))) {
        aSugg.add(sFlex.slice(0,-1));
    }
    if (aSugg.size == 0) {

        aSugg.add(sFlex);
    }

    return Array.from(aSugg).join("|");
}

function suggMasSing (sFlex, bSuggSimil=false) {
    // returns masculine singular forms
    let aSugg = new Set();
    for (let sMorph of _oSpellChecker.getMorph(sFlex)) {
        if (!sMorph.includes(":V")) {

Changes to gc_lang/fr/modules/gce_suggestions.py.

204
205
206
207
208
209
210

211




212
213

214
215
216
217
218
219
220
221
222
    "returns singular forms assuming sFlex is plural"
    aSugg = set()
    if sFlex.endswith("ux"):
        if _oSpellChecker.isValid(sFlex[:-2]+"l"):
            aSugg.add(sFlex[:-2]+"l")
        if _oSpellChecker.isValid(sFlex[:-2]+"il"):
            aSugg.add(sFlex[:-2]+"il")

    if _oSpellChecker.isValid(sFlex[:-1]):




        aSugg.add(sFlex[:-1])
    if aSugg:

        return "|".join(aSugg)
    return ""


def suggMasSing (sFlex, bSuggSimil=False):
    "returns masculine singular forms"
    aSugg = set()
    for sMorph in _oSpellChecker.getMorph(sFlex):
        if not ":V" in sMorph:







>
|
>
>
>
>

|
>
|
<







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220

221
222
223
224
225
226
227
    "returns singular forms assuming sFlex is plural"
    aSugg = set()
    if sFlex.endswith("ux"):
        if _oSpellChecker.isValid(sFlex[:-2]+"l"):
            aSugg.add(sFlex[:-2]+"l")
        if _oSpellChecker.isValid(sFlex[:-2]+"il"):
            aSugg.add(sFlex[:-2]+"il")
    if sFlex.endswith("UX"):
        if _oSpellChecker.isValid(sFlex[:-2]+"L"):
            aSugg.add(sFlex[:-2]+"L")
        if _oSpellChecker.isValid(sFlex[:-2]+"IL"):
            aSugg.add(sFlex[:-2]+"IL")
    if sFlex.endswith(("s", "x", "S", "X")) and _oSpellChecker.isValid(sFlex[:-1]):
        aSugg.add(sFlex[:-1])
    if not aSugg:
        aSugg.add(sFlex)
    return "|".join(aSugg)



def suggMasSing (sFlex, bSuggSimil=False):
    "returns masculine singular forms"
    aSugg = set()
    for sMorph in _oSpellChecker.getMorph(sFlex):
        if not ":V" in sMorph: