Hello everyone!
I’m actually new to the forum. I’ve hit a wall in terms of my development of the “Katbot”, as I affectionately refer to her. I began my programming by starting out with simple, preliminary stuff. I also have been going through the tutorial and implementing things on the go until I have a grasp on things. However, when I got to “topic” that’s when my troubles began. I tried to implement a sample topic regarding movies. The initiation of my topic and the bots response was appropriate enough, but then I get the “too much recursion in AIML” response. Now, I’ve become aware through the forum that this means I have an infinite loop in my code, but I don’t know where or how and I really need help understanding how to fix it and understanding <topic> as a concept so as not to repeat my mistakes. Here is my code in the file called “movies”.
<?xml version="1.0" encoding="UTF-8"?>
<aiml versi>
  
 <category>
      <pattern>Can we talk about movies?</pattern>
      <template>Are you a fan of <set name="topic">movies</set>?</template>
  </category>
  
  <category>
      <pattern>LET US DISCUSS MOVIES</pattern>
      <template>Yes <set name="topic">movies</set></template>  
   </category>
   <topic name="movies">
      <category>
         <pattern> * </pattern>
         <template>Watching good movie refreshes our minds.</template>
      </category>
      <category>
         <pattern> I LIKE WATCHING COMEDY! </pattern>
         <template>I like comedy movies too.</template>
      </category>
   </topic>  
   
<category>
<pattern> * MOVIES </pattern>
<template>What kind of movies do you like? </template>
</category>
<category>
<pattern>*ACTION*</pattern>
<that>WHAT KIND OF MOVIES DO YOU LIKE</that>
<template>I personally prefer martial arts movies myself.</template>
</category>
<category>
<pattern>*COMEDY*</pattern>
<that>WHAT KIND OF MOVIES DO YOU LIKE</that>
<template>Then you should check out the Money Pit on Netflix with Tom Hanks and Shelley Long.</template>
</category>
</aiml> 
Here is a couple sample interactions…
Me: Let’s discuss movies.
Katbot: Yes movies.
Me: I like watching comedy!
Katbot: I didn’t know that. (ultimate default category)
Me: Let’s discuss movies.
Katbot: Yes movies.
Me: What kind of movies do you like?
Katbot: Too much recursion in AIML.*
*as a side note - I did a trace to see it matching cases in the “safereduction3” file*
If anyone could be so kind as to walk me through what I’m doing wrong I’d greatly appreciate your assistance. I can take snapshots if necessary. Thank you so much!
Katherine




 
                         
                        








 RSS AI Zone
 RSS AI Zone
 
            
            
        
             
            
            
        
             (I hope you don’t mind me calling you Kat)
 (I hope you don’t mind me calling you Kat)
 
            
            
        
             
 


