mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 06:04:21 +01:00
gotta stop being so greedy. it's not fair for everyone else
This commit is contained in:
parent
a8b36c95f5
commit
e0c5dbae43
@ -547,7 +547,7 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
||||
irc.finished = True
|
||||
|
||||
def doFactoid(self, irc, msg, match):
|
||||
r"^(.+)\s+(?<!\\)(was|is|am|were|are)\s+(also\s+)?(.+?)[?!. ]*$"
|
||||
r"^(.+?)\s+(?<!\\)(was|is|am|were|are)\s+(also\s+)?(.+?)[?!. ]*$"
|
||||
(key, isAre, also, value) = match.groups()
|
||||
key = key.replace('\\', '')
|
||||
if key.lower() in ('where', 'what', 'who', 'wtf'):
|
||||
|
@ -118,4 +118,22 @@ if sqlite is not None:
|
||||
ibot.answerUnaddressedQuestions.setValue(answer)
|
||||
ibot.snarfUnaddressedDefinitions.setValue(learn)
|
||||
|
||||
def testDoubleIsAre(self):
|
||||
answer = ibot.answerUnaddressedQuestions()
|
||||
learn = ibot.snarfUnaddressedDefinitions()
|
||||
try:
|
||||
ibot.answerUnaddressedQuestions.setValue(True)
|
||||
ibot.snarfUnaddressedDefinitions.setValue(True)
|
||||
self.assertSnarfNoResponse('foo is <reply> foo is bar')
|
||||
self.assertSnarfRegexp('foo?', 'foo is bar')
|
||||
self.assertSnarfNoResponse('bars are <reply> bars are good')
|
||||
self.assertSnarfRegexp('bars?', 'bars are good')
|
||||
self.assertSnarfNoResponse('bees are <reply> honey is good')
|
||||
self.assertSnarfRegexp('bees?', 'honey is good')
|
||||
self.assertSnarfNoResponse('food is <reply> tacos are good')
|
||||
self.assertSnarfRegexp('food?', 'tacos are good')
|
||||
finally:
|
||||
ibot.answerUnaddressedQuestions.setValue(answer)
|
||||
ibot.snarfUnaddressedDefinitions.setValue(learn)
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user