changes to regexes
Merge branch 'master' of git://github.com/mossblaser/BeardBot
more updates to regexes
Merge branch 'master' of git://github.com/mossblaser/BeardBot
more additions to the range of regexes
Merge branch 'master' of git://github.com/mossblaser/BeardBot
wtf now returns a link to an acronym dictionary if word not found localy
Added "wtf else is <word>?" functionality
Added "wtf else is <word>?" functionality
from base_module import *
import re, string

word_lists = ["/usr/share/misc/acronyms", "/usr/share/misc/acronyms.comp"]

requiredBeardBotVersion = 0.1
class BeardBotModule(ModuleBase):

	@on_channel_match("wtf is (\S*[^\?])\??")
	def define(self, source_name, source_host, message, word):
		description = self.translate(word)
		if description:
			self.bot.say(description)
		else:
			self.bot.say("Fuck knows!? Try http://acronyms.thefreedictionary.com/" + word)

	@on_channel_match("wtf else is (\S*[^\?])\??")
<<<<<<< HEAD
	def refer(self, source_name, source_host, message, word):
=======
	def define(self, source_name, source_host, message, word):
>>>>>>> dd8fb70738144a3e432449eb279ebbc75d1c68b4
		self.bot.say("Fine! Don't listen to me! Try http://acronyms.thefreedictionary.com/" + word)

	def translate(self, word_to_find):
		for file_name in word_lists:
			for line in filter(lambda l: len(l) and l[0] != '$',
					   map(string.strip,
					       open(file_name).xreadlines())):
				word, desc = map(string.strip, line.replace('\t', ' ').split(' ', 1))
				if word_to_find.upper() == word:
					return desc
from base_module import *
import re, string

word_lists = ["/usr/share/misc/acronyms", "/usr/share/misc/acronyms.comp"]

requiredBeardBotVersion = 0.1
class BeardBotModule(ModuleBase):

	@on_channel_match("wtf is (\S*[^\?])\??")
	def define(self, source_name, source_host, message, word):
		description = self.translate(word)
		if description:
			self.bot.say(description)
		else:
			self.bot.say("Fuck knows!? Try http://acronyms.thefreedictionary.com/" + word)

	@on_channel_match("wtf else is (\S*[^\?])\??")
<<<<<<< HEAD
	def refer(self, source_name, source_host, message, word):
=======
	def define(self, source_name, source_host, message, word):
>>>>>>> dd8fb70738144a3e432449eb279ebbc75d1c68b4
		self.bot.say("Fine! Don't listen to me! Try http://acronyms.thefreedictionary.com/" + word)

	def translate(self, word_to_find):
		for file_name in word_lists:
			for line in filter(lambda l: len(l) and l[0] != '$',
					   map(string.strip,
					       open(file_name).xreadlines())):
				word, desc = map(string.strip, line.replace('\t', ' ').split(' ', 1))
				if word_to_find.upper() == word:
					return desc
Merge branch 'master' of github.com:j616/BeardBot

Conflicts:
	wtf.py
Fixed error on acronyms file not found.
If the acronyms files arn't present, refer to online dictionary
Now deals with lack of acronyms files in a logical maner
Better handling of unfound words and files
Checks if the online dict knows wtf it is
added acronyms files to repo and updated wtf to use them
Modified wtf to use acronym files from the repo
Merge branch 'master' of git://github.com/tomjnixon/BeardBot