Spell module: fix check of UTF8 strings in pyaspell

This commit is contained in:
Némunaire 2012-11-24 22:30:46 +01:00
parent 8aaf3bd6dc
commit 9495e43cc0
2 changed files with 19 additions and 17 deletions

View File

@ -45,6 +45,8 @@ def cmd_spell(msg):
def check_spell(word, lang='fr'):
a = Aspell(("lang", lang))
if a.check(word):
return True
ret = True
else:
return a.suggest(word)
ret = a.suggest(word)
a.close()
return ret

View File

@ -113,7 +113,7 @@ class AspellLinux(object):
return bool(
self.__lib.aspell_speller_check(
self.__speller,
_to_bytes(word),
word,
len(word)
))
else:
@ -132,7 +132,7 @@ class AspellLinux(object):
return self._aspellwordlist(
self.__lib.aspell_speller_suggest(
self.__speller,
_to_bytes(word),
word,
len(word)
))
else: