Anonymous . - Oct 2, 2017:
Is there a way to fit different questions with multiple answers into one category?
Since any one AIML category can only have one <pattern> tag, the short answer is no. However, you can save yourself some coding time/effort by using the <srai> tag. To use a few AIML categories from your example code:
<category>
<pattern>WHAT IS NEW YORK</pattern>
<template>New York is a state in the northeastern United States. It is also a city that is located in that statwe.</template>
</category>
<category>
<pattern>* NEW YORK</pattern>
<template><srai>WHAT IS NEW YORK</srai></template>
</category>
<category>
<pattern>* NEW YORK *</pattern>
<template><srai>WHAT IS NEW YORK</srai></template>
</category>
However, I should warn you that the above AIML categories will cause some unexpected results, if you’re not careful and thorough with your code. For example, with only these 3 AIML categories about New York, what do you suppose would happen if the following input:
I like New York Strip steaks
Instead of talking about food, the bot is now spouting geography, which is, of course, unacceptable. In short, it’s wise to compose AIML that covers every reasonable meaning for a given term or phrase.