Subject: | Support for AI::MegaHAL's learn(). |
The subject line says it all.
Also, you seem to have forgotten to do "svn add Changes
examples/synopsis.pl" :)
Subject: | learn.diff |
Index: lib/POE/Component/AI/MegaHAL.pm
===================================================================
--- lib/POE/Component/AI/MegaHAL.pm (revision 19)
+++ lib/POE/Component/AI/MegaHAL.pm (working copy)
@@ -24,6 +24,7 @@
do_reply => '_megahal_function',
initial_greeting => '_megahal_function',
_cleanup => '_megahal_function',
+ learn => '_megahal_function',
},
$self => [ qw(_child_closed _child_error _child_stderr _child_stdout _start shutdown _sig_chld) ],
],
@@ -59,7 +60,7 @@
}
- return if $state eq 'do_reply' and !defined $args->{text};
+ return if ($state eq 'do_reply' || $state eq 'learn') and !defined $args->{text};
delete $args->{text} if $state eq 'initial_greeting' and defined $args->{text};
@@ -250,6 +251,11 @@
Submits text to the brain and solicits a reply.
In the hashref you must specify 'text' with the data you wish to submit to the L<AI::MegaHAL> object.
+=item learn
+
+Submits text to the brain B<without> soliciting a reply.
+In the hashref you must specify 'text' with the data you wish to submit to the L<AI::MegaHAL> object.
+
=item _cleanup
Saves the megahal brain to file.