X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FMisc.pl;h=0b39297c98d5cc97f7d8a1bc6ff42a481f819c47;hb=34a4d11667b0a734343f82d2adbaac23f738ad18;hp=a598234f515f5cfa340ffef4cfb358818c9d36d5;hpb=92c3870d1fd6aa5f063a57cfb690aea12ec77df7;p=infobot.git diff --git a/src/Misc.pl b/src/Misc.pl index a598234..0b39297 100644 --- a/src/Misc.pl +++ b/src/Misc.pl @@ -288,8 +288,6 @@ sub fixPlural { return $str; } - - ########## ### get commands. ### @@ -543,88 +541,6 @@ sub validExec { } } -# Usage: &validFactoid($lhs,$rhs); -sub validFactoid { - my ($lhs,$rhs) = @_; - my $valid = 0; - - for (lc $lhs) { - # allow the following only if they have been made on purpose. - if ($rhs ne "" and $rhs !~ /^/ and last; # '=>'. - /\;\;/ and last; # ';;'. - /\|\|/ and last; # '||'. - - /^\Q$ident\E[\'\,\: ]/ and last;# dupe addressed. - /^[\-\, ]/ and last; - /\\$/ and last; # forgot shift for '?'. - /^all / and last; - /^also / and last; - / also$/ and last; - / and$/ and last; - /^because / and last; - /^but / and last; - /^gives / and last; - /^h(is|er) / and last; - /^if / and last; - / is,/ and last; - / it$/ and last; - /^or / and last; - / says$/ and last; - /^should / and last; - /^so / and last; - /^supposedly/ and last; - /^to / and last; - /^was / and last; - / which$/ and last; - - # nasty bug I introduced _somehow_, probably by fixMySQLBug(). - /\\\%/ and last; - /\\\_/ and last; - - # weird/special stuff. also old blootbot or stock infobot bugs. - $rhs =~ /( \Q$ident\E's|\Q$ident\E's )/i and last; # ownership. - - # duplication. - $rhs =~ /^\Q$lhs /i and last; - last if ($rhs =~ /^is /i and / is$/); - - $valid++; - } - - return $valid; -} - # Usage: &hasProfanity($string); sub hasProfanity { my ($string) = @_;