Grammalecte  Check-in [e1fceb6d54]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[fr] lexicographer: fix end of lemma detection
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr
Files: files | file ages | folders
SHA3-256:e1fceb6d5489f33f31092bfc29cd76e70489335eb188b3a447ef15c9fbdcb719
User & Date: olr 2018-09-20 09:56:46
Original Comment: [fr] lexicographer: fix end of lemme detection
Context
2018-09-21
08:21
[build][fr] colors for options (draft) check-in: c93a0ed5ea user: olr tags: build, fr, trunk
2018-09-20
09:56
[fr] lexicographer: fix end of lemma detection check-in: e1fceb6d54 user: olr tags: fr, trunk
09:01
[tb] fix import and call of the gc engine check-in: 9174cdbe8a user: olr tags: tb, trunk
Changes

Changes to gc_lang/fr/modules/lexicographe.py.

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
        "returns string: readable tags"
        sRes = ""
        sTags = re.sub("(?<=V[1-3])[itpqnmr_eaxz]+", "", sTags)
        sTags = re.sub("(?<=V0[ea])[itpqnmr_eaxz]+", "", sTags)
        for m in self._zTag.finditer(sTags):
            sRes += _dTAGS.get(m.group(0), " [{}]".format(m.group(0)))[0]
        if sRes.startswith(" verbe") and not sRes.endswith("infinitif"):
            sRes += " [{}]".format(sTags[1:sTags.find(" ")])
        return sRes.rstrip(",")

    def _formatSuffix (self, s):
        if s.startswith("t-"):
            return "“t” euphonique +" + _dAD.get(s[2:], "[?]")
        if not "-" in s:
            return _dAD.get(s.replace("’", "'"), "[?]")
        if s.endswith("ous"):
            s += '2'
        nPos = s.find("-")
        return "%s +%s" % (_dAD.get(s[:nPos], "[?]"), _dAD.get(s[nPos+1:], "[?]"))







|











209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
        "returns string: readable tags"
        sRes = ""
        sTags = re.sub("(?<=V[1-3])[itpqnmr_eaxz]+", "", sTags)
        sTags = re.sub("(?<=V0[ea])[itpqnmr_eaxz]+", "", sTags)
        for m in self._zTag.finditer(sTags):
            sRes += _dTAGS.get(m.group(0), " [{}]".format(m.group(0)))[0]
        if sRes.startswith(" verbe") and not sRes.endswith("infinitif"):
            sRes += " [{}]".format(sTags[1:sTags.find("/")])
        return sRes.rstrip(",")

    def _formatSuffix (self, s):
        if s.startswith("t-"):
            return "“t” euphonique +" + _dAD.get(s[2:], "[?]")
        if not "-" in s:
            return _dAD.get(s.replace("’", "'"), "[?]")
        if s.endswith("ous"):
            s += '2'
        nPos = s.find("-")
        return "%s +%s" % (_dAD.get(s[:nPos], "[?]"), _dAD.get(s[nPos+1:], "[?]"))