Code for Steps 1-4
Step 1: Create aiml file “canonical”
<?xml version="1.0" encoding="UTF-8"?>
<aiml versi>
<topic name="canonical">
<category><pattern>XCANONICAL # goes #</pattern><template><star/> go <star index="2"/></template></category>
<category><pattern>XCANONICAL # went #</pattern><template><star/> go <star index="2"/></template></category>
<category><pattern>XCANONICAL # going #</pattern><template><star/> go <star index="2"/></template></category>
<category><pattern>XCANONICAL # travels #</pattern><template><star/> travel <star index="2"/></template></category>
<category><pattern>XCANONICAL # traveled #</pattern><template><star/> travel <star index="2"/></template></category>
<category><pattern>XCANONICAL # traveling #</pattern><template><star/> travel <star index="2"/></template></category>
<category><pattern>XCANONICAL *</pattern><template><star/></template></category>
</topic>
</aiml>
Step 2: Create aiml file “system”
<?xml version="1.0" encoding="UTF-8"?>
<aiml versi>
<topic name="system">
<category>
<pattern>*</pattern>
<template>
<think><set name="original_sentence"><star/></set>
<set name="topic">canonical</set>
<set name="parsed_sentence"><srai>XCANONICAL <get name="original_sentence"/></srai></set>
<set name="parsed_sentence"><srai>XCANONICAL <get name="parsed_sentence"/></srai></set>
<set name="parsed_sentence"><srai>XCANONICAL <get name="parsed_sentence"/></srai></set>
<set name="topic">introductions</set>
</think><srai>XSTATEMENT <get name="parsed_sentence"/></srai>
</template>
</category>
</topic>
</aiml>
Step 3: Edit aiml file “pand_initial”
Delete the first category in this file.
Replace the existing * category that catches all input with the following 2 categories.
<category><pattern>XSTATEMENT *</pattern>
<template>I have no answer for that.
original sentence: <get name="original_sentence"/>
parsed sentence: <get name="parsed_sentence"/>
</template>
</category>
<category><pattern>*</pattern>
<template><think>
<set name="topic">system</set>
</think><srai><star/></srai>
</template>
</category>
Step 4: Create a test pattern
<category><pattern>XSTATEMENT # i go # and i travel #</pattern>
<template>
You get around.
<get name="original_sentence"/>
<get name="parsed_sentence"/>
</template>
</category>