Hello!
I’ve a few questions about AIML 2.0:
1. The <learnf> tag:
I tried to use the tag this way, but it doesn’t work:
<category>
<pattern>I AM * YEARS OLD</pattern>
<template>You are <learnf><set name="age"><star/></set></learnf> years old.</template>
</category>
HUMAN: I am 20 years old.
BOT: You are years old.
The first problem: Where is the “20” in “You are years old.”? And the second problem: The <learnf> creates the “pand_learn.aiml” automatically. But this file is empty (apart from the <aiml> tag)!
Can you help me to use the <learnf> tag correctly (a simple example would be great!)
2. only name input
I don’t know whether this is really a problem, but I don’t know how to solve it. How can I create a pattern that accepts only the name of the human?
...like this way:
BOT: What’s your name?
HUMAN: Otto.
BOT: Hello Otto.
At the moment I have to write it this way:
BOT: What’s your name?
HUMAN: My name is Otto.
BOT: Hello Otto.
<pattern>My name is *</pattern>
<template>Hello <star/>.</template>
Only the name would mean something like this:
<pattern>*</pattern>
<template>Hello <star/>.</template>
But this can’t be right, because every word would match with this pattern. I’m a bit confused. Can you help me?