From 7bdbb376b8f802cd7b480c565305c52c72dc3e8b Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Tue, 21 Aug 2012 07:49:22 +1200 Subject: [PATCH] Pepping --- plugins/spellcheck.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/spellcheck.py b/plugins/spellcheck.py index f18f8fb..2607753 100755 --- a/plugins/spellcheck.py +++ b/plugins/spellcheck.py @@ -8,23 +8,21 @@ locale = "en_US" @hook.command("spellcheck") def spell(inp): "spell -- Check spelling of ." - word = inp - - if ' ' in word: + + if ' ' in inp: return "This command only supports one word at a time." if not enchant.dict_exists(locale): return "Could not find dictionary: %s" % locale dict = enchant.Dict(locale) - - is_correct = dict.check(word) - suggestions = dict.suggest(word) + is_correct = dict.check(inp) + suggestions = dict.suggest(inp) s_string = ', '.join(suggestions[:10]) if is_correct: return '"%s" appears to be \x02valid\x02! ' \ - '(suggestions: %s)' % (word, s_string) + '(suggestions: %s)' % (inp, s_string) else: return '"%s" appears to be \x02invalid\x02! ' \ - '(suggestions: %s)' % (word, s_string) \ No newline at end of file + '(suggestions: %s)' % (inp, s_string)