128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
-
+
|
def spell (self, aWord, aLocale, aProperties):
"returns an object SpellAlternatives"
try:
if not self.bHunspell:
# Graphspell
lSugg = []
for l in self.oGraphspell.suggest(aWord):
for l in self.oGraphspell.suggest(aWord.rstrip(".")):
lSugg.extend(l)
return SpellAlternatives(aWord, tuple(lSugg))
# fallback dictionary suggestions (Hunspell)
return self.xHunspell.spell(aWord, self.xHunspellLocale, aProperties)
except:
traceback.print_exc()
return None
|