From 2a53084a1e7d19daa2901fdaf8e245356f052deb Mon Sep 17 00:00:00 2001 From: timriker Date: Wed, 2 Mar 2005 03:18:04 +0000 Subject: [PATCH] enable factoids with whitespace if HUNGRY git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1207 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/files/sample/blootbot.config | 5 +---- blootbot/src/Factoids/Statement.pl | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/blootbot/files/sample/blootbot.config b/blootbot/files/sample/blootbot.config index 87a1ff1..246ed2e 100644 --- a/blootbot/files/sample/blootbot.config +++ b/blootbot/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/blootbot/src/Factoids/Statement.pl b/blootbot/src/Factoids/Statement.pl index b02a4da..d2c29fe 100644 --- a/blootbot/src/Factoids/Statement.pl +++ b/blootbot/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) { -- 2.39.2