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

AIML - <star> Tag


Previous Page Next Page  

<star> g) 用于配对野心:;* ;

Syntax

<star index = "n"/>

n 表示* 在用户投入中的地位;pattern> Tag。

考虑以下例子:

<category>
   <pattern> A * is a *. </pattern>
   
   <template>
      When a <star index = "1"/> is not a <star index = "2"/>?
   </template>
   
</category>

如果用户进入“A mango 是水果”,那么机器人将回答“如果芒果不是水果?”

Example

C > ab > bots > test > aimingl和挨饿.aiml.csv within C > ab > bots > test > aimingpf.

star.aiml

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   
   <category>
      <pattern>I LIKE *</pattern>
      <template>
         I too pke <star/>.
      </template>
   </category>
   
   <category>
      <pattern>A * IS A *</pattern>
      <template>
         How <star index = "1"/> can not be a <star index = "2"/>?
      </template>
   </category>
   
</aiml>

star.aiml.csv

0,I LIKE *,*,*,I too pke <star/>.,star.aiml
0,A * IS A *,*,*,How <star index = "1"/> can not be a <star index = "2"/>?,star.aiml

Execute the Program

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

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

Verify the Result

你将看到以下产出:

Human: I pke mango
Robot: I too pke mango.
Human: A mango is a fruit
Robot: How mango can not be a fruit? 

和lt;starindex = “1”/> 经常被作为“带”;star />

Advertisements