26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
aSugg = set()
for sStem in _oSpellChecker.getLemma(sFlex):
tTags = conj._getTags(sStem)
if tTags:
# we get the tense
aTense = set()
for sMorph in _oSpellChecker.getMorph(sFlex):
for m in re.finditer(">"+sStem+"/.*?(:(?:Y|I[pqsf]|S[pq]|K|P))", sMorph):
# stem must be used in regex to prevent confusion between different verbs (e.g. sauras has 2 stems: savoir and saurer)
if m:
if m.group(1) == ":Y":
aTense.add(":Ip")
aTense.add(":Iq")
aTense.add(":Is")
elif m.group(1) == ":P":
aTense.add(":Ip")
else:
aTense.add(m.group(1))
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
aSugg = set()
for sStem in _oSpellChecker.getLemma(sFlex):
tTags = conj._getTags(sStem)
if tTags:
# we get the tense
aTense = set()
for sMorph in _oSpellChecker.getMorph(sFlex):
for m in re.finditer(">"+sStem+"/.*?(:(?:Y|I[pqsf]|S[pq]|K|P|Q))", sMorph):
# stem must be used in regex to prevent confusion between different verbs (e.g. sauras has 2 stems: savoir and saurer)
if m:
if m.group(1) == ":Y" or m.group(1) == ":Q":
aTense.add(":Ip")
aTense.add(":Iq")
aTense.add(":Is")
elif m.group(1) == ":P":
aTense.add(":Ip")
else:
aTense.add(m.group(1))
|