[alicebot-style] Problem with get and pattern

Alessandro Boca a.boca at yahoo.it
Tue Mar 14 02:53:32 PST 2006


Hi Kim,

I'll try to be more precise here.

What I would like to do is to use AIML to search into a text. In this
example the text is inserted by the user.
I want the user to say "Find X in text", where text is the text I want to
search in and X is the predicate that I want to look for.
And I want the bot to look in the text for the predicate and reply something
like: "X is in the text" or "X is not in the text".

The example below should be clear:

<category>
 <pattern>Find * in *</pattern>
 <template>
  <think><set name="x"><star index="1"/></set></think>
  <srai><star index="2"/></srai>
 </template>
</category>

<category>
 <pattern>* <get name="x"/> *</pattern>
 <template><get name="x"/> is in the text</template>
</category>

<category>
 <pattern>* <get name="x"/></pattern>
 <template><get name="x"/> is in the text</template>
</category>

<category>
 <pattern><get name="x"/> *</pattern>
 <template><get name="x"/> is in the text</template>
</category>

<category>
 <pattern>*</pattern>
 <template><get name="x"/> is'nt in the text</template>
</category>

In the first category I set the predicate and I reduce the text with srai
and in the other categories I look for the predicate.

I hope now it's clear.

Thank you anyway



----- Original Message -----
From: "Kim Sullivan" <alicebot at seznam.cz>
To: "AIML Style Mailing List" <alicebot-style at list.alicebot.org>
Sent: Monday, March 13, 2006 11:45 PM
Subject: RE: [alicebot-style] Problem with get and pattern


> Hi,
>
> > This example doesn't work because I think that you can't put a get
element
> into a pattern, don't you?
> > Do you think that there is a way to make it work?
> > Or maybe, is there a different approach to work it out?
>
> There is probably a different way to work it out, but from your examples I
> am not really sure what you are trying to achieve. Setting the variable is
> clear, but why do you want to match it later and respond to it "this is
the
> value of X"?
>
> So, what exactly are you trying to do, what is X, and what should the bot
do
> (how to reply) once it matches X?
>
> Also, have you considered the following case, how would you expect it to
> work?
>
> <category>
>  <pattern>Set X and Y to *</pattern>
>  <template>
>   <think><set name="x"><star/></set><set name="y"><star/></set></think>
>   </template>
> </category>
>
> <category>
>  <pattern><get name="x"/></pattern>
>  <template>This is the value of X</template>
> </category>
>
> <category>
>  <pattern><get name="y"/></pattern>
>  <template>This is the value of Y</template>
> </category>
>
> Kim
>
> _______________________________________________
> alicebot-style mailing list
> alicebot-style at list.alicebot.org
> http://list.alicebot.org/mailman/listinfo/alicebot-style
>
> __________ NOD32 1.1437 (20060310) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


More information about the alicebot-style mailing list