Variables in patterns

Help
hokascha
2006-10-27
2013-04-25
  • hokascha
    hokascha
    2006-10-27

    Hi!

    First of all, I really like Program E. I integrated it into Trillian, so Program E is now answering on ICQ, IRC, etc. I am ROTFL from time to time ;-)

    Now, to make the bots answers even better, I would like to use variables inside any <that>-Tags. For example:

    bot: Where are you from?
    user: I'm from New York.
    bot: Tell me about New York.
    user: It is at the east coast.
    bot: Nice!

    And the AIML for the example should be:
    <category>
    <pattern>I AM FROM *</pattern>
    <template>Tell me about <set_clienthome><star/></set_clienthome>.</template>
    </category>
    <category>
    <pattern>IT IS *</pattern>
    <that>Tell me about <get_clienthome/>.</that>
    <template>Nice!<think><set_clienthomeinfos><star/></set_clienthomeinfos></think></template>
    </category>

    AFAIK, variables are not being evaluated inside <that>, or do I miss something here?
    If somebody can give me a hint on how to implement this, I would love to do the dirty work. Looks like it has something to do with the graphwalker and the bget() function.

    Kevin

     
    • tanoshimi
      tanoshimi
      2006-10-29

      I think you're using the wrong syntax for setting/getting. Try:

      <category>
      <pattern>I AM FROM *</pattern>
      <template>Tell me about <set name="clienthome"><star/></set>.</template>
      </category>
      <category>
      <pattern>IT IS *</pattern>
      <that>Tell me about <get name="clienthome"/>.</that>
      <template>Nice!<think><set name ="clienthomeinfos"><star/></set></think></template>
      </category>

       
      • hokascha
        hokascha
        2006-10-29

        Looks like Program E supports both methods, although you're right, the method you described is the preferred one. Anyway, it doesn't change the behaviour and by the way, are variables inside THAT allowed in the AIML standard? Couldn't find any hints...

        Thanks,

        Kevin.