Grammalecte  Check-in [86199c55ea]

Overview
Comment:[core][fr] suggestions: remove empty suggestions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr | core
Files: files | file ages | folders
SHA3-256: 86199c55ead7a4543c3c1d060b54dd26e9dda0adfad8b37d1624c03ab59aab9b
User & Date: olr on 2020-02-06 06:51:53
Original Comment: [core][fr] suggestions: remove empyt suggestions
Other Links: manifest | tags
Context
2020-02-06
06:56
[fr] mauvaise sélection de token check-in: 760ad1946f user: olr tags: fr, trunk
06:51
[core][fr] suggestions: remove empty suggestions check-in: 86199c55ea user: olr tags: core, fr, trunk
2020-02-04
14:06
[lo] lexicon editor as non modal dialog check-in: 2239a762bd user: olr tags: lo, trunk
Changes

Modified gc_lang/fr/grammalecte.update.xml from [0bbc0658e4] to [517c65e062].

     1      1   <?xml version="1.0" encoding="UTF-8"?>
     2      2   <description xmlns="http://openoffice.org/extensions/update/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
     3      3     <identifier value="French.linguistic.resources.from.Dicollecte.by.OlivierR"/>
     4         -  <version value="6.5.1" />
            4  +  <version value="7.0" />
     5      5     <update-download>
     6         -    <src xlink:href="https://extensions.libreoffice.org/extensions/grammalecte/1-6.0/@@download/file/Grammalecte-fr-v1.6.0.oxt" />
            6  +    <src xlink:href="https://extensions.libreoffice.org/extensions/grammalecte/1-7.0/@@download/file/Grammalecte-fr-v1.7.0.oxt" />
     7      7     </update-download>
     8      8   </description>

Modified gc_lang/fr/modules-js/gce_suggestions.js from [15ad3aeb1e] to [de44ba5567].

   265    265       }
   266    266       if (mfsp.hasMiscPlural(sFlex)) {
   267    267           mfsp.getMiscPlural(sFlex).forEach(function(x) { aSugg.add(x); });
   268    268       }
   269    269       if (aSugg.size == 0 && bSelfSugg && (sFlex.endsWith("s") || sFlex.endsWith("x") || sFlex.endsWith("S") || sFlex.endsWith("X"))) {
   270    270           aSugg.add(sFlex);
   271    271       }
          272  +    aSugg.delete("");
   272    273       if (aSugg.size > 0) {
   273    274           return Array.from(aSugg).join("|");
   274    275       }
   275    276       return "";
   276    277   }
   277    278   
   278    279   function suggSing (sFlex, bSelfSugg=false) {
................................................................................
   296    297       }
   297    298       if ((sFlex.endsWith("s") || sFlex.endsWith("x") || sFlex.endsWith("S") || sFlex.endsWith("X")) && _oSpellChecker.isValid(sFlex.slice(0,-1))) {
   298    299           aSugg.add(sFlex.slice(0,-1));
   299    300       }
   300    301       if (bSelfSugg && aSugg.size == 0) {
   301    302           aSugg.add(sFlex);
   302    303       }
          304  +    aSugg.delete("");
   303    305       if (aSugg.size > 0) {
   304    306           return Array.from(aSugg).join("|");
   305    307       }
   306    308       return "";
   307    309   }
   308    310   
   309    311   function suggMasSing (sFlex, bSuggSimil=false) {
................................................................................
   331    333           }
   332    334       }
   333    335       if (bSuggSimil) {
   334    336           for (let e of phonet.selectSimil(sFlex, ":m:[si]")) {
   335    337               aSugg.add(e);
   336    338           }
   337    339       }
          340  +    aSugg.delete("");
   338    341       if (aSugg.size > 0) {
   339    342           return Array.from(aSugg).join("|");
   340    343       }
   341    344       return "";
   342    345   }
   343    346   
   344    347   function suggMasPlur (sFlex, bSuggSimil=false) {
................................................................................
   370    373           }
   371    374       }
   372    375       if (bSuggSimil) {
   373    376           for (let e of phonet.selectSimil(sFlex, ":m:[pi]")) {
   374    377               aSugg.add(e);
   375    378           }
   376    379       }
          380  +    aSugg.delete("");
   377    381       if (aSugg.size > 0) {
   378    382           return Array.from(aSugg).join("|");
   379    383       }
   380    384       return "";
   381    385   }
   382    386   
   383    387   
................................................................................
   404    408           }
   405    409       }
   406    410       if (bSuggSimil) {
   407    411           for (let e of phonet.selectSimil(sFlex, ":f:[si]")) {
   408    412               aSugg.add(e);
   409    413           }
   410    414       }
          415  +    aSugg.delete("");
   411    416       if (aSugg.size > 0) {
   412    417           return Array.from(aSugg).join("|");
   413    418       }
   414    419       return "";
   415    420   }
   416    421   
   417    422   function suggFemPlur (sFlex, bSuggSimil=false) {
................................................................................
   437    442           }
   438    443       }
   439    444       if (bSuggSimil) {
   440    445           for (let e of phonet.selectSimil(sFlex, ":f:[pi]")) {
   441    446               aSugg.add(e);
   442    447           }
   443    448       }
          449  +    aSugg.delete("");
   444    450       if (aSugg.size > 0) {
   445    451           return Array.from(aSugg).join("|");
   446    452       }
   447    453       return "";
   448    454   }
   449    455   
   450    456   function hasFemForm (sFlex) {

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

   198    198           aSugg.add(sFlex+"s")
   199    199       if _oSpellChecker.isValid(sFlex+"x"):
   200    200           aSugg.add(sFlex+"x")
   201    201       if mfsp.hasMiscPlural(sFlex):
   202    202           aSugg.update(mfsp.getMiscPlural(sFlex))
   203    203       if not aSugg and bSelfSugg and sFlex.endswith(("s", "x", "S", "X")):
   204    204           aSugg.add(sFlex)
          205  +    aSugg.discard("")
   205    206       if aSugg:
   206    207           return "|".join(aSugg)
   207    208       return ""
   208    209   
   209    210   
   210    211   def suggSing (sFlex, bSelfSugg=True):
   211    212       "returns singular forms assuming sFlex is plural"
................................................................................
   220    221               aSugg.add(sFlex[:-2]+"L")
   221    222           if _oSpellChecker.isValid(sFlex[:-2]+"IL"):
   222    223               aSugg.add(sFlex[:-2]+"IL")
   223    224       if sFlex.endswith(("s", "x", "S", "X")) and _oSpellChecker.isValid(sFlex[:-1]):
   224    225           aSugg.add(sFlex[:-1])
   225    226       if bSelfSugg and not aSugg:
   226    227           aSugg.add(sFlex)
          228  +    aSugg.discard("")
   227    229       if aSugg:
   228    230           return "|".join(aSugg)
   229    231       return ""
   230    232   
   231    233   
   232    234   def suggMasSing (sFlex, bSuggSimil=False):
   233    235       "returns masculine singular forms"
................................................................................
   247    249               if conj.hasConj(sVerb, ":PQ", ":Q1") and conj.hasConj(sVerb, ":PQ", ":Q3"):
   248    250                   # We also check if the verb has a feminine form.
   249    251                   # If not, we consider it’s better to not suggest the masculine one, as it can be considered invariable.
   250    252                   aSugg.add(conj.getConj(sVerb, ":PQ", ":Q1"))
   251    253       if bSuggSimil:
   252    254           for e in phonet.selectSimil(sFlex, ":m:[si]"):
   253    255               aSugg.add(e)
          256  +    aSugg.discard("")
   254    257       if aSugg:
   255    258           return "|".join(aSugg)
   256    259       return ""
   257    260   
   258    261   
   259    262   def suggMasPlur (sFlex, bSuggSimil=False):
   260    263       "returns masculine plural forms"
................................................................................
   277    280                   sSugg = conj.getConj(sVerb, ":PQ", ":Q1")
   278    281                   # it is necessary to filter these flexions, like “succédé” or “agi” that are not masculine plural.
   279    282                   if sSugg.endswith("s"):
   280    283                       aSugg.add(sSugg)
   281    284       if bSuggSimil:
   282    285           for e in phonet.selectSimil(sFlex, ":m:[pi]"):
   283    286               aSugg.add(e)
          287  +    aSugg.discard("")
   284    288       if aSugg:
   285    289           return "|".join(aSugg)
   286    290       return ""
   287    291   
   288    292   
   289    293   def suggFemSing (sFlex, bSuggSimil=False):
   290    294       "returns feminine singular forms"
................................................................................
   302    306               # a verb
   303    307               sVerb = cr.getLemmaOfMorph(sMorph)
   304    308               if conj.hasConj(sVerb, ":PQ", ":Q3"):
   305    309                   aSugg.add(conj.getConj(sVerb, ":PQ", ":Q3"))
   306    310       if bSuggSimil:
   307    311           for e in phonet.selectSimil(sFlex, ":f:[si]"):
   308    312               aSugg.add(e)
          313  +    aSugg.discard("")
   309    314       if aSugg:
   310    315           return "|".join(aSugg)
   311    316       return ""
   312    317   
   313    318   
   314    319   def suggFemPlur (sFlex, bSuggSimil=False):
   315    320       "returns feminine plural forms"
................................................................................
   327    332               # a verb
   328    333               sVerb = cr.getLemmaOfMorph(sMorph)
   329    334               if conj.hasConj(sVerb, ":PQ", ":Q4"):
   330    335                   aSugg.add(conj.getConj(sVerb, ":PQ", ":Q4"))
   331    336       if bSuggSimil:
   332    337           for e in phonet.selectSimil(sFlex, ":f:[pi]"):
   333    338               aSugg.add(e)
          339  +    aSugg.discard("")
   334    340       if aSugg:
   335    341           return "|".join(aSugg)
   336    342       return ""
   337    343   
   338    344   
   339    345   def hasFemForm (sFlex):
   340    346       "return True if there is a feminine form of <sFlex>"