From: dms Date: Fri, 11 Aug 2000 13:21:44 +0000 (+0000) Subject: closed 17187 -- are also ' doesn't work... also removed mailto: X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2ba148e5acef5e40a111aebecb83fe1bc18411c7;p=infobot.git closed 17187 -- are also ' doesn't work... also removed mailto: git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@35 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index ca542a4..01d9e81 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -124,9 +124,9 @@ sub getReply { # only remove '' if (!$real and $reply =~ s/^\s*\s*//i) { # 'are' fix. - if ($reply =~ s/^are //i) { + if ($reply =~ s/^are /$lhs are /i) { &DEBUG("Reply.pl: el-cheapo 'are' fix executed."); - $mhs = "are"; + $mhs = "are"; # what's this for? } } elsif (!$real and $reply =~ s/^\s*\s*(.*)/\cAACTION $1\cA/i) { diff --git a/src/Factoids/Update.pl b/src/Factoids/Update.pl index 8f12e1d..de6cfa7 100644 --- a/src/Factoids/Update.pl +++ b/src/Factoids/Update.pl @@ -31,14 +31,8 @@ sub update { return $noreply; } - # nice 'are' hack (or work-around). - if ($mhs =~ /^are$/i and $rhs !~ /<\S+>/) { - $mhs = "is"; - $rhs = " are ". $rhs; - } - # invalid verb. - if ($mhs !~ /^is$/i) { + if ($mhs !~ /^(is|are)$/i) { &ERROR("UNKNOWN verb: $mhs."); return; } @@ -67,8 +61,6 @@ sub update { } if (my $exists = &getFactoid($lhs)) { # factoid exists. - chomp $exists; - if ($exists eq $rhs) { &performAddressedReply("i already had it that way"); return $noreply; @@ -136,6 +128,14 @@ sub update { } } } else { # not exists. + + # nice 'are' hack (or work-around). + if ($mhs =~ /^are$/i and $rhs !~ /<\S+>/) { + &DEBUG("Update: 'are' hack detected."); + $mhs = "is"; + $rhs = " are ". $rhs; + } + &status("enter: <$who> \'$lhs\' =$mhs=> \'$rhs\'"); $count{'Update'}++;