NAME

OurNet::ChatBot - Context-free interactive Q&A engine

SYNOPSIS

use OurNet::ChatBot;

$mybot = OurNet::ChatBot->new('Amber', 'Amber.bot', 0);

while (1) {
    print 'User: ';
    print 'Amber Bot: '.$mybot->input(<STDIN>)."\n";
}

DESCRIPTION

The ChatBot module simulates a general-purpose, context-free, interactive Chat Bot using the OurBot(tm) engine. It reads the file stored in ChatBot/ directory, parses synonyms and random output settings, then return answers via the input() method.

The lastone property is used to return/set the id of the bot's last sentence. In conjunction of directly manipulating the CHUNKS array (which contains all possible return values for input()), the front-end program could prevent duplicate responses.

CAVEATS

The nextone flag-property is badly implemented.

SEE ALSO

OurNet::FuzzyIndex

AUTHORS

Autrijus Tang <autrijus@autrijus.org>

COPYRIGHT

Copyright 2001 by Autrijus Tang <autrijus@autrijus.org>.

All rights reserved. You can redistribute and/or modify this module under the same terms as Perl itself.