in reply to Asking START (MIT AI) a question

I'm getting an error when running this:

Use of uninitialized value in pattern match (m//) at ./You-can-call-me-AI line 55.

I entered "You-can-call-me-AI -q 'how far is the moon?'

I get the correct answer when I go to the site and enter it manually. START is pretty cool.

If I print the $html right away, I get the answer but something in that "extract text from html regex isn't working".

my $html = $robot->content(); print "$html\n";

Replies are listed 'Best First'.
Re: Re: Asking START (MIT AI) a question
by Limbic~Region (Chancellor) on Dec 02, 2003 at 18:47 UTC
    zentara,
    If you change line 55:
    #my ($text) = $html =~ /(<H1>START(?:.|\n)*<HR>)/mg; my $text = $html;
    You get results. I may update with a fix more in line with Roger's intentions if he doesn't first.

    Cheers - L~R

Re: Re: Asking START (MIT AI) a question
by Roger (Parson) on Dec 02, 2003 at 21:03 UTC
    Hi zentara, thanks for pointing out the bug. I have fixed the text extraction. ;-)

    I am getting the correct response now -
    P:\Perl>perl robot.pl -q "A" START's reply ===> A I think you're going to have to run that by me again (maybe phrased a bit differently). P:\Perl>perl robot.pl -q "How far is the moon?" START's reply ===> How far is the moon? Moon Distance from Earth (km) 384,467 Source: Planetary Sciences at the National Space Science Data Center P:\Perl>perl robot.pl -q "How big is the moon?" START's reply ===> How big is the moon? Moon The volumetric mean radius of the Moon is 1737.1 (km). Source: Planetary Sciences at the National Space Science Data Center
Re: Re: Asking START (MIT AI) a question
by Roger (Parson) on Dec 02, 2003 at 23:00 UTC
    I have updated the robot, added additional text filtering to translate meta characters and combine multiple empty lines.

    The following is what START thought about Perl. ;-)