Index: gc_lang/fr/modules/gce_suggestions.py ================================================================== --- gc_lang/fr/modules/gce_suggestions.py +++ gc_lang/fr/modules/gce_suggestions.py @@ -74,16 +74,13 @@ for sStem in _oSpellChecker.getLemma(sFlex): tTags = conj._getTags(sStem) if tTags: if not sPattern: dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = "" - if conj._hasConjWithTags(tTags, ":PQ", ":Q2"): - dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = "" - if conj._hasConjWithTags(tTags, ":PQ", ":Q3"): - dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = "" - if conj._hasConjWithTags(tTags, ":PQ", ":Q4"): - dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = "" + dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = "" + dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = "" + dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = "" elif sPattern == ":m:s": dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = "" elif sPattern == ":m:p": if conj._hasConjWithTags(tTags, ":PQ", ":Q2"): dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = "" @@ -99,34 +96,34 @@ dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = "" else: dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = "" elif sPattern == ":s": dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = "" - if conj._hasConjWithTags(tTags, ":PQ", ":Q3"): - dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = "" + dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = "" elif sPattern == ":p": if conj._hasConjWithTags(tTags, ":PQ", ":Q2"): dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = "" else: dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = "" - if conj._hasConjWithTags(tTags, ":PQ", ":Q4"): - dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = "" + dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q4")] = "" else: dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = "" + if "" in dSugg: + del dSugg[""] if dSugg: - return "|".join(dSugg) + return "|".join(dSugg.keys()) return "" def suggVerbTense (sFlex, sTense, sWho): "change to a verb according to and " - aSugg = [] + dSugg = {} for sStem in _oSpellChecker.getLemma(sFlex): if conj.hasConj(sStem, sTense, sWho): - aSugg.append(conj.getConj(sStem, sTense, sWho)) - if aSugg: - return "|".join(aSugg) + dSugg[conj.getConj(sStem, sTense, sWho)] = "" + if dSugg: + return "|".join(dSugg.keys()) return "" def suggVerbFrom (sStem, sFlex, sWho=""): "conjugate according to (and eventually )"