3

I am creating AIML file for Program-O chatbot and facing a problem.

What I want to do is ask question after question sequentially. Moreover, the questions should be in random order. It is satisfaction assessment test for students and I am experimenting to develop by using chatbot instead of traditional methods.

This is the AIML format I have in mind.

sample.aiml

<category>
    <pattern>HELLO<bot/></pattern>
    <template>
        <random>
            <li><warm/>Hello there. Do you want to talk about your campus life?</li>
            <li><happy/>Hi. Do you want to talk about your campus life?</li>
            <li><happy/>Goodday. Do you want to talk about your campus life?</li>
        </random>
    </template>
</category>
<category>
    <pattern>*</pattern>
    <that>HELLO THERE. DO YOU WANT TO TALK ABOUT CAMPUS LIFE</that>
    <template>
        <random>
            <li>How were the classes?</li>
            <li>Does the teacher give a clear answer?</li>
            <li>Was the teacher come on time?</li>
        </random>
    </template>
</category>
<category>
    <pattern>*</pattern>
    <that>HOW WERE THE CLASSES</that>
    <template>
        <random>
            <li>Does the teacher give the full and clear explanation?</li>
            <li>What about the material used in the classes?</li>
            <li>What do you think about the courses content?</li>
        </random>
    </template>
</category>

The problem is that *(asterisk) wildcard is not working well with that predicate. Is there any other way to construct the AIML which fulfill my requirement?

bummi
  • 27,123
  • 14
  • 62
  • 101
Atrh
  • 195
  • 1
  • 3
  • 16

2 Answers2

2

Use the underscore wildcard. In AIML, there are two wildcards - * and _. The underscore wildcard has higher priority then the asterisk.

Devyn Collier Johnson
  • 4,124
  • 3
  • 18
  • 39
  • Now, in aiml ver=2.0 there are additional wildcards to help with this. One of them being ^. Perhaps worth checking out for anyone hitting this question in the future. – Marlon van der Linde Jun 12 '19 at 10:12
-1
string text = System.IO.File.ReadAllText(txt_filename.Text.ToString()).ToString();

        int length = (Int32)text.Length;
        txt_gbox.Text = length.ToString();

        LexicalAnalysis analyzer = new LexicalAnalysis();

        while (text !=)
        {
            text = text.Trim(' ', '\t');
            string token = analyzer.GetNextLexicalAtom(ref text);
            txt_gbox.Text = token;
        }

I want to show these token in richtextbox which is txt_gbox but on while loop programe stop....

slfan
  • 8,950
  • 115
  • 65
  • 78