1 #----------------------------------------------------------------#
3 # Description: Rbot plugin. Looks up a word in the Dutch VanDale
5 # Author: eWoud - ewoud.nuyts<AT>student.kuleuven.ac.be
6 # requires GnuVD www.djcbsoftware.nl/projecten/gnuvd/
7 #----------------------------------------------------------------#
9 class VanDalePlugin < Plugin
10 def help(plugin, topic="")
11 "vandale [<word>] => Look up in the VanDale dictionary"
17 Utils.safe_exec("/usr/local/bin/gnuvd", m.params).each{|line| if line.length > 5 then ret << line end}
18 m.reply ret.delete_at(0)
19 while ret[0] =~ /^[[:alpha:]_]*[0-9]/
20 m.reply ret.delete_at(0)
22 while ret[0] =~ /^[0-9]/
23 m.reply ret.delete_at(0)
27 ret[i] = ret[i].slice(/^[[:graph:]_]*/)
28 if ret[i].length == 0 or ret[i] =~ /^[0-9]/
35 if ret.length != 0 then
36 m.reply "zie ook " + ret.join(", ")
40 m.reply "incorrect usage: " + help(m.plugin)
43 m.reply "incorrect usage: " + help(m.plugin)
48 plugin = VanDalePlugin.new
49 plugin.register("vandale")