forked from cdwfs/pyaiml
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cort
committed
Aug 14, 2010
1 parent
ce045fa
commit 24add26
Showing
47 changed files
with
176,117 additions
and
176,117 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
PyAIML -- The Python AIML Interpreter | ||
author: Cort Stratton ([email protected]) | ||
web: http://pyaiml.sourceforge.net/ | ||
PyAIML is an interpreter for AIML (the Artificial Intelligence Markup | ||
Language), implemented entirely in standard Python. It strives for | ||
simple, austere, 100% compliance with the AIML 1.0.1 standard, no less | ||
and no more. | ||
This is currently pre-alpha software. Use at your | ||
own risk! | ||
For information on what's new in this version, see the | ||
CHANGES.txt file. | ||
For information on the state of development, including | ||
the current level of AIML 1.0.1 compliance, see the | ||
SUPPORTED_TAGS.txt file. | ||
Quick & dirty example (assuming you've downloaded the | ||
"standard" AIML set): | ||
import aiml | ||
# The Kernel object is the public interface to | ||
# the AIML interpreter. | ||
k = aiml.Kernel() | ||
# Use the 'learn' method to load the contents | ||
# of an AIML file into the Kernel. | ||
k.learn("std-startup.xml") | ||
# Use the 'respond' method to compute the response | ||
# to a user's input string. respond() returns | ||
# the interpreter's response, which in this case | ||
# we ignore. | ||
k.respond("load aiml b") | ||
# Loop forever, reading user input from the command | ||
# line and printing responses. | ||
while True: print k.respond(raw_input("> ")) | ||
PyAIML -- The Python AIML Interpreter | ||
author: Cort Stratton ([email protected]) | ||
web: http://pyaiml.sourceforge.net/ | ||
|
||
PyAIML is an interpreter for AIML (the Artificial Intelligence Markup | ||
Language), implemented entirely in standard Python. It strives for | ||
simple, austere, 100% compliance with the AIML 1.0.1 standard, no less | ||
and no more. | ||
|
||
This is currently pre-alpha software. Use at your | ||
own risk! | ||
|
||
For information on what's new in this version, see the | ||
CHANGES.txt file. | ||
|
||
For information on the state of development, including | ||
the current level of AIML 1.0.1 compliance, see the | ||
SUPPORTED_TAGS.txt file. | ||
|
||
Quick & dirty example (assuming you've downloaded the | ||
"standard" AIML set): | ||
|
||
import aiml | ||
|
||
# The Kernel object is the public interface to | ||
# the AIML interpreter. | ||
k = aiml.Kernel() | ||
|
||
# Use the 'learn' method to load the contents | ||
# of an AIML file into the Kernel. | ||
k.learn("std-startup.xml") | ||
|
||
# Use the 'respond' method to compute the response | ||
# to a user's input string. respond() returns | ||
# the interpreter's response, which in this case | ||
# we ignore. | ||
k.respond("load aiml b") | ||
|
||
# Loop forever, reading user input from the command | ||
# line and printing responses. | ||
while True: print k.respond(raw_input("> ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,94 @@ | ||
This document describes the current state of PyAIML's compliance | ||
to the AIML 1.0.1 standard. The full AIML reference manual can be | ||
found online at http://alicebot.org/TR/2001/WD-aiml. | ||
The following tags are currently supported: | ||
<bot name="name"> (see notes) | ||
<condition> | ||
<date> | ||
<formal> | ||
<gender> | ||
<get> | ||
<id> | ||
<input> | ||
<learn> | ||
<li> | ||
<lowercase> | ||
<person> | ||
<person2> | ||
<random> | ||
<sentence> | ||
<set> | ||
<size> | ||
<sr> | ||
<srai> | ||
<star> | ||
<system> | ||
<that> | ||
<thatstar> | ||
<think> | ||
<topic> | ||
<topicstar> | ||
<uppercase> | ||
<version> | ||
Support for the following tags should be implemented in the next version: | ||
None | ||
The following tags are not supported: | ||
<gossip> (see notes) | ||
<if> / <else> (see notes) | ||
<javascript> (see notes) | ||
<secure> (see notes) | ||
------------------------------------------------------------------ | ||
NOTES ON SPECIFIC TAGS: | ||
<bot name="name"> | ||
To set the bot's name, use Kernel.setBotName("NewName"). Note that the | ||
name *MUST* be a single word! Use Kernel.getBotName() to query the bot's | ||
name in your code. | ||
<gossip> | ||
The AIML 1.0.1 specification lets engine authors implement the the behavior | ||
of the <gossip> tag however they wish. I haven't yet decided what I'd like | ||
to do with it, so right now it doesn't do anything at all. | ||
<if> / <else> | ||
These elements appear to have been dropped between AIML 1.0 and AIML 1.0.1. | ||
They may someday be added as a part of an AIML 1.0 backwards-compatibility | ||
mode, but in the meantime, use <condition> instead. | ||
<javascript> | ||
Support for the JavaScript tag is not anticipated; one of the design | ||
goals of PyAIML is to remain 100% pure standard Python. So until | ||
somebody writes a JavaScript interpreter in Python, PyAIML won't | ||
support the <javascript> tag. On the bright side, it is possible | ||
to simulate the effects of the <javascript> tag (i.e. dynamically- | ||
generated tag contents) using the <system mode="sync"> tag. This | ||
solution has the added advantage of allowing *any* programming | ||
language to be used, not just JavaScript. | ||
UPDATE: The python-spidermonkey project provides a bridge between Python | ||
and the open-source SpiderMonkey JavaScript library. I am currently | ||
investigating the possibility of adding support for the <javascript> | ||
tag ON A PURELY OPTIONAL BASIS. | ||
<secure> | ||
Some AIML implementations support a non-standard <secure> tag, intended to | ||
wrap parts of a template which should only be processed if the user is | ||
"secure", or trusted. After implementing support for this tag, I realized | ||
that it wasn't doing anything that you can't do with the <condition> tag. | ||
Therefore, I've decided to drop support for the <secure> tag. You can | ||
easily duplicate its effects; simply replace this: | ||
<secure error="you're not allowed">you are allowed</secure> | ||
with this: | ||
<condition name="secure"> | ||
<li value="yes">you are allowed</li> | ||
<li>you are not allowed</li> | ||
</condition> | ||
Then, use the Kernel.setPredicate() call to set the "secure" predicate to | ||
"yes" for any session that you wish to be secure. | ||
This document describes the current state of PyAIML's compliance | ||
to the AIML 1.0.1 standard. The full AIML reference manual can be | ||
found online at http://alicebot.org/TR/2001/WD-aiml. | ||
|
||
The following tags are currently supported: | ||
|
||
<bot name="name"> (see notes) | ||
<condition> | ||
<date> | ||
<formal> | ||
<gender> | ||
<get> | ||
<id> | ||
<input> | ||
<learn> | ||
<li> | ||
<lowercase> | ||
<person> | ||
<person2> | ||
<random> | ||
<sentence> | ||
<set> | ||
<size> | ||
<sr> | ||
<srai> | ||
<star> | ||
<system> | ||
<that> | ||
<thatstar> | ||
<think> | ||
<topic> | ||
<topicstar> | ||
<uppercase> | ||
<version> | ||
|
||
Support for the following tags should be implemented in the next version: | ||
|
||
None | ||
|
||
The following tags are not supported: | ||
|
||
<gossip> (see notes) | ||
<if> / <else> (see notes) | ||
<javascript> (see notes) | ||
<secure> (see notes) | ||
|
||
------------------------------------------------------------------ | ||
|
||
NOTES ON SPECIFIC TAGS: | ||
|
||
<bot name="name"> | ||
To set the bot's name, use Kernel.setBotName("NewName"). Note that the | ||
name *MUST* be a single word! Use Kernel.getBotName() to query the bot's | ||
name in your code. | ||
|
||
<gossip> | ||
The AIML 1.0.1 specification lets engine authors implement the the behavior | ||
of the <gossip> tag however they wish. I haven't yet decided what I'd like | ||
to do with it, so right now it doesn't do anything at all. | ||
|
||
<if> / <else> | ||
These elements appear to have been dropped between AIML 1.0 and AIML 1.0.1. | ||
They may someday be added as a part of an AIML 1.0 backwards-compatibility | ||
mode, but in the meantime, use <condition> instead. | ||
|
||
<javascript> | ||
Support for the JavaScript tag is not anticipated; one of the design | ||
goals of PyAIML is to remain 100% pure standard Python. So until | ||
somebody writes a JavaScript interpreter in Python, PyAIML won't | ||
support the <javascript> tag. On the bright side, it is possible | ||
to simulate the effects of the <javascript> tag (i.e. dynamically- | ||
generated tag contents) using the <system mode="sync"> tag. This | ||
solution has the added advantage of allowing *any* programming | ||
language to be used, not just JavaScript. | ||
UPDATE: The python-spidermonkey project provides a bridge between Python | ||
and the open-source SpiderMonkey JavaScript library. I am currently | ||
investigating the possibility of adding support for the <javascript> | ||
tag ON A PURELY OPTIONAL BASIS. | ||
|
||
<secure> | ||
Some AIML implementations support a non-standard <secure> tag, intended to | ||
wrap parts of a template which should only be processed if the user is | ||
"secure", or trusted. After implementing support for this tag, I realized | ||
that it wasn't doing anything that you can't do with the <condition> tag. | ||
Therefore, I've decided to drop support for the <secure> tag. You can | ||
easily duplicate its effects; simply replace this: | ||
<secure error="you're not allowed">you are allowed</secure> | ||
with this: | ||
<condition name="secure"> | ||
<li value="yes">you are allowed</li> | ||
<li>you are not allowed</li> | ||
</condition> | ||
Then, use the Kernel.setPredicate() call to set the "secure" predicate to | ||
"yes" for any session that you wish to be secure. |
Oops, something went wrong.