Spell module: fix check of UTF8 strings in pyaspell
This commit is contained in:
parent
8aaf3bd6dc
commit
9495e43cc0
@ -45,6 +45,8 @@ def cmd_spell(msg):
|
|||||||
def check_spell(word, lang='fr'):
|
def check_spell(word, lang='fr'):
|
||||||
a = Aspell(("lang", lang))
|
a = Aspell(("lang", lang))
|
||||||
if a.check(word):
|
if a.check(word):
|
||||||
return True
|
ret = True
|
||||||
else:
|
else:
|
||||||
return a.suggest(word)
|
ret = a.suggest(word)
|
||||||
|
a.close()
|
||||||
|
return ret
|
||||||
|
@ -113,7 +113,7 @@ class AspellLinux(object):
|
|||||||
return bool(
|
return bool(
|
||||||
self.__lib.aspell_speller_check(
|
self.__lib.aspell_speller_check(
|
||||||
self.__speller,
|
self.__speller,
|
||||||
_to_bytes(word),
|
word,
|
||||||
len(word)
|
len(word)
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
@ -132,7 +132,7 @@ class AspellLinux(object):
|
|||||||
return self._aspellwordlist(
|
return self._aspellwordlist(
|
||||||
self.__lib.aspell_speller_suggest(
|
self.__lib.aspell_speller_suggest(
|
||||||
self.__speller,
|
self.__speller,
|
||||||
_to_bytes(word),
|
word,
|
||||||
len(word)
|
len(word)
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user