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)