diff --git a/plugins/Filter.py b/plugins/Filter.py index 5c1bb08ce..0bfbc23e2 100644 --- a/plugins/Filter.py +++ b/plugins/Filter.py @@ -96,7 +96,8 @@ class Filter(callbacks.Privmsg): _filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp', 'scramble', 'morse', 'reverse', 'colorize', 'squish', - 'supa1337', 'colorstrip', 'aol', 'rainbow', 'spellit'] + 'supa1337', 'colorstrip', 'aol', 'rainbow', 'spellit', + 'hebrew'] def outfilter(self, irc, msg, args, channel): """[] [] @@ -118,6 +119,17 @@ class Filter(callbacks.Privmsg): irc.replySuccess() outfilter = privmsgs.checkChannelCapability(outfilter, 'op') + def hebrew(self, irc, msg, args): + """ + + Removes all the vowels from . (If you're curious why this is + named 'hebrew' it's because I (jemfinch) thought of it in Hebrew class, + and printed Hebrew often elides the vowels.) + """ + text = privmsgs.getArgs(args) + text = filter(lambda c: c not in 'aeiou', text) + irc.reply(text) + def squish(self, irc, msg, args): """ diff --git a/test/test_Filter.py b/test/test_Filter.py index e64e3ec7b..4a9098dd3 100644 --- a/test/test_Filter.py +++ b/test/test_Filter.py @@ -41,6 +41,10 @@ class FilterTest(ChannelPluginTestCase, PluginDocumentation): self.assertNotError('lithp meghan sweeney') self.assertNotError('aol I\'m too legit to quit.') + def testHebrew(self): + self.assertResponse('hebrew The quick brown fox ' + 'jumps over the lazy dog.', + 'Th qck brwn fx jmps vr th lzy dg.') def testJeffk(self): for i in range(100): self.assertNotError('jeffk the quick brown fox is ghetto')