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 "#{m.params} may be spelled correctly"
18 elsif(l =~ /^\s*&.*: (.*)$/)
19 m.reply "#{m.params}: #$1"
21 elsif(l =~ /^\s*\+ (.*)$/)
22 m.reply "#{m.params} is presumably derived from " + $1.downcase
25 m.reply "#{m.params}: no suggestions"
30 m.reply "couldn't exec ispell :("
35 plugin = SpellPlugin.new
36 plugin.register("spell")