Massive code dump :o

This commit is contained in:
Luke Rogers 2012-02-03 02:05:11 +13:00
parent 185c1d5ae3
commit 9bc8901972
60 changed files with 5781 additions and 125 deletions

23
plugins/spellcheck.py Normal file
View file

@ -0,0 +1,23 @@
import re
from util import hook
import enchant
@hook.command("spellcheck")
def spell(inp):
'''.time <area> -- gets the time in <area>'''
d = enchant.Dict("en_US")
if not (inp.split()[-1] == inp):
return "This command only supports one word at a time."
is_correct = d.check(inp)
suggestions = d.suggest(inp)
s_string = ', '.join(suggestions)
if is_correct:
return "That word appears to be valid! (suggestions: " + s_string + ")"
else:
return "That word appears to be invalid! (suggestions: " + s_string + ")"