I’m here to announce that I’ve just finished my best attempt to date at writing an AIML parser in Perl! (Actually, it’s an AIML-to-RiveScript converter). This one uses an actual XML parsing library (XML::TokeParser), so it should theoretically do a much better job at parsing the AIML than my older regular expression based scripts did.
I have it on github: https://github.com/kirsle/aiml2rs
It handles most of the tags in the standard Alice set (it found a few typos in Alice’s set too ). There are a few notable things that this converter doesn’t handle, though:
[ul][li]Embedded <random> tags (RiveScript doesn’t -YET- support this)[/li][li]Complicated <condition> tags[/li][/ul]
Categories that have the above “problems” are entirely skipped. In Alice’s brain, there are only 97 categories with multiple-level embedded <random> tags, and only 2 categories with complicated <condition> tags. :D
If you want the Alice brain converted over to RiveScript without having to run this code yourself, you can get it here: http://www.rivescript.com/files/sets/AliceRS-0.02.tar.gz
I tested the Alice RS conversion on the Perl RiveScript library, and it took about 8 seconds to load all the RS code, and then was able to give responses within a second or two each (RiveScript is admittedly a slightly slower engine than AIML, but it has to organize its patterns differently than AIML so not a lot can be done. Still, a second or two to fetch a reply out of 93,070 patterns isn’t half bad ).