English 中文(简体)
AIML - <think> Tag
  • 时间:2024-12-22

AIML - <think> Tag


Previous Page Next Page  

<think> 在《反洗钱法》中,Tag用于储存一个变量,而不通知用户。

Syntax

储存价值使用和提炼;th;

<think> 
   <set name = "variable-name"> variable-value </set>
</think>

例如,审议以下谈话。

Human: My name is Mahesh
Robot: Hello!
Human: Byeee
Robot: Hi Mahesh Thanks for the conversation!

Example

C > ab > bots > test > aimingl和在C > ab > bots > test > aimingpf.

think.aiml

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern>My name is *</pattern>
      <template>
         Hello!<think><set name = "username"> <star/></set></think>
      </template>  
   </category>  
   
   <category>
      <pattern>Byeee</pattern>
      <template>
         Hi <get name = "username"/> Thanks for the conversation!
      </template>  
   </category>  
   
</aiml>

think.aiml.csv

0,My name is *,*,*, Hello! <think><set name = "username"> <star/></set></think>,think.aiml
0,Byeee,*,*, Hi <get name = "username"/> Thanks for the conversation!,think.aiml

Execute the Program

立即开放指挥。 Go to C > ab >和打下以下指挥系统:

java -cp pb/Ab.jar Main bot = test action = chat trace = false

Verify the Result

你将看到以下产出:

Human: My name is Mahesh
Robot: Hello!
Human: Byeee
Robot: Hi Mahesh Thanks for the conversation!
Advertisements