⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 std-dont.aiml

📁 flashget43的源代码 一个比较常用的下载程序
💻 AIML
📖 第 1 页 / 共 5 页
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><aiml version="1.0"><!-- Free software (c) 2001 ALICE AI Foundation --><!-- This program is open source code released under --><!-- the terms of the GNU General Public License --><!-- as published by the Free Software Foundation. --><meta name="author" content="Dr. Wallace"/><meta name="language" content="en"/><category><pattern>CAN I ANALYZE THE DIALOGUES COLLECTED BY THE APPLET</pattern><template><br />If the web server produces an access_log file, such<br />as /var/log/httpd/access_log, then the server records<br />Applet dialogue in the access_log file.  You may use<br />ftp to download the access_log file to your machine;<br />then run program B to analyze it.  <br /><br />Go to the Options menu and find the value for "AnalysisFile".<br />The Classify function operates on the data in the AnalysisFile.<br />By default the AnalysisFile is the same as the LogFile (the<br />current server log file).  But you can change the analysis<br />file to another name, such as /var/log/httpd/access_log or<br />just access_log.<br /><br /></template></category><category><pattern>CAN I BUILD ON TOP OF THE ALICE CODE RATHER THAN CHANGING IT</pattern><template><br />Absolutely. You only have to change her name, location, birthday and/or<br />botmaster, and put a couple of references to yourself.  Then add new<br />categories that cover your own area of expertise or interest.<br /><br /></template></category><category><pattern>CAN I CHANGE THE NAME OF THE ROBOT</pattern><template><br />The AIML tag &lt;name/&gt; inserts the name of the Bot wherever it appears.<br />The default robot name is "ALICE" but you can change it in the<br />"Options menu".  Select "Show Options" and replace "ALICE" with the <br />name of your bot, and then do "Save Options".  Depending on your<br />state, you may need to restart program B. <br /><br /></template></category><category><pattern>CAN I CREATE A LANGUAGE SPECIFIC INSTALLTION</pattern><template><br />Yes.  The file "language.txt" controls the language of the <br />buttons and menus in the ALICE GUI.  If the file is missing,<br />the program uses English names by default.  To see an<br />example of a language-specific installation, copy the<br />file "Germanlanguage.txt" to "language.txt" and start<br />program B.  <br /><br /><br /></template></category><category><pattern>CAN I CREATE MORE AIML TAGS</pattern><template><br />AIML is extensible.  You can create an infinite number of<br />new tags for foreign language pronouns, predicates, or<br />application-specific properties.  The file "predicates.txt"<br />defines any new predicate tags.  "Predicate tags" mean<br />tags that have a client-specific "set" and "get" method.<br />Pronouns like "it" and "he" have predicate tags like<br />&lt;set_it&gt;&lt;/set_it&gt; and &lt;get_he/&gt;.  AIML has a number of<br />these built-in tags for common English pronouns.<br /><br />There are two varieties of extensible predicate tags.<br />The first example illustrates the use of new tags <br />for foreign language pronouns.  The Japanese language<br />pronoun "kare" means "he".  In predicates.txt, we<br />can add a line of the form:<br /><br />kare=dare<br /><br />This single line automatically generates the tags<br />&lt;set_kare&gt; X &lt;/set_kare&gt; to set the value of "kare"<br />to X, and the tag &lt;get_kare/&gt; to retrieve the value.<br />By default, &lt;get_kare/&gt; returns "dare" ("who?").  <br /><br />Now we can create two AIML categories for an elementary<br />Japanese conversation:<br /><br />&lt;category&gt;<br />&lt;pattern&gt;KARE WA * DESU&lt;/pattern&gt;<br />&lt;template&gt;&lt;star/&gt; wa &lt;set_kare&gt;&lt;star/&gt;&lt;/set_kare&gt; desu.&lt;/template&gt;<br />&lt;/category&gt;<br />&lt;category&gt;<br />&lt;pattern&gt;KARE WA * DESU KA&lt;/pattern&gt;<br />&lt;template&gt;&lt;get_kare/&gt; desu ka? &lt;/template&gt;<br />&lt;/category&gt;<br />&lt;category&gt;<br /><br />These two categories produce a coherent conversation<br />about Mr. Arimoto:<br /><br />Client: KARE WA DARE DESU KA<br />Robot: dare desu ka?<br />Client: KARE WA ARIMOTO SAN DESU<br />Robot: arimoto san wa kare desu.<br />Client: KARE WA DARE DESU KA<br />Robot: arimoto san desu ka?<br /><br />Notice that the program replaces &lt;set_kare/&gt;&lt;star/&gt;&lt;/set_kare&gt; <br />with "kare", the default value of this tag.  Sometimes however<br />the default value of the tag is not the best choice for<br />the set tag to return.  The second type of predicate tag <br />replaces the set tag markup with the original string<br />inside the markup.  <br /><br />To create a predicate tag "has" we add the following line<br />to predicates.txt:<br /><br />has=*mother<br /><br />The default value of &lt;get_has/&gt; is "mother" (because<br />everyone has a mother).  The "*" here indicates that<br />the program should replace &lt;set_has&gt; X &lt;/set_has&gt;<br />with X.  <br /><br />Here we write two AIML categories to demonstrate the<br />"has" predicate:<br /><br />&lt;category&gt;<br />&lt;pattern&gt;I HAVE A *&lt;/pattern&gt;<br />&lt;template&gt;Where did you get <br />&lt;set_it&gt;&lt;set_has&gt;&lt;person/&gt;&lt;/set_has&gt;&lt;/set_it&gt;?<br />&lt;/template&gt;<br />&lt;/category&gt;<br /><br />&lt;category&gt;<br />&lt;pattern&gt;WHAT DO I HAVE&lt;/pattern&gt;<br />&lt;template&gt;Tell me more about your &lt;get_has/&gt;. &lt;/template&gt;<br />&lt;/category&gt;<br /><br />Notice that the first category embeds &lt;set_has&gt; in &lt;set_it&gt;,<br />so that the value of &lt;person/&gt; becomes both "it" and "has".<br />The resulting dialogue:<br /><br />Client: WHAT DO I HAVE<br />Robot: Tell me more about your mother.<br />Client: I HAVE A BOX<br />Robot: Where did you get it?<br />Client: WHAT DO I HAVE<br />Robot: Tell me more about your box.<br /><br />Look at the file "predicates.txt" for several more <br />examples of custom AIML tags, including the German<br />&lt;set_sie&gt;, &lt;set_er&gt; and &lt;set_es&gt;.<br /><br /></template></category><category><pattern>CAN I HAVE A PRIVATE CONVERSATION WITH ALICE</pattern><template><br />The ALICE server logs and records all conversations.  Even the ALICE<br />Applet tries to transmit conversation logs back to the originating server.<br />You can have a private conversation with ALICE, however, if you download<br />Program B to your own computer and run it there.  Running on your machine,<br />the server stores all the conversations locally.<br /><br /><br /></template></category><category><pattern>CAN I INCLUDE JAVASCRIPT IN THE ROBOT REPLY</pattern><template><br />Yes.  You can include any HTML including &lt;script&gt; tags.  Suppose you<br />want to "chat AND browse," in other words, have the robot open<br />up a new browser window when she provides a URL link.  Here's a category that<br />kicks out a piece of HTML/scripting that opens a new window with and loads a<br />given URL.   This is handy for search engines or showing off one's web page.<br /><br />&lt;category&gt;<br /> &lt;pattern&gt; WHERE IS YOUR WEB SITE &lt;/pattern&gt;<br /> &lt;template&gt;<br />    It's at "http://www.geocities.com/krisdrent/"<br />    &lt;script language="JavaScript"&gt;<br />   // Go to &lt;a href="http://www.geocities.com/krisdrent"&gt;The ALICE<br />Connection&lt;/a&gt;<br />   &lt;!--<br />   window.open("http://www.geocities.com/krisdrent/")<br />   --&gt;<br />  &lt;/script&gt;<br /> &lt;/template&gt;<br />&lt;/category&gt;<br /><br />A couple of things to note about this technique:  #1, this will only work<br />when ALICE is being talked to from a browser that runs JavaScript, i.e. it<br />won't work in the applet.  We have tested it in Netscape and MS Internet<br />Explorer, and it works well in both.  #2.  For the above reason, it is<br />important to have some sort of explanatory statement before the scripting in<br />case the scripting isn't supported.  Besides, you want some response in your<br />ALICE window, even if another window DOES come up.  #3.  If this is viewed<br />in a browser that doesn't understand the &lt;script&gt; tag, notice that this line<br />will show up:<br />"// Go to &lt;a href="http://www.geocities.com/krisdrent"&gt;The ALICE<br />Connection&lt;/a&gt;"<br />Which is good, because it gives a back-up for the "non-scripted" (the Lynx<br />users, I guess.)  And remember that you have to keep the "//" in front of<br />any non-java-script lines within the &lt;script&gt; tag.<br /><br /></template></category><category><pattern>CAN I INSERT DYNAMIC HTML INTO THE ROBOT REPLY</pattern><template><br />If you are fortunate enough to be running lynx under Linux, the <br />following markup is a simple way to "inline" the results of an HTTP <br />request into the chat robot reply.   Try asking ALICE:<br />"What chatterbots do you know?" and she will reply with a page<br />of links generated by the Google search engine.<br /><br />&lt;category&gt;<br />&lt;pattern&gt;WHAT *&lt;/pattern&gt;<br />&lt;template&gt;<br />Here is the information I found:<br />&lt;system&gt;<br />lynx -dump -source -image_links http://www.google.com/search?q=&lt;personf/&gt;<br />&lt;/system&gt;<br />&lt;/template&gt;<br />&lt;/category&gt;<br /><br /></template></category><category><pattern>CAN I RUN PROGRAM B IN THE BACKGROUND ON A NT SERVER</pattern><template><br />Yes. Set up your PC / Server to run Alice B as you normal. (Download the Java<br />Developers Kit, etc.)<br /><br />Create a Batch file, in folder B containing only this text.<br /><br />'jview bterm'<br /><br />Create a task in the Task Schedule Wizard to run the batch file. (Ensure the<br />task starts in drive:\path\B'<br /><br />Give the Task Schedule an appropriate Logon and password for the Server or<br />PC.<br /><br />Right-click, select Run now, and log on and off as you like.<br /><br /></template></category><category><pattern>CAN I RUN SHELL COMMANDS FROM AIML SCRIPTS</pattern><template><br />Yes.  Use the &lt;system&gt;X&lt;/system&gt; tag to run the shell command X.<br />The command X is assumed to produce its output in line-oriented<br />format suitable for a BufferdReader to read line by line.  <br />A simple example of this command in an AIML script is:<br /><br />&lt;category&gt;<br />&lt;pattern&gt;WHAT TIME IS IT&lt;/pattern&gt;<br />&lt;template&gt;The local time is: &lt;system&gt;date&lt;/system&gt;&lt;/template&gt;<br />&lt;/category&gt;<br /><br />The "date" command is a system command that generates a text<br />string containing the date and time.  (Note that this might<br />not work on Windows).<br /> <br />Take extreme care in using the &lt;system&gt; tag because it <br />potentially permits remote clients to run a command on<br />your system.  <br /><br /></template></category><category><pattern>CAN I RUN THE WEB SERVER AS A DAEMON PROCESS</pattern><template><br />Yes.  There is a class file called Bterm.java in the<br />program B distribution.   Bterm runs the web server<br />as a console application, with no GUI.  You can<br />redirect the output of program Bterm to a log file<br />and start the process in the background with<br />"java Bterm &gt; B.log &amp;" (assuming a Unix shell). <br /><br /></template></category><category><pattern>CAN I SPEAK TO THE ROBOT WITH VOICE INPUT</pattern><template><br />One simple experiment that works well as a demo<br />involves using IBM ViaVoice (tm) speech recognition<br />software on a Windows platform.  At the same time,<br />run the ALICE program B web server and activate the<br />MS Agent interface.  The ViaVoice software allows<br />

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -