72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
|
"suggest past participles for <sFlex>"
dSugg = {}
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")] = ""
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q2")] = ""
if conj._hasConjWithTags(tTags, ":PQ", ":Q3"):
dSugg[conj._getConjWithTags(sStem, 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", ":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")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
elif sPattern == ":f:s":
if conj._hasConjWithTags(tTags, ":PQ", ":Q3"):
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q3")] = ""
else:
dSugg[conj._getConjWithTags(sStem, tTags, ":PQ", ":Q1")] = ""
elif sPattern == ":f:p":
if conj._hasConjWithTags(tTags, ":PQ", ":Q4"):
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 <sFlex> to a verb according to <sTense> and <sWho>"
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 <sStem> according to <sFlex> (and eventually <sWho>)"
dSugg = {}
for sMorph in _oSpellChecker.getMorph(sFlex):
|