Index: gc_lang/fr/modules-js/conj.js ================================================================== --- gc_lang/fr/modules-js/conj.js +++ gc_lang/fr/modules-js/conj.js @@ -285,32 +285,32 @@ _readableInfo () { // returns readable infos this.sVerbAux = (this._sRawInfo.slice(7,8) == "e") ? "être" : "avoir"; let sGroup = _dGroup.get(this._sRawInfo[0]); - let s = ""; + let sInfo = ""; if (this._sRawInfo.slice(3,4) == "t") { - s = "transitif"; + sInfo = "transitif"; } else if (this._sRawInfo.slice(4,5) == "n") { - s = "transitif indirect"; + sInfo = "transitif indirect"; } else if (this._sRawInfo.slice(2,3) == "i") { - s = "intransitif"; + sInfo = "intransitif"; } else if (this._sRawInfo.slice(5,6) == "r") { - s = "pronominal réciproque"; + sInfo = "pronominal réciproque"; } else if (this._sRawInfo.slice(5,6) == "p") { - s = "pronominal"; + sInfo = "pronominal"; } - if (this._sRawInfo.slice(5,6) == "q" || this._sRawInfo.slice(5,6) == "e") { - s = s + " (+ usage pronominal)"; + if ( ["q", "u", "v", "e"].includes(this._sRawInfo.slice(5,6)) ) { + sInfo = sInfo + " (+ usage pronominal)"; } if (this._sRawInfo.slice(6,7) == "m") { - s = s + " impersonnel"; + sInfo = sInfo + " impersonnel"; } - if (s === "") { - s = "# erreur - code : " + this._sRawInfo; + if (sInfo === "") { + sInfo = "# erreur - code : " + this._sRawInfo; } - return sGroup + " · " + s; + return sGroup + " · " + sInfo; }; infinitif (bPro, bNeg, bTpsCo, bInt, bFem) { let sInfi; if (bTpsCo) { @@ -343,88 +343,88 @@ participePresent (bPro, bNeg, bTpsCo, bInt, bFem) { if (!this.dConj.get(":PQ").get(":P")) { return ""; } - let s; + let sPartPre; if (bTpsCo) { - s = (!bPro) ? _getConjWithTags(this.sVerbAux, this._tTagsAux, ":PQ", ":P") : getConj("être", ":PQ", ":P"); + sPartPre = (!bPro) ? _getConjWithTags(this.sVerbAux, this._tTagsAux, ":PQ", ":P") : getConj("être", ":PQ", ":P"); } else { - s = this.dConj.get(":PQ").get(":P"); + sPartPre = this.dConj.get(":PQ").get(":P"); } - if (s === "") { + if (sPartPre === "") { return ""; } - let bEli = _zStartVoy.test(s); + let bEli = _zStartVoy.test(sPartPre); if (bPro) { if (this.bProWithEn) { - s = "s’en " + s; + sPartPre = "s’en " + sPartPre; } else { - s = (bEli) ? "s’" + s : "se " + s; + sPartPre = (bEli) ? "s’" + sPartPre : "se " + sPartPre; } } if (bNeg) { - s = (bEli && !bPro) ? "n’" + s + " pas" : "ne " + s + " pas"; + sPartPre = (bEli && !bPro) ? "n’" + sPartPre + " pas" : "ne " + sPartPre + " pas"; } if (bTpsCo) { - s += " " + this._seekPpas(bPro, bFem, this._sRawInfo[5] == "r"); + sPartPre += " " + this._seekPpas(bPro, bFem, this._sRawInfo[5] == "r"); } if (bInt) { - s += " … ?"; + sPartPre += " … ?"; } - return s; + return sPartPre; }; conjugue (sTemps, sWho, bPro, bNeg, bTpsCo, bInt, bFem) { if (!this.dConj.get(sTemps).get(sWho)) { return ""; } - let s; + let sConj; if (!bTpsCo && bInt && sWho == ":1s" && this.dConj.get(sTemps)._get(":1ś", false)) { sWho = ":1ś"; } if (bTpsCo) { - s = (!bPro) ? _getConjWithTags(this.sVerbAux, this._tTagsAux, sTemps, sWho) : getConj("être", sTemps, sWho); - } else { - s = this.dConj.get(sTemps).get(sWho); - } - if (s === "") { - return ""; - } - let bEli = _zStartVoy.test(s); - if (bPro) { - if (!this.bProWithEn) { - s = (bEli) ? _dProObjEl.get(sWho) + s : _dProObj.get(sWho) + s; - } else { - s = _dProObjEl.get(sWho) + "en " + s; - } - } - if (bNeg) { - s = (bEli && !bPro) ? "n’" + s : "ne " + s; - } - if (bInt) { - if (sWho == ":3s" && !_zNeedTeuph.test(s)) { - s += "-t"; - } - s += "-" + this._getPronom(sWho, bFem); - } else { - if (sWho == ":1s" && bEli && !bNeg && !bPro) { - s = "j’" + s; - } else { - s = this._getPronom(sWho, bFem) + " " + s; - } - } - if (bNeg) { - s += " pas"; - } - if (bTpsCo) { - s += " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); - } - if (bInt) { - s += " … ?"; - } - return s; + sConj = (!bPro) ? _getConjWithTags(this.sVerbAux, this._tTagsAux, sTemps, sWho) : getConj("être", sTemps, sWho); + } else { + sConj = this.dConj.get(sTemps).get(sWho); + } + if (sConj === "") { + return ""; + } + let bEli = _zStartVoy.test(sConj); + if (bPro) { + if (!this.bProWithEn) { + sConj = (bEli) ? _dProObjEl.get(sWho) + sConj : _dProObj.get(sWho) + sConj; + } else { + sConj = _dProObjEl.get(sWho) + "en " + sConj; + } + } + if (bNeg) { + sConj = (bEli && !bPro) ? "n’" + sConj : "ne " + sConj; + } + if (bInt) { + if (sWho == ":3s" && !_zNeedTeuph.test(sConj)) { + sConj += "-t"; + } + sConj += "-" + this._getPronom(sWho, bFem); + } else { + if (sWho == ":1s" && bEli && !bNeg && !bPro) { + sConj = "j’" + sConj; + } else { + sConj = this._getPronom(sWho, bFem) + " " + sConj; + } + } + if (bNeg) { + sConj += " pas"; + } + if (bTpsCo) { + sConj += " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); + } + if (bInt) { + sConj += " … ?"; + } + return sConj; }; _getPronom (sWho, bFem) { if (sWho == ":3s") { if (this._sRawInfo[5] == "r") { @@ -440,37 +440,37 @@ imperatif (sWho, bPro, bNeg, bTpsCo, bFem) { if (!this.dConj.get(":E").get(sWho)) { return ""; } - let s; + let sImpe; if (bTpsCo) { - s = (!bPro) ? _getConjWithTags(this.sVerbAux, this._tTagsAux, ":E", sWho) : getConj("être", ":E", sWho); + sImpe = (!bPro) ? _getConjWithTags(this.sVerbAux, this._tTagsAux, ":E", sWho) : getConj("être", ":E", sWho); } else { - s = this.dConj.get(":E").get(sWho); + sImpe = this.dConj.get(":E").get(sWho); } - if (s === "") { + if (sImpe === "") { return ""; } - let bEli = _zStartVoy.test(s); + let bEli = _zStartVoy.test(sImpe); if (bNeg) { if (bPro) { if (!this.bProWithEn) { - s = (bEli && sWho == ":2s") ? "ne t’" + s + " pas" : _dImpeProNeg.get(sWho) + s + " pas"; + sImpe = (bEli && sWho == ":2s") ? "ne t’" + sImpe + " pas" : _dImpeProNeg.get(sWho) + sImpe + " pas"; } else { - s = _dImpeProNegEn.get(sWho) + s + " pas"; + sImpe = _dImpeProNegEn.get(sWho) + sImpe + " pas"; } } else { - s = (bEli) ? "n’" + s + " pas" : "ne " + s + " pas"; + sImpe = (bEli) ? "n’" + sImpe + " pas" : "ne " + sImpe + " pas"; } } else if (bPro) { - s = (this.bProWithEn) ? s + _dImpeProEn.get(sWho) : s + _dImpePro.get(sWho); + sImpe = (this.bProWithEn) ? sImpe + _dImpeProEn.get(sWho) : sImpe + _dImpePro.get(sWho); } if (bTpsCo) { - return s + " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); + return sImpe + " " + this._seekPpas(bPro, bFem, sWho.endsWith("p") || this._sRawInfo[5] == "r"); } - return s; + return sImpe; }; _seekPpas (bPro, bFem, bPlur) { if (!bPro && this.sVerbAux == "avoir") { return this.dConj.get(":PQ").get(":Q1"); Index: gc_lang/fr/modules/conj.py ================================================================== --- gc_lang/fr/modules/conj.py +++ gc_lang/fr/modules/conj.py @@ -26,12 +26,12 @@ _dTenseIdx = { ":PQ": 0, ":Ip": 1, ":Iq": 2, ":Is": 3, ":If": 4, ":K": 5, ":Sp": 6, ":Sq": 7, ":E": 8 } -def isVerb (s): - return s in _dVerb +def isVerb (sVerb): + return sVerb in _dVerb def getConj (sVerb, sTense, sWho): "returns conjugation (can be an empty string)" if sVerb not in _dVerb: @@ -240,28 +240,28 @@ if self._sRawInfo[7:8] == "e": self.sVerbAux = "être" else: self.sVerbAux = "avoir" sGroup = _dGroup.get(self._sRawInfo[0], "# erreur ") - s = "" + sInfo = "" if self._sRawInfo[3:4] == "t": - s = "transitif" + sInfo = "transitif" elif self._sRawInfo[4:5] == "n": - s = "transitif indirect" + sInfo = "transitif indirect" elif self._sRawInfo[2:3] == "i": - s = "intransitif" + sInfo = "intransitif" elif self._sRawInfo[5:6] == "r": - s = "pronominal réciproque" + sInfo = "pronominal réciproque" elif self._sRawInfo[5:6] == "p": - s = "pronominal" - if self._sRawInfo[5:6] == "q" or self._sRawInfo[5:6] == "e": - s = s + " (+ usage pronominal)" + sInfo = "pronominal" + if self._sRawInfo[5:6] in ["q", "u", "v", "e"]: + sInfo = sInfo + " (+ usage pronominal)" if self._sRawInfo[6:7] == "m": - s = s + " impersonnel" - if not s: - s = "# erreur - code : " + self._sRawInfo - return sGroup + " · " + s + sInfo = sInfo + " impersonnel" + if not sInfo: + sInfo = "# erreur - code : " + self._sRawInfo + return sGroup + " · " + sInfo except: traceback.print_exc() return "# erreur" def infinitif (self, bPro, bNeg, bTpsCo, bInt, bFem): @@ -296,31 +296,31 @@ def participePresent (self, bPro, bNeg, bTpsCo, bInt, bFem): try: if not self.dConj[":PQ"][":P"]: return "" if bTpsCo: - s = _getConjWithTags(self.sVerbAux, self._tTagsAux, ":PQ", ":P") if not bPro else getConj("être", ":PQ", ":P") + sPartPre = _getConjWithTags(self.sVerbAux, self._tTagsAux, ":PQ", ":P") if not bPro else getConj("être", ":PQ", ":P") else: - s = self.dConj[":PQ"][":P"] - if not s: + sPartPre = self.dConj[":PQ"][":P"] + if not sPartPre: return "" - bEli = True if _zStartVoy.search(s) else False + bEli = True if _zStartVoy.search(sPartPre) else False if bPro: if self.bProWithEn: - s = "s’en " + s + sPartPre = "s’en " + sPartPre else: - s = "s’" + s if bEli else "se " + s + sPartPre = "s’" + sPartPre if bEli else "se " + sPartPre if bNeg: if bEli and not bPro: - s = "n’" + s + " pas" + sPartPre = "n’" + sPartPre + " pas" else: - s = "ne " + s + " pas" + sPartPre = "ne " + sPartPre + " pas" if bTpsCo: - s += " " + self._seekPpas(bPro, bFem, self._sRawInfo[5] == "r") + sPartPre += " " + self._seekPpas(bPro, bFem, self._sRawInfo[5] == "r") if bInt: - s += " … ?" - return s + sPartPre += " … ?" + return sPartPre except: traceback.print_exc() return "# erreur" def conjugue (self, sTemps, sWho, bPro, bNeg, bTpsCo, bInt, bFem): @@ -328,39 +328,39 @@ if not self.dConj[sTemps][sWho]: return "" if not bTpsCo and bInt and sWho == ":1s" and self.dConj[sTemps].get(":1ś", False): sWho = ":1ś" if bTpsCo: - s = _getConjWithTags(self.sVerbAux, self._tTagsAux, sTemps, sWho) if not bPro else getConj("être", sTemps, sWho) + sConj = _getConjWithTags(self.sVerbAux, self._tTagsAux, sTemps, sWho) if not bPro else getConj("être", sTemps, sWho) else: - s = self.dConj[sTemps][sWho] - if not s: + sConj = self.dConj[sTemps][sWho] + if not sConj: return "" - bEli = True if _zStartVoy.search(s) else False + bEli = True if _zStartVoy.search(sConj) else False if bPro: if not self.bProWithEn: - s = _dProObjEl[sWho] + s if bEli else _dProObj[sWho] + s + sConj = _dProObjEl[sWho] + sConj if bEli else _dProObj[sWho] + sConj else: - s = _dProObjEl[sWho] + "en " + s + sConj = _dProObjEl[sWho] + "en " + sConj if bNeg: - s = "n’" + s if bEli and not bPro else "ne " + s + sConj = "n’" + sConj if bEli and not bPro else "ne " + sConj if bInt: - if sWho == ":3s" and not _zNeedTeuph.search(s): - s += "-t" - s += "-" + self._getPronom(sWho, bFem) + if sWho == ":3s" and not _zNeedTeuph.search(sConj): + sConj += "-t" + sConj += "-" + self._getPronom(sWho, bFem) else: if sWho == ":1s" and bEli and not bNeg and not bPro: - s = "j’" + s + sConj = "j’" + sConj else: - s = self._getPronom(sWho, bFem) + " " + s + sConj = self._getPronom(sWho, bFem) + " " + sConj if bNeg: - s += " pas" + sConj += " pas" if bTpsCo: - s += " " + self._seekPpas(bPro, bFem, sWho.endswith("p") or self._sRawInfo[5] == "r") + sConj += " " + self._seekPpas(bPro, bFem, sWho.endswith("p") or self._sRawInfo[5] == "r") if bInt: - s += " … ?" - return s + sConj += " … ?" + return sConj except: traceback.print_exc() return "# erreur" def _getPronom (self, sWho, bFem): @@ -380,32 +380,32 @@ def imperatif (self, sWho, bPro, bNeg, bTpsCo, bFem): try: if not self.dConj[":E"][sWho]: return "" if bTpsCo: - s = _getConjWithTags(self.sVerbAux, self._tTagsAux, ":E", sWho) if not bPro else getConj(u"être", ":E", sWho) + sImpe = _getConjWithTags(self.sVerbAux, self._tTagsAux, ":E", sWho) if not bPro else getConj(u"être", ":E", sWho) else: - s = self.dConj[":E"][sWho] - if not s: + sImpe = self.dConj[":E"][sWho] + if not sImpe: return "" - bEli = True if _zStartVoy.search(s) else False + bEli = True if _zStartVoy.search(sImpe) else False if bNeg: if bPro: if not self.bProWithEn: if bEli and sWho == ":2s": - s = "ne t’" + s + " pas" - else: - s = _dImpeProNeg[sWho] + s + " pas" - else: - s = _dImpeProNegEn[sWho] + s + " pas" - else: - s = "n’" + s + " pas" if bEli else "ne " + s + " pas" - elif bPro: - s = s + _dImpeProEn[sWho] if self.bProWithEn else s + _dImpePro[sWho] - if bTpsCo: - return s + " " + self._seekPpas(bPro, bFem, sWho.endswith("p") or self._sRawInfo[5] == "r") - return s + sImpe = "ne t’" + sImpe + " pas" + else: + sImpe = _dImpeProNeg[sWho] + sImpe + " pas" + else: + sImpe = _dImpeProNegEn[sWho] + sImpe + " pas" + else: + sImpe = "n’" + sImpe + " pas" if bEli else "ne " + sImpe + " pas" + elif bPro: + sImpe = sImpe + _dImpeProEn[sWho] if self.bProWithEn else sImpe + _dImpePro[sWho] + if bTpsCo: + return sImpe + " " + self._seekPpas(bPro, bFem, sWho.endswith("p") or self._sRawInfo[5] == "r") + return sImpe except: traceback.print_exc() return "# erreur" def _seekPpas (self, bPro, bFem, bPlur): Index: gc_lang/fr/oxt/Conjugueur/Conjugueur.py ================================================================== --- gc_lang/fr/oxt/Conjugueur/Conjugueur.py +++ gc_lang/fr/oxt/Conjugueur/Conjugueur.py @@ -301,17 +301,17 @@ else: self.infomsg.Label = "" if sRawInfo[5] == "_": self.opro.State = False self.opro.Enabled = False - elif sRawInfo[5] == "q" or sRawInfo[5] == "e": + elif sRawInfo[5] in ["q", "u", "v", "e"]: self.opro.State = False self.opro.Enabled = True elif sRawInfo[5] == "p" or sRawInfo[5] == "r": self.opro.State = True self.opro.Enabled = False - elif sRawInfo[5] == "!": + elif sRawInfo[5] == "x": self.opro.Label = "cas particuliers" self.opro.State = False self.opro.Enabled = False else: self.opro.Label = "# erreur #" Index: gc_lang/fr/tb/content/conjugueur.js ================================================================== --- gc_lang/fr/tb/content/conjugueur.js +++ gc_lang/fr/tb/content/conjugueur.js @@ -100,19 +100,19 @@ } else { if (sRawInfo[5] == "_") { document.getElementById('opro').checked = false; document.getElementById('opro').disabled = true; document.getElementById('opro').style = "color: #CCC;"; - } else if (sRawInfo[5] == "q" || sRawInfo[5] == "e") { + } else if (["q", "u", "v", "e"].includes(sRawInfo[5])) { document.getElementById('opro').checked = false; document.getElementById('opro').disabled = false; document.getElementById('opro').style = "color: #000;"; } else if (sRawInfo[5] == "p" || sRawInfo[5] == "r") { document.getElementById('opro').checked = true; document.getElementById('opro').disabled = true; document.getElementById('opro').style = "color: #CCC;"; - } else if (sRawInfo[5] == "!") { + } else if (sRawInfo[5] == "x") { document.getElementById('opro').textContent = "cas particuliers"; document.getElementById('opro').checked = false; document.getElementById('opro').disabled = true; document.getElementById('opro').style = "color: #CCC;"; } else { Index: gc_lang/fr/xpi/data/conj_panel.js ================================================================== --- gc_lang/fr/xpi/data/conj_panel.js +++ gc_lang/fr/xpi/data/conj_panel.js @@ -93,19 +93,19 @@ } else { if (sRawInfo[5] == "_") { document.getElementById('opro').checked = false; document.getElementById('opro').disabled = true; document.getElementById('opro_lbl').style = "color: #CCC;"; - } else if (sRawInfo[5] == "q" || sRawInfo[5] == "e") { + } else if (["q", "u", "v", "e"].includes(sRawInfo[5])) { document.getElementById('opro').checked = false; document.getElementById('opro').disabled = false; document.getElementById('opro_lbl').style = "color: #000;"; } else if (sRawInfo[5] == "p" || sRawInfo[5] == "r") { document.getElementById('opro').checked = true; document.getElementById('opro').disabled = true; document.getElementById('opro_lbl').style = "color: #CCC;"; - } else if (sRawInfo[5] == "!") { + } else if (sRawInfo[5] == "x") { document.getElementById('opro').textContent = "cas particuliers"; document.getElementById('opro').checked = false; document.getElementById('opro').disabled = true; document.getElementById('opro_lbl').style = "color: #CCC;"; } else {