Grammalecte  Check-in [c72fda69d9]

Overview
Comment:[core][fr] suggestions for uppercase words
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr | core
Files: files | file ages | folders
SHA3-256: c72fda69d9c45397134571246318ebcde1bd1ccac380a0c7ec72fe34559dfe5c
User & Date: olr on 2020-05-06 16:08:24
Other Links: manifest | tags
Context
2020-05-06
18:46
[fr] ajustements et faux positifs, URL -> https check-in: 9954475e75 user: olr tags: fr, trunk
16:08
[core][fr] suggestions for uppercase words check-in: c72fda69d9 user: olr tags: core, fr, trunk
15:57
[core] uppercase suggestion for upeercase token check-in: c0835edd62 user: olr tags: core, trunk
Changes

Modified gc_lang/fr/modules-js/gce_suggestions.js from [de44ba5567] to [54549da722].

   253    253           if (sFlex.endsWith("AL") && sFlex.length > 2 && _oSpellChecker.isValid(sFlex.slice(0,-1)+"UX")) {
   254    254               aSugg.add(sFlex.slice(0,-1)+"UX");
   255    255           }
   256    256           if (sFlex.endsWith("AIL") && sFlex.length > 3 && _oSpellChecker.isValid(sFlex.slice(0,-2)+"UX")) {
   257    257               aSugg.add(sFlex.slice(0,-2)+"UX");
   258    258           }
   259    259       }
   260         -    if (_oSpellChecker.isValid(sFlex+"s")) {
   261         -        aSugg.add(sFlex+"s");
   262         -    }
   263         -    if (_oSpellChecker.isValid(sFlex+"x")) {
   264         -        aSugg.add(sFlex+"x");
          260  +    if (sFlex.slice(-1).gl_isLowerCase()) {
          261  +        if (_oSpellChecker.isValid(sFlex+"s")) {
          262  +            aSugg.add(sFlex+"s");
          263  +        }
          264  +        if (_oSpellChecker.isValid(sFlex+"x")) {
          265  +            aSugg.add(sFlex+"x");
          266  +        }
          267  +    } else {
          268  +        if (_oSpellChecker.isValid(sFlex+"S")) {
          269  +            aSugg.add(sFlex+"s");
          270  +        }
          271  +        if (_oSpellChecker.isValid(sFlex+"X")) {
          272  +            aSugg.add(sFlex+"x");
          273  +        }
   265    274       }
   266    275       if (mfsp.hasMiscPlural(sFlex)) {
   267    276           mfsp.getMiscPlural(sFlex).forEach(function(x) { aSugg.add(x); });
   268    277       }
   269    278       if (aSugg.size == 0 && bSelfSugg && (sFlex.endsWith("s") || sFlex.endsWith("x") || sFlex.endsWith("S") || sFlex.endsWith("X"))) {
   270    279           aSugg.add(sFlex);
   271    280       }

Modified gc_lang/fr/modules/gce_suggestions.py from [74625aeb66] to [5701f141a0].

   190    190           if sFlex.endswith("ail") and len(sFlex) > 3 and _oSpellChecker.isValid(sFlex[:-2]+"ux"):
   191    191               aSugg.add(sFlex[:-2]+"ux")
   192    192       if sFlex.endswith("L"):
   193    193           if sFlex.endswith("AL") and len(sFlex) > 2 and _oSpellChecker.isValid(sFlex[:-1]+"UX"):
   194    194               aSugg.add(sFlex[:-1]+"UX")
   195    195           if sFlex.endswith("AIL") and len(sFlex) > 3 and _oSpellChecker.isValid(sFlex[:-2]+"UX"):
   196    196               aSugg.add(sFlex[:-2]+"UX")
   197         -    if _oSpellChecker.isValid(sFlex+"s"):
   198         -        aSugg.add(sFlex+"s")
   199         -    if _oSpellChecker.isValid(sFlex+"x"):
   200         -        aSugg.add(sFlex+"x")
          197  +    if sFlex[-1:].islower():
          198  +        if _oSpellChecker.isValid(sFlex+"s"):
          199  +            aSugg.add(sFlex+"s")
          200  +        if _oSpellChecker.isValid(sFlex+"x"):
          201  +            aSugg.add(sFlex+"x")
          202  +    else:
          203  +        if _oSpellChecker.isValid(sFlex+"S"):
          204  +            aSugg.add(sFlex+"s")
          205  +        if _oSpellChecker.isValid(sFlex+"X"):
          206  +            aSugg.add(sFlex+"x")
   201    207       if mfsp.hasMiscPlural(sFlex):
   202    208           aSugg.update(mfsp.getMiscPlural(sFlex))
   203    209       if not aSugg and bSelfSugg and sFlex.endswith(("s", "x", "S", "X")):
   204    210           aSugg.add(sFlex)
   205    211       aSugg.discard("")
   206    212       if aSugg:
   207    213           return "|".join(aSugg)