Grammalecte  Diff

Differences From Artifact [ae150ced95]:

To Artifact [7b2f58ec61]:


1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21













+







"""
Grammalecte - Conjugueur
"""

# License: GPL 3

import re
import traceback

from .conj_data import lVtyp as _lVtyp
from .conj_data import lTags as _lTags
from .conj_data import dPatternConj as _dPatternConj
from .conj_data import dVerb as _dVerb
from .conj_data import dVerbNames as _dVerbNames


_zStartVoy = re.compile("^[aeéiouœê]")
_zNeedTeuph = re.compile("[tdc]$")
#_zNEEDACCENTWITHJE = re.compile("[^i]e$")

_dProSuj = { ":1s": "je", ":1ś": "je", ":2s": "tu", ":3s": "il", ":1p": "nous", ":2p": "vous", ":3p": "ils" }
88
89
90
91
92
93
94




95
96
97
98
99
100
101
102
103









104
105
106
107
108
109
110
89
90
91
92
93
94
95
96
97
98
99









100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115







+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+







                aSugg.add("eus")
                aSugg.add("eut")
            else:
                aSugg.add("étais")
                aSugg.add("était")
            aSugg.discard("")
        else:
            if sInfi in _dVerbNames:
                # there are names derivated from the verb
                aSugg.update(_dVerbNames[sInfi])
            else:
            # we suggest past participles
            aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q1"))
            aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q2"))
            aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q3"))
            aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q4"))
            aSugg.discard("")
            # if there is only one past participle (epi inv), unreliable.
            if len(aSugg) == 1:
                aSugg.clear()
                # we suggest past participles
                aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q1"))
                aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q2"))
                aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q3"))
                aSugg.add(_getConjWithTags(sInfi, tTags, ":PQ", ":Q4"))
                aSugg.discard("")
                # if there is only one past participle (epi inv), unreliable.
                if len(aSugg) == 1:
                    aSugg.clear()
    return aSugg


def getConjSimilInfiV1 (sInfi):
    "returns verbal forms phonetically similar to infinitive form (for verb in group 1)"
    if sInfi not in _dVerb:
        return set()