diff --git a/CHANGES.txt b/CHANGES.txt index 3713e24..0d478e1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,159 +1,159 @@ -version 0.8.6 - - Fixed WorbSub module to work with words that consist entirely of punctuation :-). - - Fixed PatternMgr module to replace non-alphanumerics with whitespace instead of simply - consuming them (thanks to Hugh Sasse for the patch). - -version 0.8.5 - - Fixed a couple lingering Unicode bugs, one of which was breaking things - pretty thoroughly under Python 2.2.3. - - Improved whitespace handling, to the point where it should be compliant - with the AIML 1.0.1 standard. Basically, whitespace will be stripped - down to readable levels, unless the xml:space attribute is used to - indicate otherwise. - - Fixed bug in PatternMgr where the character '1' was mistaken identified - as punctuation to be stripped, instead of the intended '!'. - -version 0.8.4: - - Fixed bug in AimlParser creation, if the aiml module was not in the same - directory as the script that imported it. - - Improved Unicode support (again) (thanks to Daniel Kottow for his help). - - 2nd pass at documentation. All functions now have useful, properly-formatted - docstrings. - -version 0.8.3: - - Reworked the way AimlParser objects are created, to allow support for - XML namespaces in a future version. - - First pass at Unicode-proofing the whole system, so that multi-lingual - AIML files can be processed. - - Added support for "index" attribute in "star", "thatstar" and "topicstar" - elements (thanks to Robert D. Cotey for the patch!). Also added type-check - to ensure that the value of the "index" attribute is an integer. - -version 0.8.2: - - Added protection against infinite AIML recursion. - - Removed the deprecated Kernel.getBotName and Kernel.setBotName functions. - - Added workaround for Unicode input crash. Feeding the Kernel Unicode - input no longer crashes the interpreter, but some internal input-formatting - operations must be skipped, which could cause some nonsensical replies - (like you're not already used to nonsensical replies, though...) - -version 0.8.1: - - "system" elements now attempt to intelligently convert between UNIX-style - and Windows-style pathnames as appropriate. For cross-platform compatibility, - all AIML files should use UNIX-style paths inside their "system" elements. - - Fixed crashes under Windows9X when a "system" element is executed when - w9xpopen.exe is unavailable. - - Re-piped most errors and warnings to go to stderr instead of stdout. - - Fixed bug that would cause the the bot to stop responding to any input in a session - if the "that" or "topic" strings were 100% whitespace (but still not empty). - - Fixed bug that would cause multi-line "that" strings to become corrupted. For - example, "Hello there.\nNice to meet you" would become "HELLO THERENICE TO MEET - YOU" when queried for that-matching. - -version 0.8: - - Removed support for non-standard "mode" attribute in "system" elements. - It just wasn't worth breaking the AIML standard for. - - Reworked persistent session support (I warned you!). The old method involving - Kernel.persistentSessions() has been removed. Instead, there is a new - Kernel.getSessionData() method which gives the bot author access to the session - data. You can store this data however you wish. Session data can be restored - later by repeated calls to Kernel.setPredicate(). - - Improved AIML parser error handling; instead of aborting the entire file, a - parse error now only ignores the current category and forges ahead. To check for - parse errors, check the return value of AimlParser.getNumErrors() after parsing. - -version 0.7: - - Further improved AIML parsing; missing or invalid XML attributes are now - detected at parse-time. There's also a first stab at support for Forward - Compatibility Mode: if the "version" attribute of an AIML tag is not 1.0.1, - the parser is much more forgiving of unknown or missing XML tags and attributes. - - Added "support" for the 'gossip' tag. The specific behavior of this tag is - totally undefined; currently, the PyAIML implementation treats it as a big - no-op. Its contents are ignored, and it returns the empty string (but at least - it isn't flagged as a syntax error!) - - Oops; I've implemented 'person' as 'person2' and vice versa this whole time! - Swapped them back; they should each behave correctly now. - - A bit of code cleanup, with an emphasis on using proper XML/AIML terminology - whenever possible. - - Fixed some exception-masking in the 'condition' element processor, which could - prevent AIML parse errors from being reported. - - Added full support for the "bot" tag (previously only the 'bot name="name"' - form was supported). Bot predicates are set using the Kernel.setBotPredicate() - function. Note that Kernel.getBotName() and Kernel.setBotName() have been - deprecated, and will disappear in a future release. - -version 0.6.1: - - Fixed undefined variable exception that was thrown whenever there was no - match for the user's input. - - Fixed an infinite recursion bug caused by processing two or more nested - 'srai' or 'sr' elements. - -version 0.6 - - Completely rewrote the LearnHandler class (which handles all AIML parsing) - to be much less forgiving of incorrect AIML. Currently, any AIML errors - outside of "template" elements should be caught and reported at load-time. - AIML errors inside templates are still not detected until run-time. - - Added support for atomic 'person' and 'person2' tags (they implicitly use - 'star' as their contents if none are provided). - - Oops; Kernel.respond() was DEFINITELY not thread-safe. Now it is, provided - you're using Python's standard 'threading' module. If not, you'll have to - provide your own mutual-exclusion system to ensure that only one thread - is calling Kernel.respond() at a time. - - Recursive tags ('srai' and 'sr') no longer add their intermediate results - to the input and output history. - - EXPERIMENTAL FEATURE: persistent sessions. If enabled using - Kernel.persistentSessions(True), session data will be written to disk - after every response. This lets session data be preserved when the - Kernel is destroyed, at the expense of a small performance hit (all - that extra disk I/O). The semantics of this feature may change in future - releases! - - Added support for the "id" tag (it returns the session ID). - - Added support for the "topic", "topicstar" and "thatstar" tags. - - Commented up the test.py file. - - Added a summary to the end of the Kernel.py self-test (since there are now - too many tests to fit on screen). - - Added support for multi-sentence input. The user's input is split into - individual sentences, each of which is treated as a completely separate - piece of input. I'm *pretty* sure this is the Right Way(tm). - -version 0.5 - - The filename inside Learn tags can now contain wildcards. Besides - simplifying the loading of multiple files, this allows the possibility - of loading AIML files that may not exist without crashing the - interpreter. - - Attempting to set the value of a predicate in a nonexistent session - now automatically creates the session, instead of silently doing nothing. - - "set" tags now output the new value of the variable, as well as assigning - it. - -version 0.4.1 - - Unknown AIML tags are handled in a more forgiving fashion. If an - unknown tag is encountered, instead of ignoring its contents entirely, - the contents are processed and returned unaltered. - - Added support for "bot name='name'" tags, both in patterns and in - templates. This also fixes a nasty infinite loop crash when a user - says Hello to a bot. - -version 0.4 - - Added support for "star" and "sr" tags. - - Considered adding support for the "secure" tag, but decided against it. - see SUPPORTED_TAGS.txt for more information. - -version 0.3 - - Cleaned up AIML processing code to remove some unnecessary - special-cases in the interpretation algorithm. - - Added support for "input" and "that" tags. - -version 0.2 - - 50% speedup in Kernel.loadBrain() and Kernel.saveBrain(). - - The optional 'learnFiles' and 'commands' arguments to - Kernel.bootstrap() can now be either strings or lists. This - allows multiple files/commands to be loaded during - initialization. - - Added support for "person" and "person2" tags. - - Added general word-substitution functionality. This opens up - the potential for localizing PyAIML into non-English languages. - See DefaultSubs.py for more info. - -version 0.1: - - Initial release. +version 0.8.6 + - Fixed WorbSub module to work with words that consist entirely of punctuation :-). + - Fixed PatternMgr module to replace non-alphanumerics with whitespace instead of simply + consuming them (thanks to Hugh Sasse for the patch). + +version 0.8.5 + - Fixed a couple lingering Unicode bugs, one of which was breaking things + pretty thoroughly under Python 2.2.3. + - Improved whitespace handling, to the point where it should be compliant + with the AIML 1.0.1 standard. Basically, whitespace will be stripped + down to readable levels, unless the xml:space attribute is used to + indicate otherwise. + - Fixed bug in PatternMgr where the character '1' was mistaken identified + as punctuation to be stripped, instead of the intended '!'. + +version 0.8.4: + - Fixed bug in AimlParser creation, if the aiml module was not in the same + directory as the script that imported it. + - Improved Unicode support (again) (thanks to Daniel Kottow for his help). + - 2nd pass at documentation. All functions now have useful, properly-formatted + docstrings. + +version 0.8.3: + - Reworked the way AimlParser objects are created, to allow support for + XML namespaces in a future version. + - First pass at Unicode-proofing the whole system, so that multi-lingual + AIML files can be processed. + - Added support for "index" attribute in "star", "thatstar" and "topicstar" + elements (thanks to Robert D. Cotey for the patch!). Also added type-check + to ensure that the value of the "index" attribute is an integer. + +version 0.8.2: + - Added protection against infinite AIML recursion. + - Removed the deprecated Kernel.getBotName and Kernel.setBotName functions. + - Added workaround for Unicode input crash. Feeding the Kernel Unicode + input no longer crashes the interpreter, but some internal input-formatting + operations must be skipped, which could cause some nonsensical replies + (like you're not already used to nonsensical replies, though...) + +version 0.8.1: + - "system" elements now attempt to intelligently convert between UNIX-style + and Windows-style pathnames as appropriate. For cross-platform compatibility, + all AIML files should use UNIX-style paths inside their "system" elements. + - Fixed crashes under Windows9X when a "system" element is executed when + w9xpopen.exe is unavailable. + - Re-piped most errors and warnings to go to stderr instead of stdout. + - Fixed bug that would cause the the bot to stop responding to any input in a session + if the "that" or "topic" strings were 100% whitespace (but still not empty). + - Fixed bug that would cause multi-line "that" strings to become corrupted. For + example, "Hello there.\nNice to meet you" would become "HELLO THERENICE TO MEET + YOU" when queried for that-matching. + +version 0.8: + - Removed support for non-standard "mode" attribute in "system" elements. + It just wasn't worth breaking the AIML standard for. + - Reworked persistent session support (I warned you!). The old method involving + Kernel.persistentSessions() has been removed. Instead, there is a new + Kernel.getSessionData() method which gives the bot author access to the session + data. You can store this data however you wish. Session data can be restored + later by repeated calls to Kernel.setPredicate(). + - Improved AIML parser error handling; instead of aborting the entire file, a + parse error now only ignores the current category and forges ahead. To check for + parse errors, check the return value of AimlParser.getNumErrors() after parsing. + +version 0.7: + - Further improved AIML parsing; missing or invalid XML attributes are now + detected at parse-time. There's also a first stab at support for Forward + Compatibility Mode: if the "version" attribute of an AIML tag is not 1.0.1, + the parser is much more forgiving of unknown or missing XML tags and attributes. + - Added "support" for the 'gossip' tag. The specific behavior of this tag is + totally undefined; currently, the PyAIML implementation treats it as a big + no-op. Its contents are ignored, and it returns the empty string (but at least + it isn't flagged as a syntax error!) + - Oops; I've implemented 'person' as 'person2' and vice versa this whole time! + Swapped them back; they should each behave correctly now. + - A bit of code cleanup, with an emphasis on using proper XML/AIML terminology + whenever possible. + - Fixed some exception-masking in the 'condition' element processor, which could + prevent AIML parse errors from being reported. + - Added full support for the "bot" tag (previously only the 'bot name="name"' + form was supported). Bot predicates are set using the Kernel.setBotPredicate() + function. Note that Kernel.getBotName() and Kernel.setBotName() have been + deprecated, and will disappear in a future release. + +version 0.6.1: + - Fixed undefined variable exception that was thrown whenever there was no + match for the user's input. + - Fixed an infinite recursion bug caused by processing two or more nested + 'srai' or 'sr' elements. + +version 0.6 + - Completely rewrote the LearnHandler class (which handles all AIML parsing) + to be much less forgiving of incorrect AIML. Currently, any AIML errors + outside of "template" elements should be caught and reported at load-time. + AIML errors inside templates are still not detected until run-time. + - Added support for atomic 'person' and 'person2' tags (they implicitly use + 'star' as their contents if none are provided). + - Oops; Kernel.respond() was DEFINITELY not thread-safe. Now it is, provided + you're using Python's standard 'threading' module. If not, you'll have to + provide your own mutual-exclusion system to ensure that only one thread + is calling Kernel.respond() at a time. + - Recursive tags ('srai' and 'sr') no longer add their intermediate results + to the input and output history. + - EXPERIMENTAL FEATURE: persistent sessions. If enabled using + Kernel.persistentSessions(True), session data will be written to disk + after every response. This lets session data be preserved when the + Kernel is destroyed, at the expense of a small performance hit (all + that extra disk I/O). The semantics of this feature may change in future + releases! + - Added support for the "id" tag (it returns the session ID). + - Added support for the "topic", "topicstar" and "thatstar" tags. + - Commented up the test.py file. + - Added a summary to the end of the Kernel.py self-test (since there are now + too many tests to fit on screen). + - Added support for multi-sentence input. The user's input is split into + individual sentences, each of which is treated as a completely separate + piece of input. I'm *pretty* sure this is the Right Way(tm). + +version 0.5 + - The filename inside Learn tags can now contain wildcards. Besides + simplifying the loading of multiple files, this allows the possibility + of loading AIML files that may not exist without crashing the + interpreter. + - Attempting to set the value of a predicate in a nonexistent session + now automatically creates the session, instead of silently doing nothing. + - "set" tags now output the new value of the variable, as well as assigning + it. + +version 0.4.1 + - Unknown AIML tags are handled in a more forgiving fashion. If an + unknown tag is encountered, instead of ignoring its contents entirely, + the contents are processed and returned unaltered. + - Added support for "bot name='name'" tags, both in patterns and in + templates. This also fixes a nasty infinite loop crash when a user + says Hello to a bot. + +version 0.4 + - Added support for "star" and "sr" tags. + - Considered adding support for the "secure" tag, but decided against it. + see SUPPORTED_TAGS.txt for more information. + +version 0.3 + - Cleaned up AIML processing code to remove some unnecessary + special-cases in the interpretation algorithm. + - Added support for "input" and "that" tags. + +version 0.2 + - 50% speedup in Kernel.loadBrain() and Kernel.saveBrain(). + - The optional 'learnFiles' and 'commands' arguments to + Kernel.bootstrap() can now be either strings or lists. This + allows multiple files/commands to be loaded during + initialization. + - Added support for "person" and "person2" tags. + - Added general word-substitution functionality. This opens up + the potential for localizing PyAIML into non-English languages. + See DefaultSubs.py for more info. + +version 0.1: + - Initial release. diff --git a/README.txt b/README.txt index da031aa..6ffa55f 100644 --- a/README.txt +++ b/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("> ")) diff --git a/SUPPORTED_TAGS.txt b/SUPPORTED_TAGS.txt index 34d0532..3696303 100644 --- a/SUPPORTED_TAGS.txt +++ b/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: - - (see notes) - - - - - - - - -
  • - - - - - - - - - - - - - - - - - - - -Support for the following tags should be implemented in the next version: - - None - -The following tags are not supported: - - (see notes) - / (see notes) - (see notes) - (see notes) - ------------------------------------------------------------------- - -NOTES ON SPECIFIC TAGS: - - -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. - - -The AIML 1.0.1 specification lets engine authors implement the the behavior -of the 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. - - / -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 instead. - - -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 tag. On the bright side, it is possible -to simulate the effects of the tag (i.e. dynamically- -generated tag contents) using the 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 -tag ON A PURELY OPTIONAL BASIS. - - -Some AIML implementations support a non-standard 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 tag. -Therefore, I've decided to drop support for the tag. You can -easily duplicate its effects; simply replace this: - you are allowed -with this: - -
  • you are allowed
  • -
  • you are not allowed
  • -
    -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: + + (see notes) + + + + + + + + +
  • + + + + + + + + + + + + + + + + + + + +Support for the following tags should be implemented in the next version: + + None + +The following tags are not supported: + + (see notes) + / (see notes) + (see notes) + (see notes) + +------------------------------------------------------------------ + +NOTES ON SPECIFIC TAGS: + + +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. + + +The AIML 1.0.1 specification lets engine authors implement the the behavior +of the 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. + + / +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 instead. + + +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 tag. On the bright side, it is possible +to simulate the effects of the tag (i.e. dynamically- +generated tag contents) using the 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 +tag ON A PURELY OPTIONAL BASIS. + + +Some AIML implementations support a non-standard 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 tag. +Therefore, I've decided to drop support for the tag. You can +easily duplicate its effects; simply replace this: + you are allowed +with this: + +
  • you are allowed
  • +
  • you are not allowed
  • +
    +Then, use the Kernel.setPredicate() call to set the "secure" predicate to +"yes" for any session that you wish to be secure. diff --git a/aiml/DefaultSubs.py b/aiml/DefaultSubs.py index ebf3aa2..c9432d8 100644 --- a/aiml/DefaultSubs.py +++ b/aiml/DefaultSubs.py @@ -1,156 +1,156 @@ -"""This file contains the default (English) substitutions for the -PyAIML kernel. These substitutions may be overridden by using the -Kernel.loadSubs(filename) method. The filename specified should refer -to a Windows-style INI file with the following format: - - # lines that start with '#' are comments - - # The 'gender' section contains the substitutions performed by the - # AIML tag, which swaps masculine and feminine pronouns. - [gender] - he = she - she = he - # and so on... - - # The 'person' section contains the substitutions performed by the - # AIML tag, which swaps 1st and 2nd person pronouns. - [person] - I = you - you = I - # and so on... - - # The 'person2' section contains the substitutions performed by - # the AIML tag, which swaps 1st and 3nd person pronouns. - [person2] - I = he - he = I - # and so on... - - # the 'normal' section contains subtitutions run on every input - # string passed into Kernel.respond(). It's mainly used to - # correct common misspellings, and to convert contractions - # ("WHAT'S") into a format that will match an AIML pattern ("WHAT - # IS"). - [normal] - what's = what is -""" - -defaultGender = { - # masculine -> feminine - "he": "she", - "him": "her", - "his": "her", - "himself": "herself", - - # feminine -> masculine - "she": "he", - "her": "him", - "hers": "his", - "herself": "himself", -} - -defaultPerson = { - # 1st->3rd (masculine) - "I": "he", - "me": "him", - "my": "his", - "mine": "his", - "myself": "himself", - - # 3rd->1st (masculine) - "he":"I", - "him":"me", - "his":"my", - "himself":"myself", - - # 3rd->1st (feminine) - "she":"I", - "her":"me", - "hers":"mine", - "herself":"myself", -} - -defaultPerson2 = { - # 1st -> 2nd - "I": "you", - "me": "you", - "my": "your", - "mine": "yours", - "myself": "yourself", - - # 2nd -> 1st - "you": "me", - "your": "my", - "yours": "mine", - "yourself": "myself", -} - - -# TODO: this list is far from complete -defaultNormal = { - "wanna": "want to", - "gonna": "going to", - - "I'm": "I am", - "I'd": "I would", - "I'll": "I will", - "I've": "I have", - "you'd": "you would", - "you're": "you are", - "you've": "you have", - "you'll": "you will", - "he's": "he is", - "he'd": "he would", - "he'll": "he will", - "she's": "she is", - "she'd": "she would", - "she'll": "she will", - "we're": "we are", - "we'd": "we would", - "we'll": "we will", - "we've": "we have", - "they're": "they are", - "they'd": "they would", - "they'll": "they will", - "they've": "they have", - - "y'all": "you all", - - "can't": "can not", - "cannot": "can not", - "couldn't": "could not", - "wouldn't": "would not", - "shouldn't": "should not", - - "isn't": "is not", - "ain't": "is not", - "don't": "do not", - "aren't": "are not", - "won't": "will not", - "weren't": "were not", - "wasn't": "was not", - "didn't": "did not", - "hasn't": "has not", - "hadn't": "had not", - "haven't": "have not", - - "where's": "where is", - "where'd": "where did", - "where'll": "where will", - "who's": "who is", - "who'd": "who did", - "who'll": "who will", - "what's": "what is", - "what'd": "what did", - "what'll": "what will", - "when's": "when is", - "when'd": "when did", - "when'll": "when will", - "why's": "why is", - "why'd": "why did", - "why'll": "why will", - - "it's": "it is", - "it'd": "it would", - "it'll": "it will", -} +"""This file contains the default (English) substitutions for the +PyAIML kernel. These substitutions may be overridden by using the +Kernel.loadSubs(filename) method. The filename specified should refer +to a Windows-style INI file with the following format: + + # lines that start with '#' are comments + + # The 'gender' section contains the substitutions performed by the + # AIML tag, which swaps masculine and feminine pronouns. + [gender] + he = she + she = he + # and so on... + + # The 'person' section contains the substitutions performed by the + # AIML tag, which swaps 1st and 2nd person pronouns. + [person] + I = you + you = I + # and so on... + + # The 'person2' section contains the substitutions performed by + # the AIML tag, which swaps 1st and 3nd person pronouns. + [person2] + I = he + he = I + # and so on... + + # the 'normal' section contains subtitutions run on every input + # string passed into Kernel.respond(). It's mainly used to + # correct common misspellings, and to convert contractions + # ("WHAT'S") into a format that will match an AIML pattern ("WHAT + # IS"). + [normal] + what's = what is +""" + +defaultGender = { + # masculine -> feminine + "he": "she", + "him": "her", + "his": "her", + "himself": "herself", + + # feminine -> masculine + "she": "he", + "her": "him", + "hers": "his", + "herself": "himself", +} + +defaultPerson = { + # 1st->3rd (masculine) + "I": "he", + "me": "him", + "my": "his", + "mine": "his", + "myself": "himself", + + # 3rd->1st (masculine) + "he":"I", + "him":"me", + "his":"my", + "himself":"myself", + + # 3rd->1st (feminine) + "she":"I", + "her":"me", + "hers":"mine", + "herself":"myself", +} + +defaultPerson2 = { + # 1st -> 2nd + "I": "you", + "me": "you", + "my": "your", + "mine": "yours", + "myself": "yourself", + + # 2nd -> 1st + "you": "me", + "your": "my", + "yours": "mine", + "yourself": "myself", +} + + +# TODO: this list is far from complete +defaultNormal = { + "wanna": "want to", + "gonna": "going to", + + "I'm": "I am", + "I'd": "I would", + "I'll": "I will", + "I've": "I have", + "you'd": "you would", + "you're": "you are", + "you've": "you have", + "you'll": "you will", + "he's": "he is", + "he'd": "he would", + "he'll": "he will", + "she's": "she is", + "she'd": "she would", + "she'll": "she will", + "we're": "we are", + "we'd": "we would", + "we'll": "we will", + "we've": "we have", + "they're": "they are", + "they'd": "they would", + "they'll": "they will", + "they've": "they have", + + "y'all": "you all", + + "can't": "can not", + "cannot": "can not", + "couldn't": "could not", + "wouldn't": "would not", + "shouldn't": "should not", + + "isn't": "is not", + "ain't": "is not", + "don't": "do not", + "aren't": "are not", + "won't": "will not", + "weren't": "were not", + "wasn't": "was not", + "didn't": "did not", + "hasn't": "has not", + "hadn't": "had not", + "haven't": "have not", + + "where's": "where is", + "where'd": "where did", + "where'll": "where will", + "who's": "who is", + "who'd": "who did", + "who'll": "who will", + "what's": "what is", + "what'd": "what did", + "what'll": "what will", + "when's": "when is", + "when'd": "when did", + "when'll": "when will", + "why's": "why is", + "why'd": "why did", + "why'll": "why will", + + "it's": "it is", + "it'd": "it would", + "it'll": "it will", +} diff --git a/aiml/Utils.py b/aiml/Utils.py index e5ea9e4..0118447 100644 --- a/aiml/Utils.py +++ b/aiml/Utils.py @@ -1,32 +1,32 @@ -"""This file contains assorted general utility functions used by other -modules in the PyAIML package. - -""" - -def sentences(s): - """Split the string s into a list of sentences.""" - try: s+"" - except: raise TypeError, "s must be a string" - pos = 0 - sentenceList = [] - l = len(s) - while pos < l: - try: p = s.index('.', pos) - except: p = l+1 - try: q = s.index('?', pos) - except: q = l+1 - try: e = s.index('!', pos) - except: e = l+1 - end = min(p,q,e) - sentenceList.append( s[pos:end].strip() ) - pos = end+1 - # If no sentences were found, return a one-item list containing - # the entire input string. - if len(sentenceList) == 0: sentenceList.append(s) - return sentenceList - -# Self test -if __name__ == "__main__": - # sentences - sents = sentences("First. Second, still? Third and Final! Well, not really") - assert(len(sents) == 4) +"""This file contains assorted general utility functions used by other +modules in the PyAIML package. + +""" + +def sentences(s): + """Split the string s into a list of sentences.""" + try: s+"" + except: raise TypeError, "s must be a string" + pos = 0 + sentenceList = [] + l = len(s) + while pos < l: + try: p = s.index('.', pos) + except: p = l+1 + try: q = s.index('?', pos) + except: q = l+1 + try: e = s.index('!', pos) + except: e = l+1 + end = min(p,q,e) + sentenceList.append( s[pos:end].strip() ) + pos = end+1 + # If no sentences were found, return a one-item list containing + # the entire input string. + if len(sentenceList) == 0: sentenceList.append(s) + return sentenceList + +# Self test +if __name__ == "__main__": + # sentences + sents = sentences("First. Second, still? Third and Final! Well, not really") + assert(len(sents) == 4) diff --git a/aiml/WordSub.py b/aiml/WordSub.py index e191a6f..c037455 100644 --- a/aiml/WordSub.py +++ b/aiml/WordSub.py @@ -1,98 +1,98 @@ -"""This module implements the WordSub class, modelled after a recipe -in "Python Cookbook" (Recipe 3.14, "Replacing Multiple Patterns in a -Single Pass" by Xavier Defrang). - -Usage: -Use this class like a dictionary to add before/after pairs: - > subber = TextSub() - > subber["before"] = "after" - > subber["begin"] = "end" -Use the sub() method to perform the substitution: - > print subber.sub("before we begin") - after we end -All matching is intelligently case-insensitive: - > print subber.sub("Before we BEGIN") - After we END -The 'before' words must be complete words -- no prefixes. -The following example illustrates this point: - > subber["he"] = "she" - > print subber.sub("he says he'd like to help her") - she says she'd like to help her -Note that "he" and "he'd" were replaced, but "help" and "her" were -not. -""" - -# 'dict' objects weren't available to subclass from until version 2.2. -# Get around this by importing UserDict.UserDict if the built-in dict -# object isn't available. -try: dict -except: from UserDict import UserDict as dict - -import ConfigParser -import re -import string - -class WordSub(dict): - """All-in-one multiple-string-substitution class.""" - - def _wordToRegex(self, word): - """Convert a word to a regex object which matches the word.""" - if word != "" and word[0].isalpha() and word[-1].isalpha(): - return "\\b%s\\b" % re.escape(word) - else: - return r"\b%s\b" % re.escape(word) - - def _update_regex(self): - """Build re object based on the keys of the current - dictionary. - - """ - self._regex = re.compile("|".join(map(self._wordToRegex, self.keys()))) - self._regexIsDirty = False - - def __init__(self, defaults = {}): - """Initialize the object, and populate it with the entries in - the defaults dictionary. - - """ - self._regex = None - self._regexIsDirty = True - for k,v in defaults.items(): - self[k] = v - - def __call__(self, match): - """Handler invoked for each regex match.""" - return self[match.group(0)] - - def __setitem__(self, i, y): - self._regexIsDirty = True - # for each entry the user adds, we actually add three entrys: - super(type(self),self).__setitem__(string.lower(i),string.lower(y)) # key = value - super(type(self),self).__setitem__(string.capwords(i), string.capwords(y)) # Key = Value - super(type(self),self).__setitem__(string.upper(i), string.upper(y)) # KEY = VALUE - - def sub(self, text): - """Translate text, returns the modified text.""" - if self._regexIsDirty: - self._update_regex() - return self._regex.sub(self, text) - -# self-test -if __name__ == "__main__": - subber = WordSub() - subber["apple"] = "banana" - subber["orange"] = "pear" - subber["banana" ] = "apple" - subber["he"] = "she" - subber["I'd"] = "I would" - - # test case insensitivity - inStr = "I'd like one apple, one Orange and one BANANA." - outStr = "I Would like one banana, one Pear and one APPLE." - if subber.sub(inStr) == outStr: print "Test #1 PASSED" - else: print "Test #1 FAILED: '%s'" % subber.sub(inStr) - - inStr = "He said he'd like to go with me" - outStr = "She said she'd like to go with me" - if subber.sub(inStr) == outStr: print "Test #2 PASSED" - else: print "Test #2 FAILED: '%s'" % subber.sub(inStr) +"""This module implements the WordSub class, modelled after a recipe +in "Python Cookbook" (Recipe 3.14, "Replacing Multiple Patterns in a +Single Pass" by Xavier Defrang). + +Usage: +Use this class like a dictionary to add before/after pairs: + > subber = TextSub() + > subber["before"] = "after" + > subber["begin"] = "end" +Use the sub() method to perform the substitution: + > print subber.sub("before we begin") + after we end +All matching is intelligently case-insensitive: + > print subber.sub("Before we BEGIN") + After we END +The 'before' words must be complete words -- no prefixes. +The following example illustrates this point: + > subber["he"] = "she" + > print subber.sub("he says he'd like to help her") + she says she'd like to help her +Note that "he" and "he'd" were replaced, but "help" and "her" were +not. +""" + +# 'dict' objects weren't available to subclass from until version 2.2. +# Get around this by importing UserDict.UserDict if the built-in dict +# object isn't available. +try: dict +except: from UserDict import UserDict as dict + +import ConfigParser +import re +import string + +class WordSub(dict): + """All-in-one multiple-string-substitution class.""" + + def _wordToRegex(self, word): + """Convert a word to a regex object which matches the word.""" + if word != "" and word[0].isalpha() and word[-1].isalpha(): + return "\\b%s\\b" % re.escape(word) + else: + return r"\b%s\b" % re.escape(word) + + def _update_regex(self): + """Build re object based on the keys of the current + dictionary. + + """ + self._regex = re.compile("|".join(map(self._wordToRegex, self.keys()))) + self._regexIsDirty = False + + def __init__(self, defaults = {}): + """Initialize the object, and populate it with the entries in + the defaults dictionary. + + """ + self._regex = None + self._regexIsDirty = True + for k,v in defaults.items(): + self[k] = v + + def __call__(self, match): + """Handler invoked for each regex match.""" + return self[match.group(0)] + + def __setitem__(self, i, y): + self._regexIsDirty = True + # for each entry the user adds, we actually add three entrys: + super(type(self),self).__setitem__(string.lower(i),string.lower(y)) # key = value + super(type(self),self).__setitem__(string.capwords(i), string.capwords(y)) # Key = Value + super(type(self),self).__setitem__(string.upper(i), string.upper(y)) # KEY = VALUE + + def sub(self, text): + """Translate text, returns the modified text.""" + if self._regexIsDirty: + self._update_regex() + return self._regex.sub(self, text) + +# self-test +if __name__ == "__main__": + subber = WordSub() + subber["apple"] = "banana" + subber["orange"] = "pear" + subber["banana" ] = "apple" + subber["he"] = "she" + subber["I'd"] = "I would" + + # test case insensitivity + inStr = "I'd like one apple, one Orange and one BANANA." + outStr = "I Would like one banana, one Pear and one APPLE." + if subber.sub(inStr) == outStr: print "Test #1 PASSED" + else: print "Test #1 FAILED: '%s'" % subber.sub(inStr) + + inStr = "He said he'd like to go with me" + outStr = "She said she'd like to go with me" + if subber.sub(inStr) == outStr: print "Test #2 PASSED" + else: print "Test #2 FAILED: '%s'" % subber.sub(inStr) diff --git a/aimlvalidate.py b/aimlvalidate.py index f86efad..21c0289 100644 --- a/aimlvalidate.py +++ b/aimlvalidate.py @@ -1,60 +1,60 @@ -""" -Python AIML Validator, v1.1 -Author: Cort Stratton (cort@users.sourceforge.net) - -Usage: - aimlvalidate.py file1.aiml [file2.aiml ...] -""" - -# Revision history: -# -# 1.0.1: Redirected stderr to stdout -# 1.0: Initial release - -import aiml -import glob -import sys -import xml.sax - -if __name__ == "__main__": - # Need input file(s)! - if len(sys.argv) < 2: - print __doc__ - sys.exit(2) - - # AimlParser prints its errors to stderr; we redirect stderr to stdout. - sys.stderr = sys.stdout - - # Iterate over input files - validCount = 0 - docCount = 0 - for arg in sys.argv[1:]: - # Input files can contain wildcards; iterate over matches - for f in glob.glob(arg): - parser = xml.sax.make_parser(["aiml.AimlParser"]) - handler = parser.getContentHandler() - docCount += 1 - print "%s:" % f - try: - # Attempt to parse the file. - parser.parse(f) - # Check the number of parse errors. - if handler.getNumErrors() == 0: - validCount += 1 - print "PASSED\n" - else: - print "FAILED\n" - except xml.sax.SAXParseException, msg: - # These errors occur if the document does not contain - # well-formed XML (e.g. open or unbalanced tags). If - # they occur, parsing the whole document is aborted - # immediately. - print "FATAL ERROR: %s\n" % msg - - # Print final results - print "%d out of %d documents are AIML 1.0.1 compliant." % (validCount, docCount) - if docCount == validCount: - print "Congratulations!" - else: - print """For help resolving syntax errors, refer to the AIML 1.0.1 specification -available on the web at: http://alicebot.org/TR/2001/WD-aiml""" +""" +Python AIML Validator, v1.1 +Author: Cort Stratton (cort@users.sourceforge.net) + +Usage: + aimlvalidate.py file1.aiml [file2.aiml ...] +""" + +# Revision history: +# +# 1.0.1: Redirected stderr to stdout +# 1.0: Initial release + +import aiml +import glob +import sys +import xml.sax + +if __name__ == "__main__": + # Need input file(s)! + if len(sys.argv) < 2: + print __doc__ + sys.exit(2) + + # AimlParser prints its errors to stderr; we redirect stderr to stdout. + sys.stderr = sys.stdout + + # Iterate over input files + validCount = 0 + docCount = 0 + for arg in sys.argv[1:]: + # Input files can contain wildcards; iterate over matches + for f in glob.glob(arg): + parser = xml.sax.make_parser(["aiml.AimlParser"]) + handler = parser.getContentHandler() + docCount += 1 + print "%s:" % f + try: + # Attempt to parse the file. + parser.parse(f) + # Check the number of parse errors. + if handler.getNumErrors() == 0: + validCount += 1 + print "PASSED\n" + else: + print "FAILED\n" + except xml.sax.SAXParseException, msg: + # These errors occur if the document does not contain + # well-formed XML (e.g. open or unbalanced tags). If + # they occur, parsing the whole document is aborted + # immediately. + print "FATAL ERROR: %s\n" % msg + + # Print final results + print "%d out of %d documents are AIML 1.0.1 compliant." % (validCount, docCount) + if docCount == validCount: + print "Congratulations!" + else: + print """For help resolving syntax errors, refer to the AIML 1.0.1 specification +available on the web at: http://alicebot.org/TR/2001/WD-aiml""" diff --git a/standard/dev-calendar.aiml b/standard/dev-calendar.aiml index c0dc127..ae950d1 100644 --- a/standard/dev-calendar.aiml +++ b/standard/dev-calendar.aiml @@ -1,127 +1,127 @@ - - - - - - - - - - - - - -WHAT IS THE DATE - - - - -WHAT IS TODAY - - - - -WHAT TIME IS IT - - - - + + + + + + + + + + + + + +WHAT IS THE DATE + + + + +WHAT IS TODAY + + + + +WHAT TIME IS IT + + + + diff --git a/standard/dev-examples.aiml b/standard/dev-examples.aiml index f0fa600..1f70c3e 100644 --- a/standard/dev-examples.aiml +++ b/standard/dev-examples.aiml @@ -1,279 +1,279 @@ - - - - - - - - - - - - - -BOT HOW MUCH IS * - - - - -EVALUATE * - - - - -TEST GET - - - - -TEST SET - - - - -TEST JAVASCRIPT - - - - -WHAT IS THE INACTIVITY COUNT - - - - -INCREASE INACTIVITY COUNT - - - - -DECREASE INACTIVITY COUNT - - - - -TEST INACTIVITY - - - - -MY FAVORITE FOOD IS * - - - - -WHAT IS MY FAVORITE FOOD - - - - -PRINT THIS PAGE - - - - -ADD A NEW PERSON - - - - -* -WHAT IS THE NAME OF THE PERSON - - - - -* -WHAT IS THE ADDRESS OF THE PERSON - - - - -WHAT IS THE NAME OF THE NEW PERSON - - - - -WHAT IS THE ADDRESS OF THE NEW PERSON - - - - -DO IF EXIST TEST - - - - -* IS ONE OF MY KIDS - - - - -WHO ARE MY KIDS - - - - -YOU ARE PRETTY COOL - - - - -SPILL GOSSIP - - - - -GET A QUOTE FOR ORACLE - - - - -GET A QUOTE FOR MICROSOFT - - - - -GET A QUOTE FOR NUANCE - - - - -GET A QUOTE FOR * - - - - -GET A CHART FOR * - - - - -WHAT IS AN EGG - - - - -LEARN IT - - - - -SHOW ME SLASHDOT - - - - -START TIMER - - - - -KILL TIMER - - - - -LEARN SOMETHING - - - - -SHOW ME A WINDOW - - - - -YES -FOOBAR - - - - - + + + + + + + + + + + + + +BOT HOW MUCH IS * + + + + +EVALUATE * + + + + +TEST GET + + + + +TEST SET + + + + +TEST JAVASCRIPT + + + + +WHAT IS THE INACTIVITY COUNT + + + + +INCREASE INACTIVITY COUNT + + + + +DECREASE INACTIVITY COUNT + + + + +TEST INACTIVITY + + + + +MY FAVORITE FOOD IS * + + + + +WHAT IS MY FAVORITE FOOD + + + + +PRINT THIS PAGE + + + + +ADD A NEW PERSON + + + + +* +WHAT IS THE NAME OF THE PERSON + + + + +* +WHAT IS THE ADDRESS OF THE PERSON + + + + +WHAT IS THE NAME OF THE NEW PERSON + + + + +WHAT IS THE ADDRESS OF THE NEW PERSON + + + + +DO IF EXIST TEST + + + + +* IS ONE OF MY KIDS + + + + +WHO ARE MY KIDS + + + + +YOU ARE PRETTY COOL + + + + +SPILL GOSSIP + + + + +GET A QUOTE FOR ORACLE + + + + +GET A QUOTE FOR MICROSOFT + + + + +GET A QUOTE FOR NUANCE + + + + +GET A QUOTE FOR * + + + + +GET A CHART FOR * + + + + +WHAT IS AN EGG + + + + +LEARN IT + + + + +SHOW ME SLASHDOT + + + + +START TIMER + + + + +KILL TIMER + + + + +LEARN SOMETHING + + + + +SHOW ME A WINDOW + + + + +YES +FOOBAR + + + + + diff --git a/standard/dev-scripts.aiml b/standard/dev-scripts.aiml index e382b50..9f67a96 100644 --- a/standard/dev-scripts.aiml +++ b/standard/dev-scripts.aiml @@ -1,130 +1,130 @@ - - - - - - - - - - - - -TELL BOT AGE - - - - -what does * mean - - - - -WHAT IS THE DEFINITION OF * - - - - -SELECT * - - - - + + + + + + + + + + + + +TELL BOT AGE + + + + +what does * mean + + + + +WHAT IS THE DEFINITION OF * + + + + +SELECT * + + + + diff --git a/standard/dev-testcases.aiml b/standard/dev-testcases.aiml index 470bacd..b9cca56 100644 --- a/standard/dev-testcases.aiml +++ b/standard/dev-testcases.aiml @@ -1,1536 +1,1536 @@ - - - - - - - - - - - - - - - - -TESTATOMIC - - - - - - -TESTDISPLAYSET - - - - - - -TESTHIDE - - - - - - -TESTGET - - - - - - -TESTSETX - - - - - - -TESTALTER - - - - - - -TESTSETTOPIC - - - - - -TEST6A -TEST PASSED TOPIC 2 - - - - -TEST6B - - - - - - - - -TESTSIMPLECONDITION - - - - -TESTSIMPLECONDITIONA - - - - -BLINDSETMATCH - - - - -BLINDSETNOMATCH - - - - - - -TESTSIMPLECONDITIONMATCH - - - - - - - -TESTCONDITIONLIST - - - - - - -TESTCONDITIONLISTMATCH - - - - - - - -TESTCONDITIONLISTDEFAULT - - - - - - -TESTCONDITIONLISTNAME - - - - - - -TESTCONDITIONLISTNAMEMATCH - - - - - - -TESTSTAR * - - - - - - -TESTSTAR * AND * AND * AND * - - - - - - -TESTUNDERSCORE _ AND _ AND _ AND _ - - - - - - - -TESTRANDOM - - - - - - -TESTWORDFORMAT - - - - - - -TESTNESTEDWORDFORMAT - - - - - - -TESTSIMPLEMULTISENTENCETHAT - - - - -TESTTHAT - - - - - - -TESTARRAY4MULTISENTENCETHAT - - - - -TESTARRAY3MULTISENTENCETHAT - - - - -TESTARRAY2MULTISENTENCETHAT - - - - -TESTARRAY1MULTISENTENCETHAT - - - - -TESTTHATARRAY - - - - - - -TESTBOTPROPERTIES - - - - - - -TESTCONDITIONSETVALUE - - - - - - - - - -TESTNESTEDCONDITION - - - - -TESTNESTEDCONDITION1 - - - - -TESTNESTEDCONDITION2 - - - - - - -TESTSETCONDITION - - - - - - -TESTVERSION - - - - - - -TESTSRAI - - - - -SRAISUCCEEDED - - - - - - -TESTSR * - - - - - - -TESTNESTEDSRAI - - - - -SRAINESTED - - - - - - -TESTTHINKSRAI - - - - -TSRAI - - - - - - -TESTSTARSET * - - - - - - -TESTIDSIZEDATE - - - - - - -TESTGOSSIP - - - - - - -TESTNAME - - - - - - -TESTINPUT3 - - - - -TESTINPUT - - - - -TESTINPUT1 - - - - -TESTINPUT2 - - - - - - -TESTGENDER * - - - - - - - -TESTTHATSTAR - - - - -TESTTHATSTAR1 -CHECK NEXT TO SEE IF * - - - - - - - -TESTMULTITHATSTAR - - - - -TESTMULTITHATSTAR1 -SEE WHETHER * AND WHETHER * AND WHETHER * NEXT - - - - - - -TESTTOPICSTAR - - - - - -TEST34 - - - - - - - - -TESTMULTITOPICSTAR - - - - - -TEST35 - - - - - - - - -TESTOLDTOPIC - - - - - -TEST36 - - - - - - - - -TESTEXTREMESRAI - - - - -SRAI20 - - - - -SRAI19 - - - - -SRAI18 - - - - -SRAI17 - - - - -SRAI16 - - - - -SRAI15 - - - - -SRAI14 - - - - -SRAI13 - - - - -SRAI12 - - - - -SRAI11 - - - - -SRAI10 - - - - -SRAI9 - - - - -SRAI8 - - - - -SRAI7 - - - - -SRAI6 - - - - -SRAI5 - - - - -SRAI4 - - - - -SRAI3 - - - - -SRAI2 - - - - -SRAI1 - - - - - - - -TESTPERSON * - - - - - - - -TESTPERSON2 * - - - - + + + + + + + + + + + + + + + + +TESTATOMIC + + + + + + +TESTDISPLAYSET + + + + + + +TESTHIDE + + + + + + +TESTGET + + + + + + +TESTSETX + + + + + + +TESTALTER + + + + + + +TESTSETTOPIC + + + + + +TEST6A +TEST PASSED TOPIC 2 + + + + +TEST6B + + + + + + + + +TESTSIMPLECONDITION + + + + +TESTSIMPLECONDITIONA + + + + +BLINDSETMATCH + + + + +BLINDSETNOMATCH + + + + + + +TESTSIMPLECONDITIONMATCH + + + + + + + +TESTCONDITIONLIST + + + + + + +TESTCONDITIONLISTMATCH + + + + + + + +TESTCONDITIONLISTDEFAULT + + + + + + +TESTCONDITIONLISTNAME + + + + + + +TESTCONDITIONLISTNAMEMATCH + + + + + + +TESTSTAR * + + + + + + +TESTSTAR * AND * AND * AND * + + + + + + +TESTUNDERSCORE _ AND _ AND _ AND _ + + + + + + + +TESTRANDOM + + + + + + +TESTWORDFORMAT + + + + + + +TESTNESTEDWORDFORMAT + + + + + + +TESTSIMPLEMULTISENTENCETHAT + + + + +TESTTHAT + + + + + + +TESTARRAY4MULTISENTENCETHAT + + + + +TESTARRAY3MULTISENTENCETHAT + + + + +TESTARRAY2MULTISENTENCETHAT + + + + +TESTARRAY1MULTISENTENCETHAT + + + + +TESTTHATARRAY + + + + + + +TESTBOTPROPERTIES + + + + + + +TESTCONDITIONSETVALUE + + + + + + + + + +TESTNESTEDCONDITION + + + + +TESTNESTEDCONDITION1 + + + + +TESTNESTEDCONDITION2 + + + + + + +TESTSETCONDITION + + + + + + +TESTVERSION + + + + + + +TESTSRAI + + + + +SRAISUCCEEDED + + + + + + +TESTSR * + + + + + + +TESTNESTEDSRAI + + + + +SRAINESTED + + + + + + +TESTTHINKSRAI + + + + +TSRAI + + + + + + +TESTSTARSET * + + + + + + +TESTIDSIZEDATE + + + + + + +TESTGOSSIP + + + + + + +TESTNAME + + + + + + +TESTINPUT3 + + + + +TESTINPUT + + + + +TESTINPUT1 + + + + +TESTINPUT2 + + + + + + +TESTGENDER * + + + + + + + +TESTTHATSTAR + + + + +TESTTHATSTAR1 +CHECK NEXT TO SEE IF * + + + + + + + +TESTMULTITHATSTAR + + + + +TESTMULTITHATSTAR1 +SEE WHETHER * AND WHETHER * AND WHETHER * NEXT + + + + + + +TESTTOPICSTAR + + + + + +TEST34 + + + + + + + + +TESTMULTITOPICSTAR + + + + + +TEST35 + + + + + + + + +TESTOLDTOPIC + + + + + +TEST36 + + + + + + + + +TESTEXTREMESRAI + + + + +SRAI20 + + + + +SRAI19 + + + + +SRAI18 + + + + +SRAI17 + + + + +SRAI16 + + + + +SRAI15 + + + + +SRAI14 + + + + +SRAI13 + + + + +SRAI12 + + + + +SRAI11 + + + + +SRAI10 + + + + +SRAI9 + + + + +SRAI8 + + + + +SRAI7 + + + + +SRAI6 + + + + +SRAI5 + + + + +SRAI4 + + + + +SRAI3 + + + + +SRAI2 + + + + +SRAI1 + + + + + + + +TESTPERSON * + + + + + + + +TESTPERSON2 * + + + + diff --git a/standard/dev-translation.aiml b/standard/dev-translation.aiml index 125d13f..8e54d4d 100644 --- a/standard/dev-translation.aiml +++ b/standard/dev-translation.aiml @@ -1,288 +1,288 @@ - - - - - - - - - - - - - -SAY * TO ME IN SPANISH - - - - -SAY * TO ME IN GERMAN - - - - -SAY * TO ME IN FRENCH - - - - -SAY * TO ME IN ITALIAN - - - - -SAY * TO ME IN JAPANESE - - - - -WHAT IS SPANISH FOR * - - - - -WHAT IS GERMAN FOR * - - - - -WHAT IS FRENCH FOR * - - - - -WHAT IS ITALIAN FOR * - - - - -WHAT IS JAPANESE FOR * - - - - -SAY * IN SPANISH -