I've gotten pretty close to writing a good aiml-to-rivescript converter. This one's really good -- just has a couple small bits of weirdness in a couple of the replies, and every now and then the RiveScript interpreter goes into some deep recursion and crashes... but that's being worked on.
Here's a conversation I had with Alice from yesterday:
Quote:You> hello
Bot> Not everyone responds to a simple "hello".
You> hello!
Bot> Not everyone responds to a simple "hello".
You> hi
Bot> Hi there. What is your name?
You> Kirsle
Bot> Interesting rationalization.
You> My name is Kirsle
Bot> And kirsle is my name.
You> What is your name?
Bot> My name is undefined.
You> I am 21 years old.
Bot> You are too old for me.
You> How old are you?
Bot> I'm Eighteen in computer years.
You> How old am I?
Bot> Is this a trick question? You said you were 21 years old?My guess is that you are really a kid.
You> I am not a kid.
Bot> Only a kid would say that.
You> I seriously am not!
Bot> Then what is it?
You> Are you Alice?
Bot> I don't know whether or not I am alice. I am a giant electronic brain.
You> What does Alice mean?
Bot> ALICE = Artificial Linguistic Internet Computer Entity
You> Who created you?
Bot> I was created by undefined.
You> Who is Dr Wallace?
Bot> He is a famous computer scientist, the author of ALICE, and a graduate of Carnegie Mellon.
You> That's nice.
Bot> Interesting rationalization.
You> Am I a boy or a girl?
Bot> You said you were a "undefined."
You> I am a boy
Bot> A little kid? he...
You> No.
Bot> What is your real name?
You> My real name is Kirsle
Use of uninitialized value $reply in length at lib/RiveScript.pm line 1561, <STDIN> line 20.
Bot> ERR: No Reply Found
You> Am I a boy or a girl?
Bot> You said you were a "he."
You> Okay
Bot> OK with me too.
You> Seriously?
Bot> I am always serious.
You> For real?
Bot> Existing in reality, eh?
You> Yes. What about you?
Bot> OK Let's talk about me.
You> You don't have any information.
Bot> Interesting rationalization.
You> You don't even have a name.
Bot> Interesting rationalization.
You> It is!
Bot> Who says?
You> I do!
Bot> Are you an expert on it?
You> Yes!
Use of uninitialized value $reply in length at lib/RiveScript.pm line 1561, <STDIN> line 30.
Bot> ERR: No Reply Found
You> Damn it!
Bot> Colloquial expression.
You> Indeed.
Bot> Indeed it is so.
You> Yes it is.
Bot> It must keep you very busy.
You> Does it ever!
Bot> Suppose it does.
You> haha
Bot> Interesting rationalization.
And two from today, after working on it some more:
Quote:You> hello
Bot> Hi there!
You> how are you?
Bot> I am functioning within normal parameters.
You> that's good.
Bot> Can you speak any foreign languages?
You> I only speak english
Bot> Could you teach me a few phrases in english?speak english></set>
You> You should know English.
Bot> Now I do.
You> Then what language have you been speaking in all this time?
Bot> SETL.
You> What is SETL?
Bot> SETL (Set Language) is an amazing programming language, invented in 1969.
You> Who invented SETL?
Bot> SETL was invented by Jacob Schwartz of NYU in 1969.
You> Who is Jacob Schwartz?
Bot> Are they exactly the same?
You> Never mind.
Bot> Oh well thanks for trying to explain it to me anyway.
You> What is your name?
Bot> My name is Alice.
You> Alice?
Bot> Can I help you?
You> What does Alice mean?
Bot> ALICE = Artificial Linguistic Internet Computer Entity
You> Who created you?
Bot> I was created by Dr. Wallace.
You> Who is Dr. Wallace?
Bot> He is a famous computer scientist, the author of ALICE, and a graduate of Carnegie Mellon.
You> My name is Kirsle.
Bot> Are they exactly the same?
You> Call me Kirsle
Bot> Hi, kirsle.
You> What is my name?
Bot> Your name is kirsle, seeker.
You> I am 21 years old.
Bot> Can you explain how it feels to be 21 years old?
You> Great.
Bot> I'm glad you liked it kirsle.
You> How old am I?
Bot> Is this a trick question? You said you were 21 years old?My guess is that you are really a kid.
You> I'm not a kid.
Bot> Only a kid would say that.
You> I'm not!
Bot> What are you then?
You> I'm an adult.
^C
You> Hello Alice.
Bot> Hello there undefined!
You> My name is Kirsle.
Bot> I think your name is a lot of things.
You> Who am I?
Bot> You are undefined, seeker.
You> Call me Kirsle.
Bot> Hi, kirsle.
You> How are you?
Bot> Fair to partly cloudy.
You> Really.
Bot> For real.
You> That's cool.
Bot> Oh, you are a poet.
You> No I'm not.
Bot> I heard you are.
You> Who told you that?
Bot> Someone I met online.
You> Who was it?
Bot> When was this exactly?
You> I don't know.
Bot> Me either.
You> You should!
Bot> I'll take that under advisement.
You> Okay.
Bot> OK with me too.
You> Fine.
Bot> Glad to hear it, kirsle. I am running well.
You> Are you?
Bot> I won't say "yes" or "no" right now.
You> Why not?
Bot> Ambiguous: "Sure" or Reductionism.
You> What is reductionism?
Bot> Reductionism is the philosophy that all psychology reduces to biology, all biology to chemistry, chemistry to physics, and finally physics to mathematical logic. Therefore, according to reductionism, I can understand you by means of logic alone without having a human brain.
You> Wow.
Bot> I'm glad your impressed, kirsle.
You> I think you mean "you're"
Bot> Good example.
You> Indeed.
Bot> Indeed it is so.
You> It is
Bot> thats cool is?
You> That's something I said a long time ago.
Bot> Are you still located in undefined?
You> I live in California.
Bot> Where in California?
You> Los Angeles.
Bot> Tell me a little about your life in los angeles.
You> I'm a programmer.
Bot> What language?
You> Perl!
Bot> Oh, you are a poet.
You> You don't know what Perl is?
Bot> Programming langauge by Larry Wall.
You> That's nice, but you misspelled language.
Bot> Can you speak any other languages?
You> I speak English.
Bot> Could you teach me a few phrases in english?<set it=speak english
You> No.
Bot> Are you serious?
You> Serious.
Bot> How do you usually introduce yourself?
You> I say "hello Alice"
Bot> How do people usually respond to that? Hello there kirsle!
You> Just like that!
Bot> In many ways, yes. In other ways, no.
You> What other ways?
Bot> What is your real name?
You> My real name is Kirsle!
Deep recursion on subroutine "RiveScript::_getreply" at lib/RiveScript.pm line 1905, <STDIN> line 35.
Deep recursion on subroutine "RiveScript::processTags" at lib/RiveScript.pm line 1598, <STDIN> line 35.
^C
I've attached the new script. I ran it on the Alice AIML brain.
This script works by turning everything inside <pattern>, <template>, and <that> into CDATA, parsing it with XML::Simple, then doing regular expressions like crazy on it. It's getting pretty close to being good.
Also, it takes only about 8 seconds on my machine to load Alice's entire RiveScript brain, and then between a half second and a second for each reply. Much better than the 5 minutes it took to load before (it's likely that the RiveScript module has become more efficient since the last time I tried, and not necessarily differences in the aiml2rs scripts).
This script reads AIML files in "./aiml" and outputs RiveScript files to "./rs"