├── .gitignore ├── CHANGES.txt ├── COPYING.txt ├── MANIFEST.in ├── Makefile ├── README.rst ├── SUPPORTED_TAGS.txt ├── TODO.txt ├── aiml ├── AimlParser.py ├── DefaultSubs.py ├── Kernel.py ├── PatternMgr.py ├── Utils.py ├── WordSub.py ├── __init__.py ├── botdata │ ├── alice │ │ ├── ai.aiml │ │ ├── alice.aiml │ │ ├── astrology.aiml │ │ ├── atomic.aiml │ │ ├── badanswer.aiml-2.0 │ │ ├── biography.aiml │ │ ├── bot.aiml │ │ ├── bot_profile.aiml │ │ ├── client.aiml │ │ ├── client_profile.aiml │ │ ├── computers.aiml │ │ ├── continuation.aiml │ │ ├── date.aiml │ │ ├── default.aiml │ │ ├── drugs.aiml │ │ ├── emotion.aiml │ │ ├── food.aiml │ │ ├── geography.aiml │ │ ├── gossip.aiml │ │ ├── history.aiml │ │ ├── humor.aiml │ │ ├── imponderables.aiml │ │ ├── inquiry.aiml │ │ ├── interjection.aiml │ │ ├── iu.aiml │ │ ├── junktest.text │ │ ├── knowledge.aiml │ │ ├── literature.aiml │ │ ├── loebner10.aiml │ │ ├── money.aiml │ │ ├── movies.aiml │ │ ├── mp0.aiml │ │ ├── mp1.aiml │ │ ├── mp2.aiml │ │ ├── mp3.aiml │ │ ├── mp4.aiml │ │ ├── mp5.aiml │ │ ├── mp6.aiml │ │ ├── music.aiml │ │ ├── numbers.aiml │ │ ├── personality.aiml │ │ ├── phone.aiml │ │ ├── pickup.aiml │ │ ├── politics.aiml │ │ ├── primeminister.aiml │ │ ├── primitive-math.aiml-2.0 │ │ ├── psychology.aiml │ │ ├── reduction.names.aiml │ │ ├── reduction0.safe.aiml │ │ ├── reduction1.safe.aiml │ │ ├── reduction2.safe.aiml │ │ ├── reduction3.safe.aiml │ │ ├── reduction4.safe.aiml │ │ ├── reductions-update.aiml │ │ ├── religion.aiml │ │ ├── salutations.aiml │ │ ├── science.aiml │ │ ├── sex.aiml │ │ ├── sports.aiml │ │ ├── stack.aiml │ │ ├── startup.xml │ │ ├── stories.aiml │ │ ├── that.aiml │ │ ├── update1.aiml │ │ ├── update_mccormick.aiml │ │ ├── wallace.aiml │ │ └── xfind.aiml │ └── standard │ │ ├── dev-calendar.aiml │ │ ├── dev-examples.aiml │ │ ├── dev-scripts.aiml │ │ ├── dev-testcases.aiml │ │ ├── dev-translation.aiml │ │ ├── dev-webhelper.aiml │ │ ├── per-drWallace.aiml │ │ ├── startup.xml │ │ ├── std-65percent.aiml │ │ ├── std-atomic.aiml │ │ ├── std-botmaster.aiml │ │ ├── std-brain.aiml │ │ ├── std-connect.aiml │ │ ├── std-dictionary.aiml │ │ ├── std-disconnect.aiml │ │ ├── std-dont.aiml │ │ ├── std-errors.aiml │ │ ├── std-gender.aiml │ │ ├── std-geography.aiml │ │ ├── std-german.aiml │ │ ├── std-gossip.aiml │ │ ├── std-hello.aiml │ │ ├── std-inactivity.aiml │ │ ├── std-inventions.aiml │ │ ├── std-knowledge.aiml │ │ ├── std-lizards.aiml │ │ ├── std-login.aiml │ │ ├── std-numbers.aiml │ │ ├── std-personality.aiml │ │ ├── std-pickup.aiml │ │ ├── std-politics.aiml │ │ ├── std-profile.aiml │ │ ├── std-religion.aiml │ │ ├── std-robot.aiml │ │ ├── std-sales.aiml │ │ ├── std-sextalk.aiml │ │ ├── std-sports.aiml │ │ ├── std-srai.aiml │ │ ├── std-suffixes.aiml │ │ ├── std-that.aiml │ │ ├── std-turing.aiml │ │ └── std-yesno.aiml ├── constants.py └── script │ ├── __init__.py │ ├── aimlvalidate.py │ └── bot.py ├── setup.cfg ├── setup.py ├── std-startup.xml ├── stress.py └── test ├── __init__.py ├── __main__.py ├── encoding.aiml ├── self-test.aiml ├── test_encoding.py ├── test_kernel.py ├── test_utils.py └── test_wordsub.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *~ 3 | 4 | MANIFEST 5 | build 6 | dist 7 | aiml.egg-info 8 | 9 | *.brn 10 | *.brain 11 | -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright 2003-2010 Cort Stratton. All rights reserved. 2 | Copyright 2016 Paulo Villegas. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the 12 | distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 15 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR 18 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt 2 | recursive-include aiml/botdata *.* 3 | 4 | include test/*.py 5 | include test/*.aiml 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | export VERSION=`python3 setup.py --version 2>/dev/null` 2 | 3 | release: 4 | pip3 install wheel twine setuptools --user 5 | rm -rf dist 6 | python3 setup.py register 7 | python3 setup.py bdist_wheel --universal 8 | python3 setup.py sdist 9 | git commit -a -m "Release $(VERSION)"; true 10 | git tag v$(VERSION) 11 | git push origin --all 12 | git push origin --tags 13 | twine upload dist/* 14 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | aiml 2 | *********** 3 | 4 | This is a fork of the `PyAIML`_ Python AIML interpreter. It has been 5 | refactored to make it install and work in both Python 2.7 and Python 3. 6 | 7 | You can install it with `pip install aiml`. 8 | 9 | PyAIML is (c) Cort Stratton. *aiml* uses the same license as PyAIML 10 | (2-clause BSD), except for the ALICE AIML files taken from the `Free ALICE AIML 11 | set`_, which are licensed with the `LGPL`_ license. 12 | 13 | 14 | Scripts 15 | ======= 16 | 17 | Two small scripts are added upon installation: 18 | 19 | * ``aiml-validate`` can be used to validate AIML files 20 | * ``aiml-bot`` can be used to start a simple interactive session with a bot, 21 | after loading either AIML files or a saved brain file. 22 | 23 | 24 | Datasets 25 | ======== 26 | 27 | The installation includes two AIML datasets: 28 | 29 | * The *standard* AIML set, as it was included in PyAIML 30 | * The `Free ALICE AIML set`_ v. 1.9, taken from the data published by the 31 | `ALICE AI Foundation`_ (with a few small fixes in files that did not 32 | validate as `AIML 1.0.1`_) 33 | 34 | They can be loaded via the ``bootstrap`` method in the ``Kernel`` class. See 35 | the `bot.py`_ script for an example. 36 | 37 | 38 | 39 | Tests 40 | ===== 41 | 42 | There are a number of unit tests included (in the ``test`` subdirectory); they 43 | can be executed by the setup infrastructure as:: 44 | 45 | python setup.py test 46 | 47 | or they can also be launched by directly calling:: 48 | 49 | python test [testname ...] 50 | 51 | This last version allows executing only some of the test files by explicitly 52 | naming them in the command line; if none is specified all will be executed. 53 | 54 | 55 | 56 | .. _PyAIML: https://github.com/Calysto/aiml (forked from https://github.com/cdwfs/pyaiml) 57 | .. _Free ALICE AIML set: https://code.google.com/archive/p/aiml-en-us-foundation-alice/ 58 | .. _LGPL: http://www.gnu.org/licenses/lgpl.html 59 | .. _AIML Foundation: http://www.aiml.foundation/index.html 60 | .. _bot.py: aiml/script/bot.py 61 | .. _AIML 1.0.1: https://github.com/AIML-Foundation/AIML-1.0.1 62 | 63 | ------------------------------------------------------------------------------ 64 | 65 | 66 | Original README from PyAIML 67 | =========================== 68 | 69 | 70 | PyAIML is an interpreter for AIML (the Artificial Intelligence Markup 71 | Language), implemented entirely in standard Python. It strives for 72 | simple, austere, 100% compliance with the AIML 1.0.1 standard, no less 73 | and no more. 74 | 75 | This is currently pre-alpha software. Use at your own risk! 76 | 77 | For information on what's new in this version, see the ``CHANGES.txt`` file. 78 | 79 | For information on the state of development, including the current level of 80 | AIML 1.0.1 compliance, see the ``SUPPORTED_TAGS.txt`` file. 81 | 82 | Quick & dirty example (assuming you've downloaded the "standard" AIML set):: 83 | 84 | import aiml 85 | 86 | # The Kernel object is the public interface to 87 | # the AIML interpreter. 88 | k = aiml.Kernel() 89 | 90 | # Use the 'learn' method to load the contents 91 | # of an AIML file into the Kernel. 92 | k.learn("std-startup.xml") 93 | 94 | # Use the 'respond' method to compute the response 95 | # to a user's input string. respond() returns 96 | # the interpreter's response, which in this case 97 | # we ignore. 98 | k.respond("load aiml b") 99 | 100 | # Loop forever, reading user input from the command 101 | # line and printing responses. 102 | while True: print k.respond(raw_input("> ")) 103 | 104 | 105 | -------------------------------------------------------------------------------- /SUPPORTED_TAGS.txt: -------------------------------------------------------------------------------- 1 | This document describes the current state of PyAIML's compliance 2 | to the AIML 1.0.1 standard. The full AIML reference manual can be 3 | found online at https://github.com/AIML-Foundation/AIML-1.0.1 . 4 | 5 | The following tags are currently supported: 6 | 7 | (see notes) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
  • 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |