Sample:
User: How old are you and where do you live ?
Alice: I'm 7 months old. I live on earth.
My try:
<category>
<pattern>WHERE DO YOU LIVE</pattern>
<template>I live on earth.</template>
</category>
<category>
<pattern>HOW OLD ARE YOU</pattern>
<template>I'm 7 months old.</template>
</category>
The above AIML code can only reply if I ask the two questions separately.
By digging into AIML syntax, I finally found a solution with the <srai>
tag:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE inline_dtd[
<!ENTITY nbsp " ">
]>
<aiml version="2.0">
<category>
<pattern>WHERE DO YOU LIVE</pattern>
<template>I live on earth.</template>
</category>
<category>
<pattern>HOW OLD ARE YOU</pattern>
<template>I'm 7 months old.</template>
</category>
<category>
<pattern>HOW OLD ARE YOU AND WHERE DO YOU LIVE</pattern>
<template>
<srai>HOW OLD ARE YOU</srai>
<srai>WHERE DO YOU LIVE</srai>
</template>
</category>
</aiml>