0

I am working on a chat bot, just to see how it goes. I am using the PyAIML module. I currently am trying to get the user's name, and be able to use it when asked to. however, when I run the program, it doesn't show the name, only the text surrounding it. pardon my poor explanation of my problem. let me show you some code.

<category>
<pattern>MY NAME IS *</pattern>
<template>ok <star/>, I will do my best to remember that <star/> is    your name.</template>
<think><set name = "name"><star/></set></think>
</category>

<category>
<pattern>WHAT IS MY NAME</pattern>
<template>I like to call you <get name = "name"/>. should I change it? 
</template>
</category>

when run, the output does not include the name. all it says is:

<--I like to call you . Should I change it?

Am I doing something wrong?

Ps.(please be graceful, I just started AIML today :))

General Nuisance
  • 211
  • 3
  • 16

1 Answers1

1

I'm not sure what the "think" tag is for, but I think that the main problem is that you have placed the "set" tag outside of the "template" tag.

Try something like this:

<template>ok <set name = "name"><star/></set>, I will do my best to remember that <get name = "name"/> is your name.</template>