开发手册 欢迎您!
软件开发者资料库

AIML - < set>,< get>标签

AIML< set>,< get>标签 - 从简单和简单的步骤学习AIML,从基本到高级概念,包括简介,环境设置,第一个应用程序,基本标签,< star>等。标签,< srai>标签,<随意>标记,< set>标记,< get>标记,< that>标记,< topic>标记,< think>标签,<条件>标签。

< set> < get> 标记用于处理AIML中的变量.变量可以是预定义变量或程序员创建的变量.

语法

< set> tag用于设置变量中的值.

 variable-value 


< get> tag用于从变量中获取值.


例如,请考虑以下对话.

Human: I am MaheshRobot: Hello Mahesh!Human: Good NightRobot: Good Night Mahesh! Thanks for the conversation!


示例

C > ab > bots > test > aiml 内创建setget.aiml 和在C > ab > bots > test > aimlif 目录创建setget.aiml.csv .

setget.aiml

         I am *                         Good Night                


setget.aiml.csv

0,I am *,*,*, Hello  ! ,setget.aiml0,Good Night,*,*, Hi  Thanks for the conversation!,setget.aiml


执行程序

打开命令提示符.转到 C> ab> 并输入以下命令 :

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


验证结果

您将看到以下输出 :

Human: I am MaheshRobot: Hello Mahesh!Human: Good NightRobot: Good Night Mahesh! Thanks for the conversation!