2012-12-31 62 views
3

我正在爲Program-O chatbot創建AIML文件並面臨問題。

我想要做的是按順序問問題。此外,問題應該是隨機的。這是對學生的滿意度評估測試,我正在嘗試通過使用chatbot而不是傳統方法進行開發。創建AIML for chatbot提問

這是我想到的AIML格式。

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> 

問題是*(星號)通配符不與謂詞運作良好。 有沒有其他的方法來構建滿足我的要求的AIML?

+0

什麼意思「無法正常工作」?你的問題到底是什麼? – Hokascha

回答

2

使用下劃線通配符。在AIML中,有兩個通配符 - *和_。下劃線通配符優先於星號。

-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; 
     } 

我要顯示在RichTextBox的是txt_gbox這些令牌,但在while循環PROGRAME停止....