2017-03-18 43 views
3

我正在嘗試在我的aiml文件中使用set標記,但似乎沒有任何工作。它永遠不會匹配。我爲aiml設置的標記不起作用

color.aiml文件

 <?xml version="1.0" encoding="UTF-8"?> 
     <aiml version="2.0"> 
     <category> 
      <pattern>IS <set>colors</set> A COLOR</pattern> 
      <template>Yes, <star /> is a color.</template> 
     </category> 

     <category> 
      <pattern>IS * A COLOR</pattern> 
      <template>No, <star /> is not a color.</template> 
     </category> 
     </aiml> 

colors.set文件

[["red"],["orange"],["yellow"],["green"],["blue"],["indigo"]] 

結果:

Human: Is green a color? 
Bot: No, green is not a color. 

的預計業績:

Human: Is green a color? 
Bot: Yes, green is a color. 

任何人都可以幫助我解決這個問題嗎?

+0

如果您有興趣,我可以幫助您對AIML + Python做相同的處理 –

回答

0

我試着用下面的變化

添加 「colors.txt文件同樣的例子 「文件夾下與價值觀一樣

紅色

綠色

藍色

綠色