Massyn has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks

Before I set out to write an AIML parser for Perl, I'd like to ask if any of you have access to code already written. There is mention of an AIML parser known as "Program V", but no working copy is actually avaiable.

Cheers

Massyn

Replies are listed 'Best First'.
Re: AIML parser for Perl? (XML::Compile::Schema)
by Anonymous Monk on Nov 03, 2013 at 10:02 UTC

    XML::Compile::Schema, https://metacpan.org/source/PERIGRIN/XML-Toolkit-0.15/ex/aiml/XML/AIML/Aiml.pm

    #!/usr/bin/perl -- use strict; use warnings; use XML::LibXML 1.70; ## for load_html/load_xml/location use XML::Compile::Schema; our $AIML_URL = 'http://files.aitools.org/programd/resources/schema/ +AIML.xsd'; my $adom = XML::LibXML->new(qw/ recover 2 /)->load_xml( location => $A +IML_URL ); ## no caching my $aiml = XML::Compile::Schema->new( $adom); $aiml->printIndex; ## print "\n$adom\n"; print $adom->find(q{ //*[ @name="OneOrTwoDIndexedElement"] } )->get_n +ode(0), "\n";

    ... xpather.pl