[pandorabots-general] How to match in topic

Anne Kootstra anne at aiml.info
Sat Feb 10 12:31:43 PST 2007


There are a number of ways you can make a single category match multiple
topics. Personally I would take a good look and assess if this category
doesn't belong in the global bot - non topic - memory. 

 

Howver, there are two ways of doing it. One way would be to create a
multiple matching topic category. Lost you there, right? Well it is possible
to use * in a TOPIC. 

 

Example:

 

<topic name="my firsttopic">

<c>

<p>pattern</p>

<t>my answer 1</t>

</c>

</topic>

 

<topic name="my secondtopic">

<c>

<p>pattern 2</p>

<t>my answer 2</t>

</c>

</topic>

 

<topic name="my *">

<c>

<p>pattern</p>

<t>my answer 3</t>

</c>

</topic>

 

There are two scenario's that match this example code. Activating "my
firsttopic"  and inputting "pattern" will return "my answer 1". When setting
topic "my secondtopic" and inputting "pattern" will return "my answer 3". 

 

The second way of achieving the same result is to create a controller topic
category which will set a list of topics in a predefined sequence looking
for matches. However, the downside will be performance. Because of the large
number of recursive calls to the patternmatcher this will be a slow option.
Compared to the other one. 

 

Kind regards,

 

Anne.

 

  _____  

Van: Chris Fellows [mailto:chrisc_fellows at yahoo.com] 
Verzonden: donderdag 1 februari 2007 21:01
Aan: pandorabots-general at list.pandorabots.com
Onderwerp: [pandorabots-general] How to match in topic

 

Hello,

Just discovered pandora's bots and mighty sweet.

As a way of organizing material, I've grouped almost everything into topics.
But some categories span multiple topics. I'd rather not duplicate the code
across files (and thus have to maintain in multiple places). 

If a user asks a question in one topic that does not match, but a match does
exist in another topic, how can I make sure the bot will pull from the
matched category in the other topic (and ideally switch topics to the
matched topic)?

Also, is there a way of matching existing topics?
ex
User: I'd like to know about money.
<category>
    <pattern>I would like to know about *</pattern>
    <template>
       <think>
           if topic name="<star/>" then
              <set name="topic"><star/></set>
       </think>
       Sure, what would like to know about </star>.
    </tempate>


Thank you for all input.

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.pandorabots.com/pipermail/pandorabots-general/attachments/20070210/4b698c12/attachment.html 


More information about the pandorabots-general mailing list