mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Added a Hebrew filter.
This commit is contained in:
parent
3139ffe909
commit
0704c34fc7
@ -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):
|
||||
"""[<channel>] [<command>]
|
||||
|
||||
@ -118,6 +119,17 @@ class Filter(callbacks.Privmsg):
|
||||
irc.replySuccess()
|
||||
outfilter = privmsgs.checkChannelCapability(outfilter, 'op')
|
||||
|
||||
def hebrew(self, irc, msg, args):
|
||||
"""<text>
|
||||
|
||||
Removes all the vowels from <text>. (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):
|
||||
"""<text>
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user