From 965c45ff1054e6ecf9045bf8cade0669408ee50f Mon Sep 17 00:00:00 2001 From: dms Date: Thu, 5 Dec 2002 14:11:59 +0000 Subject: [PATCH] - "what is test?" now works. this was broken forever. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@720 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Factoids/Question.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index 2338e44..5a0ddb2 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -65,7 +65,7 @@ sub doQuestion { # valid factoid. if ($query =~ s/[!.]$//) { - push(@query,$query); + push(@query, $query); } $x = &normquery($query); @@ -82,15 +82,16 @@ sub doQuestion { my $qregex = join '|', keys %{ $lang{'qWord'} }; - # what's whats => what is; who'?s => who is, etc - $query =~ s/ ($qregex)\'?s / $1 is /i; - if ($query =~ s/\s+($qregex)\s+//i) { # check for question word + # purge prefix question string. + if ($query =~ s/^ ($qregex)//i) { $questionWord = lc($1); } if ($questionWord eq "" and $finalQMark and $addressed) { $questionWord = "where"; } + $query =~ s/^\s+|\s+$//g; # bleh. hacked. + push(@query, $query) if ($query ne $x); if (&IsChanConf("factoidArguments")) { $result = &factoidArgs($query[0]); -- 2.39.2