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"
19 elsif(l =~ /^\s*&.*: (.*)$/)
20 m.reply "#{m.params}: #$1"
23 elsif(l =~ /^\s*\+ (.*)$/)
24 m.reply "#{m.params} is presumably derived from " + $1.downcase
28 m.reply "#{m.params}: no suggestions"
35 m.reply "couldn't exec ispell :("
40 plugin = SpellPlugin.new
41 plugin.register("spell")