Hey there.
Just to make sure: is there a rest & first tag in Program AB? When I’ve tried it like
<aiml>
    <category>
        <pattern>TEST REST</pattern>
        <template>
            <rest>T E S T</rest>
        </template>
    </category>
</aiml> 
 
it fails.
I’ve come up with a solution for both cases. It looks like:
<aiml><!-- REST, FIRST -->
    <category>
        <pattern>XREST * *</pattern>
        <template><star index="2"/></template>
    </category>
    <category>
        <pattern>XFIRST * *</pattern>
        <template><star/></template>
    </category>
</aiml> 
Essentially, since the wildcard is non-greedy, every wildcard except the last will only catch one word. As a result, we simulate first and rest by either taking the first word or taking everything but the first word respectively.
Anyway, is there a problem with this method?
Thanks in advance as always.
Edit: I found that the following must be added!
<category>
    <pattern>XREST *</pattern>
    <template>nil</template>
</category> 
Essentially, when something which can’t be rested is entered, such as “a”, it goes to “nil”, just like <rest> normally would!




 
                         
                        








 RSS AI Zone
 RSS AI Zone
 
            
        
             
            
            
        
            


 
            
            
        
            



