Help with using * <star/>

Help with installation and development.

Help with using * <star/>

Postby slow putzo » October 22nd, 2015, 1:58 am

I tried to explain my issue with an earlier post but discovered my error at that time was doing something wrong. I removed the post to not confuse others with my mistake.

Now I have better defined my problem, and I see it exists in both version 2.4.7 and 2.4.6.
The issue with using a "*" does not, in my opinion, follow the specifications of AIML.

Maybe this particular issue is an open hole in the specification or maybe it is a real bug.

I have a rather complex login procedure that collects a lot of information about the in-world NPC used in the opensim program. It has worked flawlessly now for about 2 years. It still works flawlessly if I do not implement what I consider a fully legal modification to the AIML code I have been using.

Here is a very simple set of some AIML that demonstrates this issue.
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<aiml>

<!-- LOGIN COMMAND PROCESSING.  THIS IS THE FIRST COMMAND SENT TO PROGRAM-O WHEN A NPC STARTS A CHAT SESSION -->
<!-- CMDLOGIN Slow Putzo male April Genie F 0 c x y q Description NPCID AprilGenie V3.0 SlowPutzo-->

<category><pattern>CMDLOGIN *</pattern><template>
<br/>we got to CMDLOGIN
<br/><star index="1"/>
<br/><set name="temp"><getgenie name="version_id"/></set>
<think>
<set name="temp"><getgenie name="version_id"/></set>
</think>
<condition name="temp">   
<li value="V3.0">
<br/>Doing srai to CMDLOGIN1
<srai>CMDLOGIN1 <star/></srai></li>   
<li><br />
#BOTGOHOME^This genie is at an old version: <getgenie name="version_id"/>, chat is not supported with this genie version!<br />Please visit Lady Island to get the current version.</li>
</condition>
</template></category>


<category><pattern>CMDLOGIN1 * * * * * * * * * * q *</pattern><template>
<br/>we got to CMDLOGIN1
<br/><star index="1"/>
<br/><star index="2"/>
<br/><star index="3"/>
<br/><star index="4"/>
<br/><star index="5"/>
<br/><star index="6"/>
<br/><star index="7"/>
<br/><star index="8"/>
<br/><star index="9"/>
<br/><star index="10"/>
<br/><star index="11"/>
<srai>CMDLOGIN2 <star index="1"/> <star index="2"/> <star index="3"/> <star index="4"/> <star index="5"/> <star index="6"/></srai>
</template></category>

<category><pattern>CMDLOGIN2 * * * * * *</pattern><template>
<br/>We got to CMDLOGIN2
<br/><star index="1"/>
<br/><star index="2"/>
<br/><star index="3"/>
<br/><star index="4"/>
<br/><star index="5"/>
<br/><star index="6"/>
</template></category>


<category><pattern>*</pattern><template>
<br/>We got to STAR catchall
<br/><star index="1"/>
</template></category>

</aiml>


Here are two test lines you can use to see the issue.

CMDLOGIN Slow Putzo male April Genie F 0 c x y q Short party dress Suzy Wong style, black high heels
CMDLOGIN Slow Putzo male April Genie F 0 c x y q Short party , heels

The first fails, the second does not.

If you notice in the AIML code at the top I define the login command. There is more to it than what needs to be entered to see the problem.

In the full command the token "NPCID" and everything after it is caught by an add-on program, removed from the input stream and used to set local variables for the new AIML functions I have defined.

It is how I am using the <star> fields to pull the other information from the input stream where this issue becomes apparent.

CMDLOGIN is the identifying important token in the input text that is captured by the first category. It's purpose is to remove the items in the rest of the category and finally pass on those items that need to be processed in a different way.

Everything between the CMDLOGIN and the "q" are fixed single word fields that should end up in unique <star> variables of an index 1 through index 10. The "q" is a flag token that is fixed to define the end of the single word parameters being passed. A "q" will never appear by itself in any of the words preceding this flag token. The field after the "q" is a single variable word length sentence that starts after the "q" and goes to the end of the input line.

Because I am using a specific token to identify where that trailing <star> field begins, it should take everything after it and put it in the <star> for index 11.
It does that as long as the field is not some magical number of words long.

I say magical, because it matters how many words and how long each word is. The major contributing item is the number of spaces which delimit each work.
For instance I was able to put 200 letters with no spaces as the field with no problem.
As you can see above with my real life examples, a much shorter trailing field fails to be caught by the second category.
It instead is passed on to the final catch all category of a single "*". It is displayed with the correct information I would expect to see if the CMDLOGIN category did not catch the input and only pass on some of the variables.

As I mentioned, the change I made to my other scripts that connect to the program-o server changed to from using a few word "description" to many word descriptions. The shorter descriptions work fine while more lengthy ones fail to be able to log in. In the past the description was limited to 44 characters with no concern over how many spaces were in it. I never noticed an issue with that, but then I never tested it either.

What appears to be happening as best I can tell, is somehow the parsing of <star> items is counting the number of "spaces" in the input stream and it has some specific number of star entries it is able to handle. For some reason on the trailing <star> it continues to count spaces, even though the actual word size could be almost anything. The next delimiter it is looking for is "end of line".

My first thought was there was a defined maximum size field a <star> could hold, but that is not true since 100 or more characters easily fit into the <star>.

It is my understanding you could have 10 or 20 star fields in a category having each one separated by a delimiter. I also understand that normally the "space" is the delimiter and it is what is used to trigger looking to see if there is a match.

The present code is not consistently handling how it fills a trailing <star> after a fixed token.

I do not know if it is cased by the total number of <star> fields it is trying to process, but my input of:

CMDLOGIN Slow Putzo male April Genie F 0 c x y q Short ......
Should always match the category of:
CMDLOGIN1 * * * * * * * * * * q *
after it has been processed by the CMDLOGIN * category and passed on.

You can remove the version detection from the CMDLOGIN category and test this with a standard program-o without my add-on code. Simplifying it to:

<category><pattern>CMDLOGIN *</pattern><template>
<br/>we got to CMDLOGIN
<br/><star index="1"/>
<srai>CMDLOGIN1 <star/></srai>
</template></category>

To show the failure, I have installed a virgin install of program-o current release of October 13, 2015 with no modifications at all, and the above AIML with the simplified CMDLOGIN category.

the first example is the output with a small multi word description, the second is the failed output with a lengthy description.

Code: Select all
Seeker: CMDLOGIN SLOW PUTZO MALE APRIL GENIE F 0 C X Y Q DESCRIPTION WITH A FEW WORDS

Root Bot:
 we got to CMDLOGIN
 SLOW PUTZO MALE APRIL GENIE F 0 C X Y Q DESCRIPTION WITH A FEW WORDS
 we got to CMDLOGIN1
 SLOW PUTZO
 MALE
 APRIL
 GENIE
 F
 0
 C
 X
 Y
 DESCRIPTION WITH A FEW WORDS
 We got to CMDLOGIN2
 SLOW PUTZO
 MALE
 APRIL
 GENIE
 F
 0


Code: Select all
Seeker: CMDLOGIN SLOW PUTZO MALE APRIL GENIE F 0 C X Y Q DESCRIPTION AND THIS IS A MUCH LONGER DESCRIPTION THAT SHOULD FAIL RIGHT AWAY

Root Bot:
 we got to CMDLOGIN
 SLOW PUTZO MALE APRIL GENIE F 0 C X Y Q DESCRIPTION AND THIS IS A MUCH LONGER DESCRIPTION THAT SHOULD FAIL RIGHT AWAY
 We got to STAR catchall
 CMDLOGIN1 SLOW PUTZO MALE APRIL GENIE F 0 C X Y Q DESCRIPTION AND THIS IS A MUCH LONGER DESCRIPTION THAT SHOULD FAIL RIGHT AWAY
slow putzo
Avid Member
 
Posts: 76
Joined: November 15th, 2013, 5:55 am

Re: Help with using * <star/>

Postby slow putzo » October 22nd, 2015, 11:24 pm

Further analysis of this problem gives the following results.

"CMDLOGIN1 SLOW PUTZO MALE APRIL GENIE F 0 C X Y Q Description" Was used which works just fine.
What ends up in <star index="11"> is "DESCRIPTION".

I decided to see when it actually failed by adding a space between each letter in the word "Description".

When I reached the pattern "D e s c r i ption" it failed. this was the same as having seven words for the trailing "star".

Dropping back to six words for the trailing star worked.

By adding additional letters to the words had no effect.

In other words "DDDD eeee ssss cccc rrrr iption" worked just as well.

What I did notice was on two occasions the seven word example worked, but then I had to drop back to a 5 word example before the six word example would work again.

Since this "almost" works like the "*" is suppose to work, I can not believe this is not a bug in program-o.

I have tried several work around ideas like using the underscore or other symbols for the space but nothing works. If you eliminate the space and just type one big long run together word it can be huge. The one thing I did try that worked was to use the letter pattern zxz as a space. I could write scripts to strip that out and display good information outside of program-o but that is not where the issue is. I am trying to get this information into program-o not out of it.

I can understand the need for a limit on how many "*" wildcards can be allowed, but if you are within that limit, what is placed into any one wildcard should not make the process stop working.

Back when I was writing the Manuel for the A.L.I.C.E. foundation for AIML 1.0 we changed from only allowing one wildcard (V0.9) in a pattern, to, at that time, a "no limit" wildcard number by introducing the <star "index="#"> tag.

My pattern is using 11 wildcards to capture the passed information. The last wildcard has been anchored with the token "q" allowing the trailing wildcard to capture everything that follows that anchor tag.
slow putzo
Avid Member
 
Posts: 76
Joined: November 15th, 2013, 5:55 am


Return to Bugs and Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron