AIML and the Pattern Tag

The Pattern tag looks to be pretty straight forward. But on a slower observance some interesting nuances bubble up. The documentation found at Alicebot.Org says that not only can letters, numbers, and spaces be used, also the Asterisks, Underscore, and the tag <name/>.

There are some rules to the Pattern tag:

  • Patterns are normally defined as all upper-case
  • Punctuation is normally stripped
  • Can see certain other AIML tags
    • Chat Bots Name, <name/>
    • Not in earlier AIML versions, <bot name=”name”/>
    • For the Chat Bot, <bot_xxx/>, returns some value associated with ‘xxx’, like ‘bot_ipAddress’
    • Other values, <get_xxx/>, returns some value associated with ‘xxx’, like ‘get_ipAddress’
  • Patterns can contain wildcards
    • Underscore character, “_”
      • Underscore is evaluated before Asterisk.
    • Asterisk character, “*”
    • Not in earlier AIML versions, Multi-Asterisk characters, “*”
    • Judging from what was posted on ChatBots.Org, If multiple underscores or asterisks are used, then each one is for one word. The last underscore or asterisk contains the rest of the input
    • Be careful when using multiple underscores and asterisks, If you find that the general pattern is selected over a more specific pattern, then try changing the sequence that the pattern is read first.
    • Editorial Comment: I am curious to discover the nuance there is to using an Underscore, or Asterisk.

Leave a Reply