Grammalecte  Check-in [3cd9cfbedf]

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 on 2019-09-20 09:29:39
Other Links: manifest | tags
Context
2019-09-20
14:12
[fr] ajustements (couleurs), nr: conditionnels check-in: c01c145f51 user: olr tags: trunk, fr
09:29
[core][fr] fix suggestions in suggSing(): check flexion and returns it if nothing found check-in: 3cd9cfbedf user: olr tags: trunk, fr, core
09:28
[fr] couleurs: ajustements check-in: 15259ba400 user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/modules-js/gce_suggestions.js from [4cb89b41ff] to [9a89d3203a].

271
272
273
274
275
276
277

278








279
280
281
282


283
284

285
286
287
288
289
290
291
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,-1))) {
        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) {
        return Array.from(aSugg).join("|");
    if (aSugg.size == 0) {
        aSugg.add(sFlex);
    }
    return "";
    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")) {

Modified gc_lang/fr/modules/gce_suggestions.py from [5fdd7f6a17] to [d1d9158ee4].

204
205
206
207
208
209
210

211





212
213
214
215



216
217
218
219
220
221
222
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[:-1]):
        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 aSugg:
        return "|".join(aSugg)
    return ""
    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: