1 class SpellPlugin < Plugin
2 def help(plugin, topic="")
3 _("spell <word> => check spelling of <word>, suggest alternatives")
6 unless(m.params && m.params =~ /^\S+$/)
7 m.reply _("incorrect usage: ") + help(m.plugin)
10 p = IO.popen("ispell -a -S", "w+")
16 m.reply(_("%{word} may be spelled correctly") % {:word => m.params})
19 elsif(l =~ /^\s*&.*: (.*)$/)
20 m.reply "#{m.params}: #$1"
23 elsif(l =~ /^\s*\+ (.*)$/)
24 m.reply((_("%{word} is presumably derived from ") % {:word => m.params}) + $1.downcase)
28 m.reply(_("%{word}: no suggestions") % {:word => m.params})
35 m.reply _("couldn't exec ispell :(")
40 plugin = SpellPlugin.new
41 plugin.register("spell")