From: timriker Date: Wed, 2 Mar 2005 03:18:04 +0000 (+0000) Subject: enable factoids with whitespace if HUNGRY X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0eec125f5a454cced5c6a2ca4a6d2989324253a7;p=infobot.git enable factoids with whitespace if HUNGRY git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1207 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/files/sample/blootbot.config b/files/sample/blootbot.config index 87a1ff1..246ed2e 100644 --- a/files/sample/blootbot.config +++ b/files/sample/blootbot.config @@ -93,10 +93,7 @@ set maxDataSize 450 # [str] when should the bot bother learning new factoids. # ADDRESSED -- only learn when addressed. # HUNGRY -- learn irrelevent of addressing. this will catch -# _everything_, use at your own risk. I tried this ages -# ago and it caught quite funny responses but who knows -# if my modifications will prevent this or not, perhaps -# IsInvalid must be disabled? +# _everything_, use at your own risk. set learn ADDRESSED # [str] different behaviour with URLs. diff --git a/src/Factoids/Statement.pl b/src/Factoids/Statement.pl index b02a4da..d2c29fe 100644 --- a/src/Factoids/Statement.pl +++ b/src/Factoids/Statement.pl @@ -80,7 +80,9 @@ sub doStatement { return; } - return if (!$addressed and $lhs =~ /\s+/); + # uncomment to prevent HUNGRY learning of rhs with whitespace + #return if (!$addressed and $lhs =~ /\s+/); + &::DEBUG("doStatement: $in:$lhs:$mhs:$rhs"); &status("statement: <$who> $message"); @@ -92,7 +94,7 @@ sub doStatement { # verify the update statement whether there are any weird # characters. - ### this chan be simplified. + ### this can be simplified. foreach (split //, $lhs.$rhs) { my $ord = ord $_; if ($ord > 170 and $ord < 220) {