Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Newlines and line endings
  • Loading branch information
cort committed Aug 14, 2010
1 parent 2aea5f3 commit ce045fa
Show file tree
Hide file tree
Showing 10 changed files with 643 additions and 643 deletions.
318 changes: 159 additions & 159 deletions CHANGES.txt

Large diffs are not rendered by default.

82 changes: 41 additions & 41 deletions README.txt
@@ -1,41 +1,41 @@
PyAIML -- The Python AIML Interpreter
author: Cort Stratton (cort@users.sourceforge.net)
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 (cort@users.sourceforge.net)
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("> "))
188 changes: 94 additions & 94 deletions SUPPORTED_TAGS.txt
@@ -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.
2 changes: 1 addition & 1 deletion aiml/AimlParser.py
Expand Up @@ -542,4 +542,4 @@ def create_parser():
handler = AimlHandler("UTF-8")
parser.setContentHandler(handler)
#parser.setFeature(xml.sax.handler.feature_namespaces, True)
return parser
return parser

0 comments on commit ce045fa

Please sign in to comment.