## doStatement --
##
## decide if $in is a statement, and if so,
-## - update the dbm
+## - update the db
## - return feedback statement
##
## otherwise return
## - null for confused.
##
-if (&IsParam("useStrict")) { use strict; }
+# use strict; # TODO
sub doStatement {
my($in) = @_;
my($lhs, $mhs, $rhs) = ($`, $&, $');
# allows factoid arguments to be updated. -lear.
- $lhs =~ s/^(CMD: )?(.*)/$1 . lc $2/e;
+ $lhs =~ s/^(cmd: )?(.*)/$1||"" . lc $2/e;
- $lhs =~ tr/A-Z/a-z/;
- $lhs =~ s/^(the|da|an?)\s+//i; # discard article
+ # discard article.
+ $lhs =~ s/^(the|da|an?)\s+//i;
# remove excessive initial and final whitespaces.
$lhs =~ s/^\s+|\s+$//g;
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");
# 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) {