Variables in patterns

  • hokascha

    hokascha - 2006-10-27


    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:
    <pattern>I AM FROM *</pattern>
    <template>Tell me about <set_clienthome><star/></set_clienthome>.</template>
    <pattern>IT IS *</pattern>
    <that>Tell me about <get_clienthome/>.</that>

    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.


    • tanoshimi

      tanoshimi - 2006-10-29

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

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

      • 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...




Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks