Grammalecte  Check-in [ded60afd12]

Overview
Comment:[core][fr] improve suggestions mechanism for imperative forms
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr | core
Files: files | file ages | folders
SHA3-256: ded60afd12078fc3fa82f9214d36228ae6471a56aecdbb0eafcbe34f190adca7
User & Date: olr on 2020-12-02 10:12:30
Other Links: manifest | tags
Context
2020-12-02
13:40
[fr] mise à jour des dictionnaires, nouveaux tags, ajustements check-in: 8cdcc4d90b user: olr tags: trunk, fr
10:12
[core][fr] improve suggestions mechanism for imperative forms check-in: ded60afd12 user: olr tags: trunk, fr, core
07:57
[graphspell] tokenizer update check-in: 9678e9208c user: olr tags: trunk, graphspell
Changes

Modified gc_lang/fr/modules-js/gce_suggestions.js from [18ebc03038] to [ab1e5374d0].

165
166
167
168
169
170
171
172

173
174
175
176
177
178
179
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179







-
+







            if (conj._hasConjWithTags(tTags, ":E", ":2p")) {
                aSugg.add(conj._getConjWithTags(sStem, tTags, ":E", ":2p"));
            }
        }
    }
    if (aSugg.size > 0) {
        if (bVC) {
            return Array.from(aSugg).map((sSugg) => { return sSugg + sSfx; }).join("|");
            return Array.from(aSugg).map((sSugg) => { return ((sSugg.endsWith("e") || sSugg.endsWith("a")) && (sSfx.endsWith("-en") || sSfx.endsWith("-y"))) ? sSugg + "s" +  sSfx : sSugg + sSfx; }).join("|");
        }
        return Array.from(aSugg).join("|");
    }
    return "";
}

function suggVerbInfi (sFlex) {

Modified gc_lang/fr/modules/gce_suggestions.py from [69e8ee798c] to [48d9a59bcc].

124
125
126
127
128
129
130
131

132
133
134
135
136
137
138
124
125
126
127
128
129
130

131
132
133
134
135
136
137
138







-
+







                aSugg.add(conj._getConjWithTags(sStem, tTags, ":E", ":2s"))
            if conj._hasConjWithTags(tTags, ":E", ":1p"):
                aSugg.add(conj._getConjWithTags(sStem, tTags, ":E", ":1p"))
            if conj._hasConjWithTags(tTags, ":E", ":2p"):
                aSugg.add(conj._getConjWithTags(sStem, tTags, ":E", ":2p"))
    if aSugg:
        if bVC:
            aSugg = list(map(lambda sSug: sSug + sSfx, aSugg))
            aSugg = list(map(lambda sSug: sSug + "s" + sSfx  if sSfx.endswith(("-en", "-y")) and sSug.endswith(("e", "a"))  else sSug + sSfx, aSugg))
        return "|".join(aSugg)
    return ""


def suggVerbInfi (sFlex):
    "returns infinitive forms of <sFlex>"
    return "|".join([ sStem  for sStem in _oSpellChecker.getLemma(sFlex)  if conj.isVerb(sStem) ])