├── .classpath ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── bin └── codeanticode │ └── chatbots │ ├── alice │ ├── Alice.class │ ├── AliceBot.class │ ├── AliceBotMother.class │ ├── Context.class │ ├── ContextPropertyChangeListener.class │ ├── ContextRandomSeedChangeListener.class │ ├── ContextTopicChangeListener.class │ ├── Graphmaster.class │ ├── GraphmasterMother.class │ ├── Logger.class │ ├── Match$Section.class │ ├── Match.class │ ├── aiml │ │ ├── AIMLElement.class │ │ ├── AIMLHandler.class │ │ ├── AIMLParser.class │ │ ├── AIMLParserConfigurationException.class │ │ ├── AIMLParserException.class │ │ ├── AIMLStack.class │ │ ├── Aiml.class │ │ ├── Bot.class │ │ ├── Category.class │ │ ├── Condition.class │ │ ├── Date.class │ │ ├── Formal.class │ │ ├── Gender.class │ │ ├── Get.class │ │ ├── Gossip.class │ │ ├── Id.class │ │ ├── Input.class │ │ ├── Javascript.class │ │ ├── Learn.class │ │ ├── Li.class │ │ ├── Lowercase.class │ │ ├── Pattern.class │ │ ├── Person.class │ │ ├── Person2.class │ │ ├── Random.class │ │ ├── Sentence.class │ │ ├── Set.class │ │ ├── Size.class │ │ ├── Sr.class │ │ ├── Srai.class │ │ ├── Star.class │ │ ├── System.class │ │ ├── Template.class │ │ ├── TemplateElement.class │ │ ├── Text.class │ │ ├── That.class │ │ ├── Thatstar.class │ │ ├── Think.class │ │ ├── Topic.class │ │ ├── Topicstar.class │ │ ├── Uppercase.class │ │ └── Version.class │ ├── config │ │ ├── ConfigException.class │ │ ├── TokenizerConfig.class │ │ └── TokenizerConfigStream.class │ ├── parser │ │ ├── AliceBotParser.class │ │ ├── AliceBotParserConfigurationException.class │ │ ├── AliceBotParserException.class │ │ ├── ContextParser$ContextHandler.class │ │ ├── ContextParser.class │ │ ├── ReflectionBuilder.class │ │ ├── ReflectionHandler.class │ │ ├── SplitterHandler.class │ │ ├── SubstitutionBuilder.class │ │ └── TransformationsParser.class │ ├── script │ │ ├── Interpreter.class │ │ └── InterpretingException.class │ ├── text │ │ ├── Request.class │ │ ├── Response.class │ │ ├── Sentence.class │ │ ├── SentenceSplitter.class │ │ ├── Substitution$FindReplaceFragment.class │ │ ├── Substitution$FindReplaceOperation.class │ │ ├── Substitution$FindReplacePrefix.class │ │ ├── Substitution$FindReplaceSuffix.class │ │ ├── Substitution$FindReplaceWord.class │ │ ├── Substitution.class │ │ ├── Tokenizer.class │ │ ├── TokenizerMother.class │ │ ├── Transformations$Mapper.class │ │ ├── Transformations.class │ │ └── TransformationsMother.class │ └── util │ │ ├── Escaper.class │ │ ├── Searcher.class │ │ ├── Sequence.class │ │ └── SequenceMother.class │ ├── base │ └── Base.class │ ├── eliza │ ├── Decomp.class │ ├── DecompList.class │ ├── EString.class │ ├── Eliza.class │ ├── Key.class │ ├── KeyList.class │ ├── KeyStack.class │ ├── Mem.class │ ├── PrePost.class │ ├── PrePostList.class │ ├── ReasembList.class │ ├── SynList.class │ ├── WordList.class │ └── eliza.script │ └── rebecca │ └── Rebecca.class ├── distribution ├── chatbots.zip ├── src │ └── codeanticode │ │ └── chatbots │ │ ├── alice │ │ ├── Alice.java │ │ ├── AliceBot.java │ │ ├── AliceBotMother.java │ │ ├── Context.java │ │ ├── ContextPropertyChangeListener.java │ │ ├── ContextRandomSeedChangeListener.java │ │ ├── ContextTopicChangeListener.java │ │ ├── Graphmaster.java │ │ ├── GraphmasterMother.java │ │ ├── Logger.java │ │ ├── Match.java │ │ ├── aiml │ │ │ ├── AIMLElement.java │ │ │ ├── AIMLHandler.java │ │ │ ├── AIMLParser.java │ │ │ ├── AIMLParserConfigurationException.java │ │ │ ├── AIMLParserException.java │ │ │ ├── AIMLStack.java │ │ │ ├── Aiml.java │ │ │ ├── Bot.java │ │ │ ├── Category.java │ │ │ ├── Condition.java │ │ │ ├── Date.java │ │ │ ├── Formal.java │ │ │ ├── Gender.java │ │ │ ├── Get.java │ │ │ ├── Gossip.java │ │ │ ├── Id.java │ │ │ ├── Input.java │ │ │ ├── Javascript.java │ │ │ ├── Learn.java │ │ │ ├── Li.java │ │ │ ├── Lowercase.java │ │ │ ├── Pattern.java │ │ │ ├── Person.java │ │ │ ├── Person2.java │ │ │ ├── Random.java │ │ │ ├── Sentence.java │ │ │ ├── Set.java │ │ │ ├── Size.java │ │ │ ├── Sr.java │ │ │ ├── Srai.java │ │ │ ├── Star.java │ │ │ ├── System.java │ │ │ ├── Template.java │ │ │ ├── TemplateElement.java │ │ │ ├── Text.java │ │ │ ├── That.java │ │ │ ├── Thatstar.java │ │ │ ├── Think.java │ │ │ ├── Topic.java │ │ │ ├── Topicstar.java │ │ │ ├── Uppercase.java │ │ │ └── Version.java │ │ ├── config │ │ │ ├── ConfigException.java │ │ │ ├── TokenizerConfig.java │ │ │ └── TokenizerConfigStream.java │ │ ├── parser │ │ │ ├── AliceBotParser.java │ │ │ ├── AliceBotParserConfigurationException.java │ │ │ ├── AliceBotParserException.java │ │ │ ├── ContextParser.java │ │ │ ├── ReflectionBuilder.java │ │ │ ├── ReflectionHandler.java │ │ │ ├── SplitterHandler.java │ │ │ ├── SubstitutionBuilder.java │ │ │ └── TransformationsParser.java │ │ ├── script │ │ │ ├── Interpreter.java │ │ │ └── InterpretingException.java │ │ ├── text │ │ │ ├── Request.java │ │ │ ├── Response.java │ │ │ ├── Sentence.java │ │ │ ├── SentenceSplitter.java │ │ │ ├── Substitution.java │ │ │ ├── Tokenizer.java │ │ │ ├── TokenizerMother.java │ │ │ ├── Transformations.java │ │ │ └── TransformationsMother.java │ │ └── util │ │ │ ├── Escaper.java │ │ │ ├── Searcher.java │ │ │ ├── Sequence.java │ │ │ └── SequenceMother.java │ │ ├── base │ │ └── Base.java │ │ ├── eliza │ │ ├── Decomp.java │ │ ├── DecompList.java │ │ ├── EString.java │ │ ├── Eliza.java │ │ ├── Key.java │ │ ├── KeyList.java │ │ ├── KeyStack.java │ │ ├── Mem.java │ │ ├── PrePost.java │ │ ├── PrePostList.java │ │ ├── ReasembList.java │ │ ├── SynList.java │ │ └── WordList.java │ │ └── rebecca │ │ └── Rebecca.java └── web │ ├── download │ └── chatbots.zip │ ├── examples │ ├── AliceChat │ │ ├── AliceChat.pde │ │ └── data │ │ │ ├── Alice │ │ │ ├── Again.aiml │ │ │ ├── Alice.aiml │ │ │ ├── Astrology.aiml │ │ │ ├── Gender.aiml │ │ │ ├── Learn │ │ │ │ └── Learned.aiml │ │ │ ├── Person.aiml │ │ │ ├── Person2.aiml │ │ │ ├── alice.txt │ │ │ ├── condition.aiml │ │ │ ├── empty_wildcard.aiml │ │ │ ├── id.aiml │ │ │ ├── learn.aiml │ │ │ ├── random.aiml │ │ │ ├── thatstar.aiml │ │ │ ├── thattopic.aiml │ │ │ ├── topicstar.aiml │ │ │ └── version.aiml │ │ │ ├── Rockwell-24.vlw │ │ │ ├── context.xml │ │ │ ├── properties.xml │ │ │ ├── splitters.xml │ │ │ └── substitutions.xml │ ├── ElizaChat │ │ ├── ElizaChat.pde │ │ └── data │ │ │ └── Rockwell-24.vlw │ └── RebeccaChat │ │ ├── RebeccaChat.pde │ │ └── data │ │ ├── Rockwell-24.vlw │ │ └── rebecca │ │ ├── AI.aiml │ │ ├── ALICE.aiml │ │ ├── Adverbs.aiml │ │ ├── Astrology.aiml │ │ ├── Atomic.aiml │ │ ├── Biography.aiml │ │ ├── Bot.aiml │ │ ├── Botmaster.aiml │ │ ├── Client.aiml │ │ ├── Computers.aiml │ │ ├── Date.aiml │ │ ├── Default.aiml │ │ ├── Drugs.aiml │ │ ├── Emotion.aiml │ │ ├── Food.aiml │ │ ├── Geography.aiml │ │ ├── Gossip.aiml │ │ ├── History.aiml │ │ ├── Humor.aiml │ │ ├── IU.aiml │ │ ├── Inquiry.aiml │ │ ├── Interjection.aiml │ │ ├── Knowledge.aiml │ │ ├── Literature.aiml │ │ ├── Money.aiml │ │ ├── Movies.aiml │ │ ├── Music.aiml │ │ ├── Parts.aiml │ │ ├── Personality.aiml │ │ ├── Philosophy.aiml │ │ ├── Pickup.aiml │ │ ├── Politics.aiml │ │ ├── Predicates.aiml │ │ ├── Psychology.aiml │ │ ├── Reduce.aiml │ │ ├── Reducer.aiml │ │ ├── Reductions.aiml │ │ ├── Religion.aiml │ │ ├── Salutations.aiml │ │ ├── Science.aiml │ │ ├── Sex.aiml │ │ ├── Spam.aiml │ │ ├── Sports.aiml │ │ ├── Stack.aiml │ │ ├── Stories.aiml │ │ ├── That.aiml │ │ ├── Utilities.aiml │ │ ├── Wallace.aiml │ │ ├── Xfind.aiml │ │ └── update.aiml │ ├── index.html │ ├── reference │ ├── allclasses-frame.html │ ├── allclasses-noframe.html │ ├── codeanticode │ │ └── chatbots │ │ │ ├── alice │ │ │ ├── Alice.html │ │ │ ├── AliceBot.html │ │ │ ├── AliceBotMother.html │ │ │ ├── Context.html │ │ │ ├── ContextPropertyChangeListener.html │ │ │ ├── ContextRandomSeedChangeListener.html │ │ │ ├── ContextTopicChangeListener.html │ │ │ ├── Graphmaster.html │ │ │ ├── GraphmasterMother.html │ │ │ ├── Logger.html │ │ │ ├── Match.Section.html │ │ │ ├── Match.html │ │ │ ├── aiml │ │ │ │ ├── AIMLElement.html │ │ │ │ ├── AIMLHandler.html │ │ │ │ ├── AIMLParser.html │ │ │ │ ├── AIMLParserConfigurationException.html │ │ │ │ ├── AIMLParserException.html │ │ │ │ ├── AIMLStack.html │ │ │ │ ├── Aiml.html │ │ │ │ ├── Bot.html │ │ │ │ ├── Category.html │ │ │ │ ├── Condition.html │ │ │ │ ├── Date.html │ │ │ │ ├── Formal.html │ │ │ │ ├── Gender.html │ │ │ │ ├── Get.html │ │ │ │ ├── Gossip.html │ │ │ │ ├── Id.html │ │ │ │ ├── Input.html │ │ │ │ ├── Javascript.html │ │ │ │ ├── Learn.html │ │ │ │ ├── Li.html │ │ │ │ ├── Lowercase.html │ │ │ │ ├── Pattern.html │ │ │ │ ├── Person.html │ │ │ │ ├── Person2.html │ │ │ │ ├── Random.html │ │ │ │ ├── Sentence.html │ │ │ │ ├── Set.html │ │ │ │ ├── Size.html │ │ │ │ ├── Sr.html │ │ │ │ ├── Srai.html │ │ │ │ ├── Star.html │ │ │ │ ├── System.html │ │ │ │ ├── Template.html │ │ │ │ ├── TemplateElement.html │ │ │ │ ├── Text.html │ │ │ │ ├── That.html │ │ │ │ ├── Thatstar.html │ │ │ │ ├── Think.html │ │ │ │ ├── Topic.html │ │ │ │ ├── Topicstar.html │ │ │ │ ├── Uppercase.html │ │ │ │ ├── Version.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── config │ │ │ │ ├── ConfigException.html │ │ │ │ ├── TokenizerConfig.html │ │ │ │ ├── TokenizerConfigStream.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── parser │ │ │ │ ├── AliceBotParser.html │ │ │ │ ├── AliceBotParserConfigurationException.html │ │ │ │ ├── AliceBotParserException.html │ │ │ │ ├── ContextParser.html │ │ │ │ ├── ReflectionBuilder.html │ │ │ │ ├── ReflectionHandler.html │ │ │ │ ├── SplitterHandler.html │ │ │ │ ├── SubstitutionBuilder.html │ │ │ │ ├── TransformationsParser.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── script │ │ │ │ ├── Interpreter.html │ │ │ │ ├── InterpretingException.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── text │ │ │ │ ├── Request.html │ │ │ │ ├── Response.html │ │ │ │ ├── Sentence.html │ │ │ │ ├── SentenceSplitter.html │ │ │ │ ├── Substitution.html │ │ │ │ ├── Tokenizer.html │ │ │ │ ├── TokenizerMother.html │ │ │ │ ├── Transformations.html │ │ │ │ ├── TransformationsMother.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ └── util │ │ │ │ ├── Escaper.html │ │ │ │ ├── Searcher.html │ │ │ │ ├── Sequence.html │ │ │ │ ├── SequenceMother.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── bob │ │ │ ├── Bob.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── eliza │ │ │ ├── Decomp.html │ │ │ ├── DecompList.html │ │ │ ├── DefaultScript.html │ │ │ ├── EString.html │ │ │ ├── Eliza.html │ │ │ ├── Key.html │ │ │ ├── KeyList.html │ │ │ ├── KeyStack.html │ │ │ ├── Mem.html │ │ │ ├── PrePost.html │ │ │ ├── PrePostList.html │ │ │ ├── ReasembList.html │ │ │ ├── SynList.html │ │ │ ├── WordList.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ └── rebecca │ │ │ ├── Rebecca.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ ├── constant-values.html │ ├── deprecated-list.html │ ├── help-doc.html │ ├── index-all.html │ ├── index.html │ ├── overview-frame.html │ ├── overview-summary.html │ ├── overview-tree.html │ ├── package-list │ ├── resources │ │ └── inherit.gif │ ├── serialized-form.html │ └── stylesheet.css │ └── stylesheet.css ├── examples ├── AliceChat │ ├── AliceChat.pde │ └── data │ │ ├── Alice │ │ ├── .DS_Store │ │ ├── ._.DS_Store │ │ ├── Again.aiml │ │ ├── Alice.aiml │ │ ├── Astrology.aiml │ │ ├── Gender.aiml │ │ ├── Learn │ │ │ └── Learned.aiml │ │ ├── Person.aiml │ │ ├── Person2.aiml │ │ ├── alice.txt │ │ ├── condition.aiml │ │ ├── empty_wildcard.aiml │ │ ├── id.aiml │ │ ├── learn.aiml │ │ ├── random.aiml │ │ ├── thatstar.aiml │ │ ├── thattopic.aiml │ │ ├── topicstar.aiml │ │ └── version.aiml │ │ ├── Rockwell-24.vlw │ │ ├── context.xml │ │ ├── properties.xml │ │ ├── splitters.xml │ │ └── substitutions.xml ├── ElizaChat │ ├── ElizaChat.pde │ └── data │ │ └── Rockwell-24.vlw └── RebeccaChat │ ├── RebeccaChat.pde │ └── data │ ├── Rockwell-24.vlw │ └── rebecca │ ├── AI.aiml │ ├── ALICE.aiml │ ├── Adverbs.aiml │ ├── Astrology.aiml │ ├── Atomic.aiml │ ├── Biography.aiml │ ├── Bot.aiml │ ├── Botmaster.aiml │ ├── Client.aiml │ ├── Computers.aiml │ ├── Date.aiml │ ├── Default.aiml │ ├── Drugs.aiml │ ├── Emotion.aiml │ ├── Food.aiml │ ├── Geography.aiml │ ├── Gossip.aiml │ ├── History.aiml │ ├── Humor.aiml │ ├── IU.aiml │ ├── Inquiry.aiml │ ├── Interjection.aiml │ ├── Knowledge.aiml │ ├── Literature.aiml │ ├── Money.aiml │ ├── Movies.aiml │ ├── Music.aiml │ ├── Parts.aiml │ ├── Personality.aiml │ ├── Philosophy.aiml │ ├── Pickup.aiml │ ├── Politics.aiml │ ├── Predicates.aiml │ ├── Psychology.aiml │ ├── Reduce.aiml │ ├── Reducer.aiml │ ├── Reductions.aiml │ ├── Religion.aiml │ ├── Salutations.aiml │ ├── Science.aiml │ ├── Sex.aiml │ ├── Spam.aiml │ ├── Sports.aiml │ ├── Stack.aiml │ ├── Stories.aiml │ ├── That.aiml │ ├── Utilities.aiml │ ├── Wallace.aiml │ ├── Xfind.aiml │ └── update.aiml ├── readme.html ├── reference ├── allclasses-frame.html ├── allclasses-noframe.html ├── codeanticode │ └── chatbots │ │ ├── alice │ │ ├── Alice.html │ │ ├── AliceBot.html │ │ ├── AliceBotMother.html │ │ ├── Context.html │ │ ├── ContextPropertyChangeListener.html │ │ ├── ContextRandomSeedChangeListener.html │ │ ├── ContextTopicChangeListener.html │ │ ├── Graphmaster.html │ │ ├── GraphmasterMother.html │ │ ├── Logger.html │ │ ├── Match.Section.html │ │ ├── Match.html │ │ ├── aiml │ │ │ ├── AIMLElement.html │ │ │ ├── AIMLHandler.html │ │ │ ├── AIMLParser.html │ │ │ ├── AIMLParserConfigurationException.html │ │ │ ├── AIMLParserException.html │ │ │ ├── AIMLStack.html │ │ │ ├── Aiml.html │ │ │ ├── Bot.html │ │ │ ├── Category.html │ │ │ ├── Condition.html │ │ │ ├── Date.html │ │ │ ├── Formal.html │ │ │ ├── Gender.html │ │ │ ├── Get.html │ │ │ ├── Gossip.html │ │ │ ├── Id.html │ │ │ ├── Input.html │ │ │ ├── Javascript.html │ │ │ ├── Learn.html │ │ │ ├── Li.html │ │ │ ├── Lowercase.html │ │ │ ├── Pattern.html │ │ │ ├── Person.html │ │ │ ├── Person2.html │ │ │ ├── Random.html │ │ │ ├── Sentence.html │ │ │ ├── Set.html │ │ │ ├── Size.html │ │ │ ├── Sr.html │ │ │ ├── Srai.html │ │ │ ├── Star.html │ │ │ ├── System.html │ │ │ ├── Template.html │ │ │ ├── TemplateElement.html │ │ │ ├── Text.html │ │ │ ├── That.html │ │ │ ├── Thatstar.html │ │ │ ├── Think.html │ │ │ ├── Topic.html │ │ │ ├── Topicstar.html │ │ │ ├── Uppercase.html │ │ │ ├── Version.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── config │ │ │ ├── ConfigException.html │ │ │ ├── TokenizerConfig.html │ │ │ ├── TokenizerConfigStream.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ ├── parser │ │ │ ├── AliceBotParser.html │ │ │ ├── AliceBotParserConfigurationException.html │ │ │ ├── AliceBotParserException.html │ │ │ ├── ContextParser.html │ │ │ ├── ReflectionBuilder.html │ │ │ ├── ReflectionHandler.html │ │ │ ├── SplitterHandler.html │ │ │ ├── SubstitutionBuilder.html │ │ │ ├── TransformationsParser.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── script │ │ │ ├── Interpreter.html │ │ │ ├── InterpretingException.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── text │ │ │ ├── Request.html │ │ │ ├── Response.html │ │ │ ├── Sentence.html │ │ │ ├── SentenceSplitter.html │ │ │ ├── Substitution.html │ │ │ ├── Tokenizer.html │ │ │ ├── TokenizerMother.html │ │ │ ├── Transformations.html │ │ │ ├── TransformationsMother.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── util │ │ │ ├── Escaper.html │ │ │ ├── Searcher.html │ │ │ ├── Sequence.html │ │ │ ├── SequenceMother.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── bob │ │ ├── Bob.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── eliza │ │ ├── Decomp.html │ │ ├── DecompList.html │ │ ├── DefaultScript.html │ │ ├── EString.html │ │ ├── Eliza.html │ │ ├── Key.html │ │ ├── KeyList.html │ │ ├── KeyStack.html │ │ ├── Mem.html │ │ ├── PrePost.html │ │ ├── PrePostList.html │ │ ├── ReasembList.html │ │ ├── SynList.html │ │ ├── WordList.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ └── rebecca │ │ ├── Rebecca.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-all.html ├── index.html ├── overview-frame.html ├── overview-summary.html ├── overview-tree.html ├── package-list ├── resources │ └── inherit.gif ├── serialized-form.html └── stylesheet.css ├── resources ├── build.xml ├── charliebot-src_4.1.8.tar.gz ├── chatterbean.src.00.008.zip ├── code │ ├── ExampleTaglet.class │ ├── ExampleTaglet.java │ ├── ant-contrib-1.0b3.jar │ └── doc.sh ├── online_materials ├── programd-1302.zip ├── scripts │ └── eliza.script └── stylesheet.css ├── src └── codeanticode │ └── chatbots │ ├── alice │ ├── Alice.java │ ├── AliceBot.java │ ├── AliceBotMother.java │ ├── Context.java │ ├── ContextPropertyChangeListener.java │ ├── ContextRandomSeedChangeListener.java │ ├── ContextTopicChangeListener.java │ ├── Graphmaster.java │ ├── GraphmasterMother.java │ ├── Logger.java │ ├── Match.java │ ├── aiml │ │ ├── AIMLElement.java │ │ ├── AIMLHandler.java │ │ ├── AIMLParser.java │ │ ├── AIMLParserConfigurationException.java │ │ ├── AIMLParserException.java │ │ ├── AIMLStack.java │ │ ├── Aiml.java │ │ ├── Bot.java │ │ ├── Category.java │ │ ├── Condition.java │ │ ├── Date.java │ │ ├── Formal.java │ │ ├── Gender.java │ │ ├── Get.java │ │ ├── Gossip.java │ │ ├── Id.java │ │ ├── Input.java │ │ ├── Javascript.java │ │ ├── Learn.java │ │ ├── Li.java │ │ ├── Lowercase.java │ │ ├── Pattern.java │ │ ├── Person.java │ │ ├── Person2.java │ │ ├── Random.java │ │ ├── Sentence.java │ │ ├── Set.java │ │ ├── Size.java │ │ ├── Sr.java │ │ ├── Srai.java │ │ ├── Star.java │ │ ├── System.java │ │ ├── Template.java │ │ ├── TemplateElement.java │ │ ├── Text.java │ │ ├── That.java │ │ ├── Thatstar.java │ │ ├── Think.java │ │ ├── Topic.java │ │ ├── Topicstar.java │ │ ├── Uppercase.java │ │ └── Version.java │ ├── config │ │ ├── ConfigException.java │ │ ├── TokenizerConfig.java │ │ └── TokenizerConfigStream.java │ ├── parser │ │ ├── AliceBotParser.java │ │ ├── AliceBotParserConfigurationException.java │ │ ├── AliceBotParserException.java │ │ ├── ContextParser.java │ │ ├── ReflectionBuilder.java │ │ ├── ReflectionHandler.java │ │ ├── SplitterHandler.java │ │ ├── SubstitutionBuilder.java │ │ └── TransformationsParser.java │ ├── script │ │ ├── Interpreter.java │ │ └── InterpretingException.java │ ├── text │ │ ├── Request.java │ │ ├── Response.java │ │ ├── Sentence.java │ │ ├── SentenceSplitter.java │ │ ├── Substitution.java │ │ ├── Tokenizer.java │ │ ├── TokenizerMother.java │ │ ├── Transformations.java │ │ └── TransformationsMother.java │ └── util │ │ ├── Escaper.java │ │ ├── Searcher.java │ │ ├── Sequence.java │ │ └── SequenceMother.java │ ├── base │ └── Base.java │ ├── eliza │ ├── Decomp.java │ ├── DecompList.java │ ├── EString.java │ ├── Eliza.java │ ├── Key.java │ ├── KeyList.java │ ├── KeyStack.java │ ├── Mem.java │ ├── PrePost.java │ ├── PrePostList.java │ ├── ReasembList.java │ ├── SynList.java │ └── WordList.java │ └── rebecca │ └── Rebecca.java └── web ├── index.html └── stylesheet.css /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ChatBots 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Tue Dec 23 18:02:24 PST 2008 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.5 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.5 13 | -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/Alice.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/Alice.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/AliceBot.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/AliceBot.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/AliceBotMother.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/AliceBotMother.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/Context.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/Context.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/ContextPropertyChangeListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/ContextPropertyChangeListener.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/ContextRandomSeedChangeListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/ContextRandomSeedChangeListener.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/ContextTopicChangeListener.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/ContextTopicChangeListener.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/Graphmaster.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/Graphmaster.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/GraphmasterMother.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/GraphmasterMother.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/Logger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/Logger.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/Match$Section.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/Match$Section.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/Match.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/Match.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/AIMLElement.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/AIMLElement.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/AIMLHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/AIMLHandler.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/AIMLParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/AIMLParser.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/AIMLParserConfigurationException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/AIMLParserConfigurationException.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/AIMLParserException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/AIMLParserException.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/AIMLStack.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/AIMLStack.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Aiml.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Aiml.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Bot.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Bot.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Category.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Category.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Condition.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Condition.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Date.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Date.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Formal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Formal.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Gender.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Gender.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Get.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Get.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Gossip.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Gossip.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Id.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Input.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Input.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Javascript.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Javascript.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Learn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Learn.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Li.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Li.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Lowercase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Lowercase.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Pattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Pattern.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Person.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Person2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Person2.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Random.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Random.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Sentence.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Sentence.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Set.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Set.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Size.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Size.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Sr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Sr.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Srai.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Srai.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Star.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Star.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/System.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/System.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Template.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Template.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/TemplateElement.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/TemplateElement.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Text.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Text.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/That.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/That.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Thatstar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Thatstar.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Think.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Think.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Topic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Topic.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Topicstar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Topicstar.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Uppercase.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Uppercase.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/aiml/Version.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/aiml/Version.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/config/ConfigException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/config/ConfigException.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/config/TokenizerConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/config/TokenizerConfig.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/config/TokenizerConfigStream.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/config/TokenizerConfigStream.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/AliceBotParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/AliceBotParser.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/AliceBotParserConfigurationException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/AliceBotParserConfigurationException.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/AliceBotParserException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/AliceBotParserException.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/ContextParser$ContextHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/ContextParser$ContextHandler.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/ContextParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/ContextParser.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/ReflectionBuilder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/ReflectionBuilder.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/ReflectionHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/ReflectionHandler.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/SplitterHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/SplitterHandler.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/SubstitutionBuilder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/SubstitutionBuilder.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/parser/TransformationsParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/parser/TransformationsParser.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/script/Interpreter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/script/Interpreter.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/script/InterpretingException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/script/InterpretingException.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Request.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Request.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Response.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Response.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Sentence.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Sentence.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/SentenceSplitter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/SentenceSplitter.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceFragment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceFragment.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceOperation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceOperation.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Substitution$FindReplacePrefix.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Substitution$FindReplacePrefix.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceSuffix.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceSuffix.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceWord.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Substitution$FindReplaceWord.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Substitution.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Substitution.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Tokenizer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Tokenizer.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/TokenizerMother.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/TokenizerMother.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Transformations$Mapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Transformations$Mapper.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/Transformations.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/Transformations.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/text/TransformationsMother.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/text/TransformationsMother.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/util/Escaper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/util/Escaper.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/util/Searcher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/util/Searcher.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/util/Sequence.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/util/Sequence.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/alice/util/SequenceMother.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/alice/util/SequenceMother.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/base/Base.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/base/Base.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/Decomp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/Decomp.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/DecompList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/DecompList.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/EString.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/EString.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/Eliza.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/Eliza.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/Key.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/Key.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/KeyList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/KeyList.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/KeyStack.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/KeyStack.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/Mem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/Mem.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/PrePost.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/PrePost.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/PrePostList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/PrePostList.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/ReasembList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/ReasembList.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/SynList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/SynList.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/eliza/WordList.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/eliza/WordList.class -------------------------------------------------------------------------------- /bin/codeanticode/chatbots/rebecca/Rebecca.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/bin/codeanticode/chatbots/rebecca/Rebecca.class -------------------------------------------------------------------------------- /distribution/chatbots.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/chatbots.zip -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/GraphmasterMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice; 16 | 17 | import codeanticode.chatbots.alice.Graphmaster; 18 | import codeanticode.chatbots.alice.aiml.Srai; 19 | import codeanticode.chatbots.alice.aiml.Star; 20 | import codeanticode.chatbots.alice.aiml.Text; 21 | import codeanticode.chatbots.alice.aiml.Category; 22 | 23 | public class GraphmasterMother 24 | { 25 | /* 26 | Methods 27 | */ 28 | 29 | public Graphmaster newInstance() 30 | { 31 | Graphmaster root = new Graphmaster(); 32 | 33 | root.append(new Category(" SAY _ AGAIN ", "What, again? \"", new Star(1), "\".")); 34 | root.append(new Category(" SAY IT NOW ", "Whatever you want...")); 35 | root.append(new Category(" SAY * ", new Star(1), "!")); 36 | root.append(new Category(" DO YOU SEE THE * IN MY EYES ", "Yes, I see the ", new Star(1), " in your eyes.")); 37 | 38 | return root; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/AIMLElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@bol.com.br 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import java.util.List; 18 | 19 | public interface AIMLElement 20 | { 21 | /* 22 | Method Section 23 | */ 24 | 25 | public void appendChild(AIMLElement child); 26 | 27 | public void appendChildren(List children); 28 | } 29 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/AIMLParserConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | public class AIMLParserConfigurationException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AIMLParserConfigurationException(Exception e) 30 | { 31 | super(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/AIMLParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | public class AIMLParserException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AIMLParserException(Exception e) 30 | { 31 | super(e); 32 | } 33 | 34 | public AIMLParserException(String message) 35 | { 36 | super(message); 37 | } 38 | 39 | public AIMLParserException(String message, Throwable cause) 40 | { 41 | super(message, cause); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/AIMLStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@bol.com.br 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import java.util.LinkedList; 18 | import java.util.List; 19 | 20 | public class AIMLStack 21 | { 22 | /* 23 | Attributes 24 | */ 25 | 26 | private final List stack = new LinkedList(); 27 | 28 | /* 29 | Methods 30 | */ 31 | 32 | public Object peek() 33 | { 34 | return stack.get(0); 35 | } 36 | 37 | public Object pop() 38 | { 39 | return (stack.size() > 0 ? stack.remove(0) : null); 40 | } 41 | 42 | public void push(Object element) 43 | { 44 | stack.add(0, element); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Date.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import java.text.SimpleDateFormat; 18 | import org.xml.sax.Attributes; 19 | import codeanticode.chatbots.alice.Match; 20 | 21 | public class Date extends TemplateElement 22 | { 23 | /* 24 | Attributes 25 | */ 26 | 27 | private final SimpleDateFormat format = new SimpleDateFormat(); 28 | 29 | /* 30 | Constructors 31 | */ 32 | 33 | public Date() 34 | { 35 | } 36 | 37 | public Date(Attributes attributes) 38 | { 39 | } 40 | 41 | /* 42 | Methods 43 | */ 44 | 45 | public int hashCode() 46 | { 47 | return 13; 48 | } 49 | 50 | public String process(Match match) 51 | { 52 | try 53 | { 54 | format.applyPattern((String) match.getCallback().getContext().property("predicate.dateFormat")); 55 | return format.format(new java.util.Date()); 56 | } 57 | catch (NullPointerException e) 58 | { 59 | return ""; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Gender.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | import codeanticode.chatbots.alice.AliceBot; 20 | import codeanticode.chatbots.alice.Match; 21 | import codeanticode.chatbots.alice.text.Transformations; 22 | 23 | public class Gender extends TemplateElement 24 | { 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public Gender(Attributes attributes) 30 | { 31 | } 32 | 33 | public Gender(Object... children) 34 | { 35 | super(children); 36 | } 37 | 38 | /* 39 | Method Section 40 | */ 41 | 42 | public String process(Match match) 43 | { 44 | String input = super.process(match); 45 | AliceBot bot = match.getCallback(); 46 | Transformations transformations = bot.transformations(); 47 | return transformations.gender(input); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Gossip.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Context; 20 | import codeanticode.chatbots.alice.Match; 21 | 22 | public class Gossip extends TemplateElement 23 | { 24 | /* 25 | Constructors 26 | */ 27 | 28 | public Gossip(Attributes attributes) 29 | { 30 | } 31 | 32 | public Gossip(Object... children) 33 | { 34 | super(children); 35 | } 36 | 37 | /* 38 | Methods 39 | */ 40 | 41 | public String process(Match match) 42 | { 43 | AliceBot bot = null; 44 | Context context = null; 45 | if (match != null) try 46 | { 47 | bot = match.getCallback(); 48 | context = bot.getContext(); 49 | context.print(super.process(match)); 50 | } 51 | catch (Exception e) 52 | { 53 | throw new RuntimeException(e); 54 | } 55 | 56 | return ""; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Id.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Context; 20 | import codeanticode.chatbots.alice.Match; 21 | 22 | public class Id extends TemplateElement 23 | { 24 | /* 25 | Constructors 26 | */ 27 | 28 | public Id() 29 | { 30 | } 31 | 32 | public Id(Attributes attributes) 33 | { 34 | } 35 | 36 | /* 37 | Methods 38 | */ 39 | 40 | public boolean equals(Object obj) 41 | { 42 | if (!super.equals(obj)) 43 | return false; 44 | else 45 | return toString().equals(obj.toString()); 46 | } 47 | 48 | public int hashCode() 49 | { 50 | return process(null).hashCode(); 51 | } 52 | 53 | public String process(Match match) 54 | { 55 | if (match == null) return "unknown"; 56 | AliceBot bot = match.getCallback(); 57 | Context context = bot.getContext(); 58 | return context.id(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Lowercase.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Lowercase extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Lowercase(Attributes attributes) 27 | { 28 | } 29 | 30 | public Lowercase(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Methods 37 | */ 38 | 39 | public String process(Match match) 40 | { 41 | String result = super.process(match); 42 | if (result != null) 43 | return result.toLowerCase(); 44 | else 45 | return ""; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | import codeanticode.chatbots.alice.AliceBot; 20 | import codeanticode.chatbots.alice.Match; 21 | import codeanticode.chatbots.alice.text.Transformations; 22 | 23 | public class Person extends TemplateElement 24 | { 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public Person(Attributes attributes) 30 | { 31 | } 32 | 33 | public Person(Object... children) 34 | { 35 | super(children); 36 | } 37 | 38 | /* 39 | Method Section 40 | */ 41 | 42 | public String process(Match match) 43 | { 44 | String input = super.process(match); 45 | AliceBot bot = match.getCallback(); 46 | Transformations transformations = bot.transformations(); 47 | return transformations.person(input); 48 | } 49 | } -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Person2.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Match; 20 | import codeanticode.chatbots.alice.text.Transformations; 21 | 22 | public class Person2 extends TemplateElement 23 | { 24 | /* 25 | Constructor Section 26 | */ 27 | 28 | public Person2(Attributes attributes) 29 | { 30 | } 31 | 32 | public Person2(Object... children) 33 | { 34 | super(children); 35 | } 36 | 37 | /* 38 | Method Section 39 | */ 40 | 41 | public String process(Match match) 42 | { 43 | String input = super.process(match); 44 | AliceBot bot = match.getCallback(); 45 | Transformations transformations = bot.transformations(); 46 | return transformations.person2(input); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Random.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | import codeanticode.chatbots.alice.AliceBot; 20 | import codeanticode.chatbots.alice.Context; 21 | import codeanticode.chatbots.alice.Match; 22 | 23 | public class Random extends TemplateElement 24 | { 25 | /* 26 | Constructor 27 | */ 28 | 29 | public Random() 30 | { 31 | } 32 | 33 | public Random(Attributes attributes) 34 | { 35 | } 36 | 37 | public Random(Object... children) 38 | { 39 | super(children); 40 | } 41 | 42 | /* 43 | Methods 44 | */ 45 | 46 | public String process(Match match) 47 | { 48 | AliceBot bot = match.getCallback(); 49 | Context context = bot.getContext(); 50 | java.util.Random random = context.random(); 51 | 52 | int n = children().size(); 53 | TemplateElement child = getChildren(random.nextInt(n)); 54 | return child.process(match); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Size.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Size extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Size() 27 | { 28 | } 29 | 30 | public Size(Attributes attributes) 31 | { 32 | } 33 | 34 | /* 35 | Methods 36 | */ 37 | 38 | public String process(Match match) 39 | { 40 | try 41 | { 42 | return Integer.toString(match.getCallback().getGraphmaster().size()); 43 | } 44 | catch (NullPointerException e) 45 | { 46 | return "0"; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Sr.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | public class Sr extends Srai 20 | { 21 | /* 22 | Constructors 23 | */ 24 | 25 | public Sr(Attributes attributes) 26 | { 27 | super(attributes); 28 | setChildren(new TemplateElement[] {new Star(attributes)}); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Template.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | public class Template extends TemplateElement 20 | { 21 | /* 22 | Constructor Section 23 | */ 24 | 25 | public Template(Attributes attributes) 26 | { 27 | super(); 28 | } 29 | 30 | public Template(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Method Section 37 | */ 38 | 39 | public String toString() 40 | { 41 | StringBuilder value = new StringBuilder(); 42 | value.append(""); 43 | for (TemplateElement i : children()) 44 | value.append(i.toString()); 45 | value.append(""); 46 | 47 | return value.toString(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Text.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import codeanticode.chatbots.alice.Match; 18 | 19 | public class Text extends TemplateElement 20 | { 21 | /* 22 | Attributes 23 | */ 24 | 25 | private final String value; 26 | 27 | /* 28 | Constructor 29 | */ 30 | 31 | public Text(String value) 32 | { 33 | this.value = value; 34 | } 35 | 36 | /* 37 | Methods 38 | */ 39 | 40 | public boolean equals(Object obj) 41 | { 42 | if (obj == null) return false; 43 | String text = obj.toString(); 44 | return (text != null ? text.equals(value) : value == null); 45 | } 46 | 47 | public int hashCode() 48 | { 49 | return (value == null ? 0 : value.hashCode()); 50 | } 51 | 52 | public String toString() 53 | { 54 | return value; 55 | } 56 | 57 | public String process(Match match) 58 | { 59 | return value; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Think.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Think extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Think(Attributes attributes) 27 | { 28 | } 29 | 30 | public Think(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Methods 37 | */ 38 | 39 | public String process(Match match) 40 | { 41 | super.process(match); 42 | return ""; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Uppercase.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Uppercase extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Uppercase(Attributes attributes) 27 | { 28 | } 29 | 30 | public Uppercase(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Methods 37 | */ 38 | 39 | public String process(Match match) 40 | { 41 | String result = super.process(match); 42 | if (result != null) 43 | return result.toUpperCase(); 44 | else 45 | return ""; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/aiml/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Context; 20 | import codeanticode.chatbots.alice.Match; 21 | 22 | public class Version extends TemplateElement 23 | { 24 | /* 25 | Constructors 26 | */ 27 | 28 | public Version() 29 | { 30 | } 31 | 32 | public Version(Attributes attributes) 33 | { 34 | } 35 | 36 | /* 37 | Methods 38 | */ 39 | 40 | public String process(Match match) 41 | { 42 | AliceBot bot = match.getCallback(); 43 | Context context = bot.getContext(); 44 | return (String) context.property("bot.version"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/config/TokenizerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.config; 16 | 17 | import codeanticode.chatbots.alice.text.Tokenizer; 18 | 19 | public interface TokenizerConfig 20 | { 21 | public Tokenizer newInstance(); 22 | 23 | public String[] splitters(); 24 | } 25 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/parser/AliceBotParserConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.parser; 16 | 17 | public class AliceBotParserConfigurationException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AliceBotParserConfigurationException(Exception e) 30 | { 31 | super(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/parser/AliceBotParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.parser; 16 | 17 | public class AliceBotParserException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AliceBotParserException(Exception e) 30 | { 31 | super(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/parser/ReflectionBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.parser; 16 | 17 | public interface ReflectionBuilder 18 | { 19 | /* 20 | Methods 21 | */ 22 | 23 | public void characters(char[] chars, int start, int length); 24 | 25 | public void clear(); 26 | } 27 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/script/Interpreter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.script; 16 | 17 | public interface Interpreter 18 | { 19 | public Object evaluate(String script) throws InterpretingException; 20 | 21 | public Object variable(String name) throws InterpretingException; 22 | 23 | public void variable(String name, Object value) throws InterpretingException; 24 | } 25 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/script/InterpretingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.script; 16 | 17 | /** 18 | Base class for script-interpreting exceptions. 19 | */ 20 | public class InterpretingException extends Exception 21 | { 22 | /** Version class identifier for the serialization engine. Matches the number of the last revision where the class was created / modified. */ 23 | private static final long serialVersionUID = 8L; 24 | 25 | public InterpretingException(Exception cause) 26 | { 27 | super(cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/text/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.text; 16 | 17 | import java.util.Arrays; 18 | import java.util.LinkedList; 19 | import java.util.List; 20 | 21 | public class Response extends Request 22 | { 23 | /* 24 | Constructor 25 | */ 26 | 27 | public Response() 28 | { 29 | super(); 30 | } 31 | 32 | public Response(String original) 33 | { 34 | super(original); 35 | } 36 | 37 | public Response(String original, Sentence... sentences) 38 | { 39 | super(original, sentences); 40 | } 41 | 42 | /* 43 | Methods 44 | */ 45 | 46 | public void append(String output) 47 | { 48 | StringBuilder builder = new StringBuilder(); 49 | String original = getOriginal(); 50 | if (original != null) 51 | { 52 | builder.append(original); 53 | if (builder.charAt(builder.length() - 1) != ' ') 54 | builder.append(' '); 55 | } 56 | 57 | builder.append(output); 58 | setOriginal(builder.toString()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/text/TokenizerMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.text; 16 | 17 | import java.io.FileInputStream; 18 | import codeanticode.chatbots.alice.config.TokenizerConfig; 19 | import codeanticode.chatbots.alice.config.TokenizerConfigStream; 20 | 21 | public class TokenizerMother 22 | { 23 | /* 24 | Method Section 25 | */ 26 | 27 | public static Tokenizer newInstance() throws Exception 28 | { 29 | TokenizerConfig config = new TokenizerConfigStream(new FileInputStream("Bots/splitters.xml")); 30 | return new Tokenizer(config); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/text/TransformationsMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.text; 16 | 17 | import java.io.FileInputStream; 18 | import codeanticode.chatbots.alice.parser.TransformationsParser; 19 | 20 | public class TransformationsMother 21 | { 22 | /* 23 | Methods 24 | */ 25 | 26 | public Transformations newInstance() throws Exception 27 | { 28 | TransformationsParser parser = new TransformationsParser(); 29 | return parser.parse(new FileInputStream("Bots/splitters.xml"), new FileInputStream("Bots/substitutions.xml")); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/alice/util/SequenceMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.util; 16 | 17 | import java.io.File; 18 | import codeanticode.chatbots.alice.util.Sequence; 19 | 20 | public class SequenceMother 21 | { 22 | /* 23 | Attributes 24 | */ 25 | 26 | public static final File file = new File("Logs/sequence.txt"); 27 | 28 | /* 29 | Methods 30 | */ 31 | 32 | public Sequence newInstance() 33 | { 34 | return new Sequence(file); 35 | } 36 | 37 | public void reset() 38 | { 39 | (new File(file.getPath() + ".backup")).delete(); 40 | file.delete(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/base/Base.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.base; 2 | 3 | import processing.core.*; 4 | 5 | abstract class Base { 6 | PApplet parent; 7 | boolean finished = false; 8 | 9 | public Base(PApplet parent) { 10 | this.parent = parent; 11 | parent.registerDispose(this); 12 | } 13 | 14 | public void dispose() { 15 | // anything in here will be called automatically when 16 | // the parent applet shuts down. for instance, this might 17 | // shut down a thread used by this library. 18 | // note that this currently has issues, see bug #183 19 | // http://dev.processing.org/bugs/show_bug.cgi?id=183 20 | } 21 | 22 | public boolean finished() { 23 | return finished; 24 | } 25 | 26 | /** 27 | * Process a line of input. 28 | */ 29 | abstract public String processInput(String s); 30 | } 31 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/DecompList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza decomp list. 7 | * This stores all the decompositions of a single key. 8 | */ 9 | public class DecompList extends Vector { 10 | 11 | /** 12 | * Add another decomp rule to the list. 13 | */ 14 | public void add(String word, boolean mem, ReasembList reasmb) { 15 | addElement(new Decomp(word, mem, reasmb)); 16 | } 17 | 18 | /** 19 | * Print the whole decomp list. 20 | */ 21 | public void print(int indent) { 22 | for (int i = 0; i < size(); i++) { 23 | Decomp d = (Decomp)elementAt(i); 24 | d.print(indent); 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/Key.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * Eliza key. 5 | * A key has the key itself, a rank, and a list of decompositon rules. 6 | */ 7 | public class Key { 8 | /** The key itself */ 9 | String key; 10 | /** The numerical rank */ 11 | int rank; 12 | /** The list of decompositions */ 13 | DecompList decomp; 14 | 15 | /** 16 | * Initialize the key. 17 | */ 18 | Key(String key, int rank, DecompList decomp) { 19 | this.key = key; 20 | this.rank = rank; 21 | this.decomp = decomp; 22 | } 23 | 24 | /** 25 | * Another initialization for gotoKey. 26 | */ 27 | Key() { 28 | key = null; 29 | rank = 0; 30 | decomp = null; 31 | } 32 | 33 | public void copy(Key k) { 34 | key = k.key(); 35 | rank = k.rank(); 36 | decomp = k.decomp(); 37 | } 38 | 39 | /** 40 | * Print the key and all under it. 41 | */ 42 | public void print(int indent) { 43 | for (int i = 0; i < indent; i++) System.out.print(" "); 44 | System.out.println("key: " + key + " " + rank); 45 | decomp.print(indent+2); 46 | } 47 | 48 | /** 49 | * Print the key and rank only, not the rest. 50 | */ 51 | public void printKey(int indent) { 52 | for (int i = 0; i < indent; i++) System.out.print(" "); 53 | System.out.println("key: " + key + " " + rank); 54 | } 55 | 56 | /** 57 | * Get the key value. 58 | */ 59 | public String key() { 60 | return key; 61 | } 62 | 63 | /** 64 | * Get the rank. 65 | */ 66 | public int rank() { 67 | return rank; 68 | } 69 | 70 | /** 71 | * Get the decomposition list. 72 | */ 73 | public DecompList decomp() { 74 | return decomp; 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/KeyList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza key list. 7 | * This stores all the keys. 8 | */ 9 | public class KeyList extends Vector { 10 | 11 | /** 12 | * Add a new key. 13 | */ 14 | public void add(String key, int rank, DecompList decomp) { 15 | addElement(new Key(key, rank, decomp)); 16 | } 17 | 18 | /** 19 | * Print all the keys. 20 | */ 21 | public void print(int indent) { 22 | for (int i = 0; i < size(); i++) { 23 | Key k = (Key)elementAt(i); 24 | k.print(indent); 25 | } 26 | } 27 | 28 | /** 29 | * Search the key list for a given key. 30 | * Return the Key if found, else null. 31 | */ 32 | Key getKey(String s) { 33 | for (int i = 0; i < size(); i++) { 34 | Key key = (Key)elementAt(i); 35 | if (s.equals(key.key())) return key; 36 | } 37 | return null; 38 | } 39 | 40 | /** 41 | * Break the string s into words. 42 | * For each word, if isKey is true, then push the key 43 | * into the stack. 44 | */ 45 | public void buildKeyStack(KeyStack stack, String s) { 46 | stack.reset(); 47 | s = EString.trim(s); 48 | String lines[] = new String[2]; 49 | Key k; 50 | while (EString.match(s, "* *", lines)) { 51 | k = getKey(lines[0]); 52 | if (k != null) stack.pushKey(k); 53 | s = lines[1]; 54 | } 55 | k = getKey(s); 56 | if (k != null) stack.pushKey(k); 57 | //stack.print(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/KeyStack.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * A stack of keys. 5 | * The keys are kept in rank order. 6 | */ 7 | public class KeyStack { 8 | 9 | /** The stack size */ 10 | final int stackSize = 20; 11 | /** The key stack */ 12 | Key keyStack[] = new Key[stackSize]; 13 | /** The top of the key stack */ 14 | int keyTop = 0; 15 | 16 | /** 17 | * Prints the key stack. 18 | */ 19 | public void print() { 20 | System.out.println("Key stack " + keyTop); 21 | for (int i = 0; i < keyTop; i++) { 22 | keyStack[i].printKey(0); 23 | } 24 | } 25 | 26 | /** 27 | * Get the stack size. 28 | */ 29 | public int keyTop() { 30 | return keyTop; 31 | } 32 | 33 | /** 34 | * Reset the key stack. 35 | */ 36 | public void reset() { 37 | keyTop = 0; 38 | } 39 | 40 | /** 41 | * Get a key from the stack. 42 | */ 43 | public Key key(int n) { 44 | if (n < 0 || n >= keyTop) return null; 45 | return keyStack[n]; 46 | } 47 | 48 | /** 49 | * Push a key in the stack. 50 | * Keep the highest rank keys at the bottom. 51 | */ 52 | public void pushKey(Key key) { 53 | if (key == null) { 54 | System.out.println("push null key"); 55 | return; 56 | } 57 | int i; 58 | for (i = keyTop; i > 0; i--) { 59 | if (key.rank > keyStack[i-1].rank) keyStack[i] = keyStack[i-1]; 60 | else break; 61 | } 62 | keyStack[i] = key; 63 | keyTop++; 64 | } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/Mem.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * Eliza memory class 5 | */ 6 | 7 | public class Mem { 8 | 9 | /** The memory size */ 10 | final int memMax = 20; 11 | /** The memory */ 12 | String memory[] = new String[memMax]; 13 | /** The memory top */ 14 | int memTop = 0; 15 | 16 | public void save(String str) { 17 | if (memTop < memMax) { 18 | memory[memTop++] = new String(str); 19 | } 20 | } 21 | 22 | public String get() { 23 | if (memTop == 0) return null; 24 | String m = memory[0]; 25 | for (int i = 0; i < memTop-1; i++) 26 | memory[i] = memory[i+1]; 27 | memTop--; 28 | return m; 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/PrePost.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * Eliza pre-post entry (two words). 5 | * This is used to store pre transforms or post transforms. 6 | */ 7 | public class PrePost { 8 | /** The words */ 9 | String src; 10 | String dest; 11 | 12 | /** 13 | * Initialize the pre-post entry. 14 | */ 15 | PrePost(String src, String dest) { 16 | this.src = src; 17 | this.dest = dest; 18 | } 19 | 20 | /** 21 | * Print the pre-post entry. 22 | */ 23 | public void print(int indent) { 24 | for (int i = 0; i < indent; i++) System.out.print(" "); 25 | System.out.println("pre-post: " + src + " " + dest); 26 | } 27 | 28 | /** 29 | * Get src. 30 | */ 31 | public String src() { 32 | return src; 33 | } 34 | 35 | /** 36 | * Get dest. 37 | */ 38 | public String dest() { 39 | return dest; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/PrePostList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza prePost list. 7 | * This list of pre-post entries is used to perform word transformations 8 | * prior to or after other processing. 9 | */ 10 | public class PrePostList extends Vector { 11 | 12 | /** 13 | * Add another entry to the list. 14 | */ 15 | public void add(String src, String dest) { 16 | addElement(new PrePost(src, dest)); 17 | } 18 | 19 | /** 20 | * Prnt the pre-post list. 21 | */ 22 | public void print(int indent) { 23 | for (int i = 0; i < size(); i++) { 24 | PrePost p = (PrePost)elementAt(i); 25 | p.print(indent); 26 | } 27 | } 28 | 29 | /** 30 | * Translate a string. 31 | * If str matches a src string on the list, 32 | * return he corresponding dest. 33 | * If no match, return the input. 34 | */ 35 | String xlate(String str) { 36 | for (int i = 0; i < size(); i++) { 37 | PrePost p = (PrePost)elementAt(i); 38 | if (str.equals(p.src())) { 39 | return p.dest(); 40 | } 41 | } 42 | return str; 43 | } 44 | 45 | /** 46 | * Translate a string s. 47 | * (1) Trim spaces off. 48 | * (2) Break s into words. 49 | * (3) For each word, substitute matching src word with dest. 50 | */ 51 | public String translate(String s) { 52 | String lines[] = new String[2]; 53 | String work = EString.trim(s); 54 | s = ""; 55 | while (EString.match(work, "* *", lines)) { 56 | s += xlate(lines[0]) + " "; 57 | work = EString.trim(lines[1]); 58 | } 59 | s += xlate(work); 60 | return s; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/ReasembList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza reassembly list. 7 | */ 8 | public class ReasembList extends Vector { 9 | 10 | /** 11 | * Add an element to the reassembly list. 12 | */ 13 | public void add(String reasmb) { 14 | addElement(reasmb); 15 | } 16 | 17 | /** 18 | * Print the reassembly list. 19 | */ 20 | public void print(int indent) { 21 | for (int i = 0; i < size(); i++) { 22 | for (int j = 0; j < indent; j++) System.out.print(" "); 23 | String s = (String)elementAt(i); 24 | System.out.println("reasemb: " + s); 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/eliza/WordList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza word list. 7 | */ 8 | public class WordList extends Vector { 9 | 10 | /** 11 | * Add another word to the list. 12 | */ 13 | public void add(String word) { 14 | addElement(word); 15 | } 16 | 17 | /** 18 | * Print a word list on one line. 19 | */ 20 | public void print(int indent) { 21 | for (int i = 0; i < size(); i++) { 22 | String s = (String)elementAt(i); 23 | System.out.print(s + " "); 24 | } 25 | System.out.println(); 26 | } 27 | 28 | /** 29 | * Find a string in a word list. 30 | * Return true if the word is in the list, false otherwise. 31 | */ 32 | boolean find(String s) { 33 | for (int i = 0; i < size(); i++) { 34 | if (s.equals((String)elementAt(i))) return true; 35 | } 36 | return false; 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /distribution/src/codeanticode/chatbots/rebecca/Rebecca.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.rebecca; 2 | 3 | import processing.core.*; 4 | 5 | import rebecca.NetworkAimlFacade; 6 | import rebecca.GraphBuilder; 7 | import rebecca.NetworkException; 8 | 9 | 10 | public class Rebecca { 11 | public Rebecca(PApplet parent, String aimDir) { 12 | this.parent = parent; 13 | parent.registerDispose(this); 14 | try { 15 | aiml = new NetworkAimlFacade(new String[]{"rebecca"}); 16 | builder = aiml.getNetworkGraphBuilder(); 17 | builder.addDirectoryUnlessAlreadyAdded(parent.dataPath(aimDir)); 18 | builder.createGraph(); 19 | botName = builder.getBotPredicate("name"); 20 | initialResponse = builder.getResponse("connect"); 21 | } catch(NetworkException e) { 22 | e.printStackTrace(); 23 | } catch (Exception e) { 24 | e.printStackTrace(); 25 | } 26 | } 27 | 28 | public void dispose() { 29 | try { 30 | aiml.destroy(); 31 | } catch(NetworkException e) { 32 | e.printStackTrace(); 33 | } catch (Exception e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | 38 | public boolean finished() { 39 | return finished; 40 | } 41 | 42 | /** 43 | * Process a line of input. 44 | */ 45 | public String processInput(String s) { 46 | try { 47 | return builder.getResponse(s); 48 | } catch(NetworkException e) { 49 | e.printStackTrace(); 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } 53 | return "Ahhhh!"; 54 | } 55 | 56 | public String initialResponse; 57 | 58 | NetworkAimlFacade aiml = null; 59 | GraphBuilder builder; 60 | String botName; 61 | 62 | PApplet parent; 63 | boolean finished = false; 64 | } 65 | -------------------------------------------------------------------------------- /distribution/web/download/chatbots.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/download/chatbots.zip -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/Again.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _ ALICE 6 | 7 | 8 | 9 | _ AGAIN 10 | Once more? 11 | 12 | 13 | YOU MAY * 14 | 15 | 16 | 17 | SAY * 18 | "". 19 | 20 | 21 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/Gender.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE GENDER TEST 6 | He will do the test for her. 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/Learn/Learned.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HAVE YOU LEARNED ANYTHING 6 | Yes, I have learned a new Category. 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/Person.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE PERSON TEST 6 | I will do the test for him. 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/Person2.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE PERSON2 TEST 6 | You will do the test for me. 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/alice.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HELLO 6 | Hello! My name is Alice, who are you? 7 | 8 | 9 | MY NAME IS * 10 | GREETING 11 | 12 | 13 | NAME IS * 14 | GREETING 15 | 16 | 17 | I AM * 18 | GREETING 19 | 20 | 21 | GREETING * 22 | Nice to meet you, . :-) 23 | 24 | 25 | WHAT IS * 26 | Sorry, I don't know what is. 27 | 28 | 29 | _ BOT 30 | Yes, I am an ALICE Bot. 31 | 32 | 33 | _ NAME 34 | My name is Alice, nice to meet you! 35 | 36 | 37 | TELL ME ABOUT * 38 | 39 | 40 | 41 | * 42 | I am sorry, my answers are limited -- you must provide the right questions. 43 | 44 | 45 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/empty_wildcard.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | THANK YOU * 9 | Why, you're welcome! 10 | 11 | 12 | I AM HAPPY * IS * 13 | Yes, I am happy for being as well. 14 | 15 | 16 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/id.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WHAT IS YOUR ID 6 | My id is . 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/learn.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LEARN THIS RESOURCE * 6 | Ok. 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/random.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE RANDOM EXAMPLE 6 | 7 | 8 | This is the first random example. 9 | This is the second random example. 10 | This is the third random example. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/thatstar.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE THATSTAR EXAMPLE 6 | Ok. It'll be a bit silly, though. 7 | 8 | 9 | WHY SO 10 | IT WILL BE * THOUGH 11 | This kind of arranged dialogue is always . 12 | 13 | 14 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/thattopic.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | YES 7 | DO YOU LIKE CHEESE 8 | Good for you.* 9 | 10 | 11 | 12 | WHAT DO YOU WANT TO KNOW 13 | Do you like cheese? 14 | 15 | 16 | YES 17 | "Yes" what? 18 | 19 | 20 | YES 21 | DO YOU LIKE CAKE 22 | I couldn't care less. 23 | 24 | 25 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/topicstar.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE TOPICSTAR EXAMPLE 6 | Alright. How is the weather today? 7 | 8 | 9 | THE WEATHER IS * 10 | So is it going to be a day? 11 | 12 | 13 | 14 | I THINK SO 15 | What do you think of days? 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Alice/version.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WHAT IS YOUR VERSION 6 | My current version is . 7 | 8 | 9 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/Rockwell-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/examples/AliceChat/data/Rockwell-24.vlw -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ChatterBean default configuration properties 5 | context.xml 6 | splitters.xml 7 | substitutions.xml 8 | Alice/ 9 | ../Logs/ 10 | 11 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/splitters.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /distribution/web/examples/AliceChat/data/substitutions.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/examples/AliceChat/data/substitutions.xml -------------------------------------------------------------------------------- /distribution/web/examples/ElizaChat/data/Rockwell-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/examples/ElizaChat/data/Rockwell-24.vlw -------------------------------------------------------------------------------- /distribution/web/examples/RebeccaChat/data/Rockwell-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/examples/RebeccaChat/data/Rockwell-24.vlw -------------------------------------------------------------------------------- /distribution/web/examples/RebeccaChat/data/rebecca/IU.aiml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | I * Why? Interesting gossip That is interesting That's good information Thanks for the information Do you mind if I tell other people I haven't heard anything like that before . PUSH YOU 13 | 14 | YOU * Interesting gossip Thanks for telling me That's good information Thanks for the information Do you mind if I tell other people I haven't heard anything like that before . PUSH YOU 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /distribution/web/examples/RebeccaChat/data/rebecca/Music.aiml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | BEETHOVEN *It's amazing that he composed music while deaf. 13 | 14 | 15 | BEETHOVEN 16 | 17 | 18 | 19 | WHAT WAS THE * BEETHOVEN *Fidelio. 20 | WHO IS BEETHOVENThe dog or the deaf composer? 21 | WHO IS LUDWIG BEETHOVEN WHO IS BEETHOVEN 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /distribution/web/examples/RebeccaChat/data/rebecca/Psychology.aiml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/examples/RebeccaChat/data/rebecca/Psychology.aiml -------------------------------------------------------------------------------- /distribution/web/examples/RebeccaChat/data/rebecca/update.aiml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | What are trees *Wood. 13 | What does a plant *Water and sunlight. 14 | When does leap year *Every four years. 15 | When does Christmas *December 25th. 16 | What religion is the popeCatholic. 17 | What color is dirtBrown. 18 | 19 | How many hearts *One. 20 | How many lungs *Two. 21 | 22 | -------------------------------------------------------------------------------- /distribution/web/reference/codeanticode/chatbots/alice/config/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.alice.config (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.alice.config 20 | 21 | 22 | 23 | Interfaces 24 | 25 | 26 | TokenizerConfig 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Classes 35 | 36 | 37 | TokenizerConfigStream 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Exceptions 46 | 47 | 48 | ConfigException 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /distribution/web/reference/codeanticode/chatbots/alice/script/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.alice.script (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.alice.script 20 | 21 | 22 | 23 | Interfaces 24 | 25 | 26 | Interpreter 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Exceptions 35 | 36 | 37 | InterpretingException 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /distribution/web/reference/codeanticode/chatbots/alice/util/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.alice.util (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.alice.util 20 | 21 | 22 | 23 | Classes 24 | 25 | 26 | Escaper 27 | 28 | Searcher 29 | 30 | Sequence 31 | 32 | SequenceMother 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /distribution/web/reference/codeanticode/chatbots/bob/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.bob (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.bob 20 | 21 | 22 | 23 | Classes 24 | 25 | 26 | Bob 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /distribution/web/reference/codeanticode/chatbots/rebecca/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.rebecca (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.rebecca 20 | 21 | 22 | 23 | Classes 24 | 25 | 26 | Rebecca 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /distribution/web/reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Javadocs: chatbots 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Frame Alert 32 | 33 | 34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | 36 | Link toNon-frame version. 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /distribution/web/reference/package-list: -------------------------------------------------------------------------------- 1 | codeanticode.chatbots.alice 2 | codeanticode.chatbots.alice.aiml 3 | codeanticode.chatbots.alice.config 4 | codeanticode.chatbots.alice.parser 5 | codeanticode.chatbots.alice.script 6 | codeanticode.chatbots.alice.text 7 | codeanticode.chatbots.alice.util 8 | codeanticode.chatbots.eliza 9 | codeanticode.chatbots.rebecca 10 | -------------------------------------------------------------------------------- /distribution/web/reference/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/distribution/web/reference/resources/inherit.gif -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/examples/AliceChat/data/Alice/.DS_Store -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/._.DS_Store: -------------------------------------------------------------------------------- 1 | 2 R @ -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/Again.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _ ALICE 6 | 7 | 8 | 9 | _ AGAIN 10 | Once more? 11 | 12 | 13 | YOU MAY * 14 | 15 | 16 | 17 | SAY * 18 | "". 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/Gender.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE GENDER TEST 6 | He will do the test for her. 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/Learn/Learned.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HAVE YOU LEARNED ANYTHING 6 | Yes, I have learned a new Category. 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/Person.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE PERSON TEST 6 | I will do the test for him. 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/Person2.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE PERSON2 TEST 6 | You will do the test for me. 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/alice.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HELLO 6 | Hello! My name is Alice, who are you? 7 | 8 | 9 | MY NAME IS * 10 | GREETING 11 | 12 | 13 | NAME IS * 14 | GREETING 15 | 16 | 17 | I AM * 18 | GREETING 19 | 20 | 21 | GREETING * 22 | Nice to meet you, . :-) 23 | 24 | 25 | WHAT IS * 26 | Sorry, I don't know what is. 27 | 28 | 29 | _ BOT 30 | Yes, I am an ALICE Bot. 31 | 32 | 33 | _ NAME 34 | My name is Alice, nice to meet you! 35 | 36 | 37 | TELL ME ABOUT * 38 | 39 | 40 | 41 | * 42 | I am sorry, my answers are limited -- you must provide the right questions. 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/empty_wildcard.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | THANK YOU * 9 | Why, you're welcome! 10 | 11 | 12 | I AM HAPPY * IS * 13 | Yes, I am happy for being as well. 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/id.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WHAT IS YOUR ID 6 | My id is . 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/learn.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LEARN THIS RESOURCE * 6 | Ok. 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/random.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE RANDOM EXAMPLE 6 | 7 | 8 | This is the first random example. 9 | This is the second random example. 10 | This is the third random example. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/thatstar.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE THATSTAR EXAMPLE 6 | Ok. It'll be a bit silly, though. 7 | 8 | 9 | WHY SO 10 | IT WILL BE * THOUGH 11 | This kind of arranged dialogue is always . 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/thattopic.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | YES 7 | DO YOU LIKE CHEESE 8 | Good for you.* 9 | 10 | 11 | 12 | WHAT DO YOU WANT TO KNOW 13 | Do you like cheese? 14 | 15 | 16 | YES 17 | "Yes" what? 18 | 19 | 20 | YES 21 | DO YOU LIKE CAKE 22 | I couldn't care less. 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/topicstar.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DO THE TOPICSTAR EXAMPLE 6 | Alright. How is the weather today? 7 | 8 | 9 | THE WEATHER IS * 10 | So is it going to be a day? 11 | 12 | 13 | 14 | I THINK SO 15 | What do you think of days? 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Alice/version.aiml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WHAT IS YOUR VERSION 6 | My current version is . 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/AliceChat/data/Rockwell-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/examples/AliceChat/data/Rockwell-24.vlw -------------------------------------------------------------------------------- /examples/AliceChat/data/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/AliceChat/data/properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ChatterBean default configuration properties 5 | context.xml 6 | splitters.xml 7 | substitutions.xml 8 | Alice/ 9 | ../Logs/ 10 | 11 | -------------------------------------------------------------------------------- /examples/AliceChat/data/splitters.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/AliceChat/data/substitutions.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/examples/AliceChat/data/substitutions.xml -------------------------------------------------------------------------------- /examples/ElizaChat/data/Rockwell-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/examples/ElizaChat/data/Rockwell-24.vlw -------------------------------------------------------------------------------- /examples/RebeccaChat/data/Rockwell-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/examples/RebeccaChat/data/Rockwell-24.vlw -------------------------------------------------------------------------------- /examples/RebeccaChat/data/rebecca/IU.aiml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | I * Why? Interesting gossip That is interesting That's good information Thanks for the information Do you mind if I tell other people I haven't heard anything like that before . PUSH YOU 13 | 14 | YOU * Interesting gossip Thanks for telling me That's good information Thanks for the information Do you mind if I tell other people I haven't heard anything like that before . PUSH YOU 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/RebeccaChat/data/rebecca/Music.aiml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | BEETHOVEN *It's amazing that he composed music while deaf. 13 | 14 | 15 | BEETHOVEN 16 | 17 | 18 | 19 | WHAT WAS THE * BEETHOVEN *Fidelio. 20 | WHO IS BEETHOVENThe dog or the deaf composer? 21 | WHO IS LUDWIG BEETHOVEN WHO IS BEETHOVEN 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/RebeccaChat/data/rebecca/Psychology.aiml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/examples/RebeccaChat/data/rebecca/Psychology.aiml -------------------------------------------------------------------------------- /examples/RebeccaChat/data/rebecca/update.aiml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | What are trees *Wood. 13 | What does a plant *Water and sunlight. 14 | When does leap year *Every four years. 15 | When does Christmas *December 25th. 16 | What religion is the popeCatholic. 17 | What color is dirtBrown. 18 | 19 | How many hearts *One. 20 | How many lungs *Two. 21 | 22 | -------------------------------------------------------------------------------- /reference/codeanticode/chatbots/alice/config/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.alice.config (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.alice.config 20 | 21 | 22 | 23 | Interfaces 24 | 25 | 26 | TokenizerConfig 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Classes 35 | 36 | 37 | TokenizerConfigStream 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Exceptions 46 | 47 | 48 | ConfigException 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /reference/codeanticode/chatbots/alice/script/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.alice.script (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.alice.script 20 | 21 | 22 | 23 | Interfaces 24 | 25 | 26 | Interpreter 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Exceptions 35 | 36 | 37 | InterpretingException 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /reference/codeanticode/chatbots/alice/util/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.alice.util (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.alice.util 20 | 21 | 22 | 23 | Classes 24 | 25 | 26 | Escaper 27 | 28 | Searcher 29 | 30 | Sequence 31 | 32 | SequenceMother 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /reference/codeanticode/chatbots/bob/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.bob (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.bob 20 | 21 | 22 | 23 | Classes 24 | 25 | 26 | Bob 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /reference/codeanticode/chatbots/rebecca/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeanticode.chatbots.rebecca (Javadocs: chatbots) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeanticode.chatbots.rebecca 20 | 21 | 22 | 23 | Classes 24 | 25 | 26 | Rebecca 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Javadocs: chatbots 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Frame Alert 32 | 33 | 34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | 36 | Link toNon-frame version. 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /reference/package-list: -------------------------------------------------------------------------------- 1 | codeanticode.chatbots.alice 2 | codeanticode.chatbots.alice.aiml 3 | codeanticode.chatbots.alice.config 4 | codeanticode.chatbots.alice.parser 5 | codeanticode.chatbots.alice.script 6 | codeanticode.chatbots.alice.text 7 | codeanticode.chatbots.alice.util 8 | codeanticode.chatbots.eliza 9 | codeanticode.chatbots.rebecca 10 | -------------------------------------------------------------------------------- /reference/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/reference/resources/inherit.gif -------------------------------------------------------------------------------- /resources/charliebot-src_4.1.8.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/resources/charliebot-src_4.1.8.tar.gz -------------------------------------------------------------------------------- /resources/chatterbean.src.00.008.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/resources/chatterbean.src.00.008.zip -------------------------------------------------------------------------------- /resources/code/ExampleTaglet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/resources/code/ExampleTaglet.class -------------------------------------------------------------------------------- /resources/code/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/resources/code/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /resources/code/doc.sh: -------------------------------------------------------------------------------- 1 | # a shell script to create a java documentation 2 | # for a processing library. 3 | # 4 | # make changes to the variables below so they 5 | # fit the structure of your library 6 | 7 | # the package name of your library 8 | package=template; 9 | 10 | # source folder location 11 | src=../src; 12 | 13 | # the destination folder of your documentation 14 | dest=../documentation; 15 | 16 | 17 | # compile the java documentation 18 | javadoc -d $dest -stylesheetfile ./stylesheet.css -sourcepath ${src} ${package} 19 | -------------------------------------------------------------------------------- /resources/online_materials: -------------------------------------------------------------------------------- 1 | AIML: http://en.wikipedia.org/wiki/AIML 2 | 3 | CharlieBot: https://sourceforge.net/projects/charliebot/ 4 | RebeccaAIML: http://rebecca-aiml.sourceforge.net/ 5 | ChatterBean: http://machineawakening.blogspot.com/2010/06/chatterbeans-last-source-package.html 6 | ELIZA: http://chayden.net/eliza/Eliza.html 7 | ProgramD: http://aitools.org/Main_Page 8 | https://launchpad.net/programd 9 | http://aitools.org/Free_AIML_sets 10 | 11 | -------------------------------------------------------------------------------- /resources/programd-1302.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeanticode/chatbots-library/48cd8cdbd69962c85b3244437982bc898ea0e5f1/resources/programd-1302.zip -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/GraphmasterMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice; 16 | 17 | import codeanticode.chatbots.alice.Graphmaster; 18 | import codeanticode.chatbots.alice.aiml.Srai; 19 | import codeanticode.chatbots.alice.aiml.Star; 20 | import codeanticode.chatbots.alice.aiml.Text; 21 | import codeanticode.chatbots.alice.aiml.Category; 22 | 23 | public class GraphmasterMother 24 | { 25 | /* 26 | Methods 27 | */ 28 | 29 | public Graphmaster newInstance() 30 | { 31 | Graphmaster root = new Graphmaster(); 32 | 33 | root.append(new Category(" SAY _ AGAIN ", "What, again? \"", new Star(1), "\".")); 34 | root.append(new Category(" SAY IT NOW ", "Whatever you want...")); 35 | root.append(new Category(" SAY * ", new Star(1), "!")); 36 | root.append(new Category(" DO YOU SEE THE * IN MY EYES ", "Yes, I see the ", new Star(1), " in your eyes.")); 37 | 38 | return root; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/AIMLElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@bol.com.br 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import java.util.List; 18 | 19 | public interface AIMLElement 20 | { 21 | /* 22 | Method Section 23 | */ 24 | 25 | public void appendChild(AIMLElement child); 26 | 27 | public void appendChildren(List children); 28 | } 29 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/AIMLParserConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | public class AIMLParserConfigurationException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AIMLParserConfigurationException(Exception e) 30 | { 31 | super(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/AIMLParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | public class AIMLParserException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AIMLParserException(Exception e) 30 | { 31 | super(e); 32 | } 33 | 34 | public AIMLParserException(String message) 35 | { 36 | super(message); 37 | } 38 | 39 | public AIMLParserException(String message, Throwable cause) 40 | { 41 | super(message, cause); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/AIMLStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@bol.com.br 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import java.util.LinkedList; 18 | import java.util.List; 19 | 20 | public class AIMLStack 21 | { 22 | /* 23 | Attributes 24 | */ 25 | 26 | private final List stack = new LinkedList(); 27 | 28 | /* 29 | Methods 30 | */ 31 | 32 | public Object peek() 33 | { 34 | return stack.get(0); 35 | } 36 | 37 | public Object pop() 38 | { 39 | return (stack.size() > 0 ? stack.remove(0) : null); 40 | } 41 | 42 | public void push(Object element) 43 | { 44 | stack.add(0, element); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Date.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import java.text.SimpleDateFormat; 18 | import org.xml.sax.Attributes; 19 | import codeanticode.chatbots.alice.Match; 20 | 21 | public class Date extends TemplateElement 22 | { 23 | /* 24 | Attributes 25 | */ 26 | 27 | private final SimpleDateFormat format = new SimpleDateFormat(); 28 | 29 | /* 30 | Constructors 31 | */ 32 | 33 | public Date() 34 | { 35 | } 36 | 37 | public Date(Attributes attributes) 38 | { 39 | } 40 | 41 | /* 42 | Methods 43 | */ 44 | 45 | public int hashCode() 46 | { 47 | return 13; 48 | } 49 | 50 | public String process(Match match) 51 | { 52 | try 53 | { 54 | format.applyPattern((String) match.getCallback().getContext().property("predicate.dateFormat")); 55 | return format.format(new java.util.Date()); 56 | } 57 | catch (NullPointerException e) 58 | { 59 | return ""; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Gender.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | import codeanticode.chatbots.alice.AliceBot; 20 | import codeanticode.chatbots.alice.Match; 21 | import codeanticode.chatbots.alice.text.Transformations; 22 | 23 | public class Gender extends TemplateElement 24 | { 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public Gender(Attributes attributes) 30 | { 31 | } 32 | 33 | public Gender(Object... children) 34 | { 35 | super(children); 36 | } 37 | 38 | /* 39 | Method Section 40 | */ 41 | 42 | public String process(Match match) 43 | { 44 | String input = super.process(match); 45 | AliceBot bot = match.getCallback(); 46 | Transformations transformations = bot.transformations(); 47 | return transformations.gender(input); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Gossip.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Context; 20 | import codeanticode.chatbots.alice.Match; 21 | 22 | public class Gossip extends TemplateElement 23 | { 24 | /* 25 | Constructors 26 | */ 27 | 28 | public Gossip(Attributes attributes) 29 | { 30 | } 31 | 32 | public Gossip(Object... children) 33 | { 34 | super(children); 35 | } 36 | 37 | /* 38 | Methods 39 | */ 40 | 41 | public String process(Match match) 42 | { 43 | AliceBot bot = null; 44 | Context context = null; 45 | if (match != null) try 46 | { 47 | bot = match.getCallback(); 48 | context = bot.getContext(); 49 | context.print(super.process(match)); 50 | } 51 | catch (Exception e) 52 | { 53 | throw new RuntimeException(e); 54 | } 55 | 56 | return ""; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Id.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Context; 20 | import codeanticode.chatbots.alice.Match; 21 | 22 | public class Id extends TemplateElement 23 | { 24 | /* 25 | Constructors 26 | */ 27 | 28 | public Id() 29 | { 30 | } 31 | 32 | public Id(Attributes attributes) 33 | { 34 | } 35 | 36 | /* 37 | Methods 38 | */ 39 | 40 | public boolean equals(Object obj) 41 | { 42 | if (!super.equals(obj)) 43 | return false; 44 | else 45 | return toString().equals(obj.toString()); 46 | } 47 | 48 | public int hashCode() 49 | { 50 | return process(null).hashCode(); 51 | } 52 | 53 | public String process(Match match) 54 | { 55 | if (match == null) return "unknown"; 56 | AliceBot bot = match.getCallback(); 57 | Context context = bot.getContext(); 58 | return context.id(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Lowercase.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Lowercase extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Lowercase(Attributes attributes) 27 | { 28 | } 29 | 30 | public Lowercase(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Methods 37 | */ 38 | 39 | public String process(Match match) 40 | { 41 | String result = super.process(match); 42 | if (result != null) 43 | return result.toLowerCase(); 44 | else 45 | return ""; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | import codeanticode.chatbots.alice.AliceBot; 20 | import codeanticode.chatbots.alice.Match; 21 | import codeanticode.chatbots.alice.text.Transformations; 22 | 23 | public class Person extends TemplateElement 24 | { 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public Person(Attributes attributes) 30 | { 31 | } 32 | 33 | public Person(Object... children) 34 | { 35 | super(children); 36 | } 37 | 38 | /* 39 | Method Section 40 | */ 41 | 42 | public String process(Match match) 43 | { 44 | String input = super.process(match); 45 | AliceBot bot = match.getCallback(); 46 | Transformations transformations = bot.transformations(); 47 | return transformations.person(input); 48 | } 49 | } -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Person2.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Match; 20 | import codeanticode.chatbots.alice.text.Transformations; 21 | 22 | public class Person2 extends TemplateElement 23 | { 24 | /* 25 | Constructor Section 26 | */ 27 | 28 | public Person2(Attributes attributes) 29 | { 30 | } 31 | 32 | public Person2(Object... children) 33 | { 34 | super(children); 35 | } 36 | 37 | /* 38 | Method Section 39 | */ 40 | 41 | public String process(Match match) 42 | { 43 | String input = super.process(match); 44 | AliceBot bot = match.getCallback(); 45 | Transformations transformations = bot.transformations(); 46 | return transformations.person2(input); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Random.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | import codeanticode.chatbots.alice.AliceBot; 20 | import codeanticode.chatbots.alice.Context; 21 | import codeanticode.chatbots.alice.Match; 22 | 23 | public class Random extends TemplateElement 24 | { 25 | /* 26 | Constructor 27 | */ 28 | 29 | public Random() 30 | { 31 | } 32 | 33 | public Random(Attributes attributes) 34 | { 35 | } 36 | 37 | public Random(Object... children) 38 | { 39 | super(children); 40 | } 41 | 42 | /* 43 | Methods 44 | */ 45 | 46 | public String process(Match match) 47 | { 48 | AliceBot bot = match.getCallback(); 49 | Context context = bot.getContext(); 50 | java.util.Random random = context.random(); 51 | 52 | int n = children().size(); 53 | TemplateElement child = getChildren(random.nextInt(n)); 54 | return child.process(match); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Size.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Size extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Size() 27 | { 28 | } 29 | 30 | public Size(Attributes attributes) 31 | { 32 | } 33 | 34 | /* 35 | Methods 36 | */ 37 | 38 | public String process(Match match) 39 | { 40 | try 41 | { 42 | return Integer.toString(match.getCallback().getGraphmaster().size()); 43 | } 44 | catch (NullPointerException e) 45 | { 46 | return "0"; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Sr.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | public class Sr extends Srai 20 | { 21 | /* 22 | Constructors 23 | */ 24 | 25 | public Sr(Attributes attributes) 26 | { 27 | super(attributes); 28 | setChildren(new TemplateElement[] {new Star(attributes)}); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Template.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | 19 | public class Template extends TemplateElement 20 | { 21 | /* 22 | Constructor Section 23 | */ 24 | 25 | public Template(Attributes attributes) 26 | { 27 | super(); 28 | } 29 | 30 | public Template(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Method Section 37 | */ 38 | 39 | public String toString() 40 | { 41 | StringBuilder value = new StringBuilder(); 42 | value.append(""); 43 | for (TemplateElement i : children()) 44 | value.append(i.toString()); 45 | value.append(""); 46 | 47 | return value.toString(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Text.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import codeanticode.chatbots.alice.Match; 18 | 19 | public class Text extends TemplateElement 20 | { 21 | /* 22 | Attributes 23 | */ 24 | 25 | private final String value; 26 | 27 | /* 28 | Constructor 29 | */ 30 | 31 | public Text(String value) 32 | { 33 | this.value = value; 34 | } 35 | 36 | /* 37 | Methods 38 | */ 39 | 40 | public boolean equals(Object obj) 41 | { 42 | if (obj == null) return false; 43 | String text = obj.toString(); 44 | return (text != null ? text.equals(value) : value == null); 45 | } 46 | 47 | public int hashCode() 48 | { 49 | return (value == null ? 0 : value.hashCode()); 50 | } 51 | 52 | public String toString() 53 | { 54 | return value; 55 | } 56 | 57 | public String process(Match match) 58 | { 59 | return value; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Think.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Think extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Think(Attributes attributes) 27 | { 28 | } 29 | 30 | public Think(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Methods 37 | */ 38 | 39 | public String process(Match match) 40 | { 41 | super.process(match); 42 | return ""; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Uppercase.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.Match; 19 | 20 | public class Uppercase extends TemplateElement 21 | { 22 | /* 23 | Constructors 24 | */ 25 | 26 | public Uppercase(Attributes attributes) 27 | { 28 | } 29 | 30 | public Uppercase(Object... children) 31 | { 32 | super(children); 33 | } 34 | 35 | /* 36 | Methods 37 | */ 38 | 39 | public String process(Match match) 40 | { 41 | String result = super.process(match); 42 | if (result != null) 43 | return result.toUpperCase(); 44 | else 45 | return ""; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/aiml/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.aiml; 16 | 17 | import org.xml.sax.Attributes; 18 | import codeanticode.chatbots.alice.AliceBot; 19 | import codeanticode.chatbots.alice.Context; 20 | import codeanticode.chatbots.alice.Match; 21 | 22 | public class Version extends TemplateElement 23 | { 24 | /* 25 | Constructors 26 | */ 27 | 28 | public Version() 29 | { 30 | } 31 | 32 | public Version(Attributes attributes) 33 | { 34 | } 35 | 36 | /* 37 | Methods 38 | */ 39 | 40 | public String process(Match match) 41 | { 42 | AliceBot bot = match.getCallback(); 43 | Context context = bot.getContext(); 44 | return (String) context.property("bot.version"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/config/TokenizerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.config; 16 | 17 | import codeanticode.chatbots.alice.text.Tokenizer; 18 | 19 | public interface TokenizerConfig 20 | { 21 | public Tokenizer newInstance(); 22 | 23 | public String[] splitters(); 24 | } 25 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/parser/AliceBotParserConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.parser; 16 | 17 | public class AliceBotParserConfigurationException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AliceBotParserConfigurationException(Exception e) 30 | { 31 | super(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/parser/AliceBotParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.parser; 16 | 17 | public class AliceBotParserException extends Exception 18 | { 19 | /* 20 | Attribute Section 21 | */ 22 | 23 | private static final long serialVersionUID = 7L; 24 | 25 | /* 26 | Constructor Section 27 | */ 28 | 29 | public AliceBotParserException(Exception e) 30 | { 31 | super(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/parser/ReflectionBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.parser; 16 | 17 | public interface ReflectionBuilder 18 | { 19 | /* 20 | Methods 21 | */ 22 | 23 | public void characters(char[] chars, int start, int length); 24 | 25 | public void clear(); 26 | } 27 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/script/Interpreter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.script; 16 | 17 | public interface Interpreter 18 | { 19 | public Object evaluate(String script) throws InterpretingException; 20 | 21 | public Object variable(String name) throws InterpretingException; 22 | 23 | public void variable(String name, Object value) throws InterpretingException; 24 | } 25 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/script/InterpretingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.script; 16 | 17 | /** 18 | Base class for script-interpreting exceptions. 19 | */ 20 | public class InterpretingException extends Exception 21 | { 22 | /** Version class identifier for the serialization engine. Matches the number of the last revision where the class was created / modified. */ 23 | private static final long serialVersionUID = 8L; 24 | 25 | public InterpretingException(Exception cause) 26 | { 27 | super(cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/text/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.text; 16 | 17 | import java.util.Arrays; 18 | import java.util.LinkedList; 19 | import java.util.List; 20 | 21 | public class Response extends Request 22 | { 23 | /* 24 | Constructor 25 | */ 26 | 27 | public Response() 28 | { 29 | super(); 30 | } 31 | 32 | public Response(String original) 33 | { 34 | super(original); 35 | } 36 | 37 | public Response(String original, Sentence... sentences) 38 | { 39 | super(original, sentences); 40 | } 41 | 42 | /* 43 | Methods 44 | */ 45 | 46 | public void append(String output) 47 | { 48 | StringBuilder builder = new StringBuilder(); 49 | String original = getOriginal(); 50 | if (original != null) 51 | { 52 | builder.append(original); 53 | if (builder.charAt(builder.length() - 1) != ' ') 54 | builder.append(' '); 55 | } 56 | 57 | builder.append(output); 58 | setOriginal(builder.toString()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/text/TokenizerMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.text; 16 | 17 | import java.io.FileInputStream; 18 | import codeanticode.chatbots.alice.config.TokenizerConfig; 19 | import codeanticode.chatbots.alice.config.TokenizerConfigStream; 20 | 21 | public class TokenizerMother 22 | { 23 | /* 24 | Method Section 25 | */ 26 | 27 | public static Tokenizer newInstance() throws Exception 28 | { 29 | TokenizerConfig config = new TokenizerConfigStream(new FileInputStream("Bots/splitters.xml")); 30 | return new Tokenizer(config); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/text/TransformationsMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.text; 16 | 17 | import java.io.FileInputStream; 18 | import codeanticode.chatbots.alice.parser.TransformationsParser; 19 | 20 | public class TransformationsMother 21 | { 22 | /* 23 | Methods 24 | */ 25 | 26 | public Transformations newInstance() throws Exception 27 | { 28 | TransformationsParser parser = new TransformationsParser(); 29 | return parser.parse(new FileInputStream("Bots/splitters.xml"), new FileInputStream("Bots/substitutions.xml")); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/alice/util/SequenceMother.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyleft (C) 2005 H�lio Perroni Filho 3 | xperroni@yahoo.com 4 | ICQ: 2490863 5 | 6 | This file is part of ChatterBean. 7 | 8 | ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 9 | 10 | ChatterBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with ChatterBean (look at the Documents/ directory); if not, either write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or visit (http://www.gnu.org/licenses/gpl.txt). 13 | */ 14 | 15 | package codeanticode.chatbots.alice.util; 16 | 17 | import java.io.File; 18 | import codeanticode.chatbots.alice.util.Sequence; 19 | 20 | public class SequenceMother 21 | { 22 | /* 23 | Attributes 24 | */ 25 | 26 | public static final File file = new File("Logs/sequence.txt"); 27 | 28 | /* 29 | Methods 30 | */ 31 | 32 | public Sequence newInstance() 33 | { 34 | return new Sequence(file); 35 | } 36 | 37 | public void reset() 38 | { 39 | (new File(file.getPath() + ".backup")).delete(); 40 | file.delete(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/base/Base.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.base; 2 | 3 | import processing.core.*; 4 | 5 | abstract class Base { 6 | PApplet parent; 7 | boolean finished = false; 8 | 9 | public Base(PApplet parent) { 10 | this.parent = parent; 11 | parent.registerDispose(this); 12 | } 13 | 14 | public void dispose() { 15 | // anything in here will be called automatically when 16 | // the parent applet shuts down. for instance, this might 17 | // shut down a thread used by this library. 18 | // note that this currently has issues, see bug #183 19 | // http://dev.processing.org/bugs/show_bug.cgi?id=183 20 | } 21 | 22 | public boolean finished() { 23 | return finished; 24 | } 25 | 26 | /** 27 | * Process a line of input. 28 | */ 29 | abstract public String processInput(String s); 30 | } 31 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/DecompList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza decomp list. 7 | * This stores all the decompositions of a single key. 8 | */ 9 | public class DecompList extends Vector { 10 | 11 | /** 12 | * Add another decomp rule to the list. 13 | */ 14 | public void add(String word, boolean mem, ReasembList reasmb) { 15 | addElement(new Decomp(word, mem, reasmb)); 16 | } 17 | 18 | /** 19 | * Print the whole decomp list. 20 | */ 21 | public void print(int indent) { 22 | for (int i = 0; i < size(); i++) { 23 | Decomp d = (Decomp)elementAt(i); 24 | d.print(indent); 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/Key.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * Eliza key. 5 | * A key has the key itself, a rank, and a list of decompositon rules. 6 | */ 7 | public class Key { 8 | /** The key itself */ 9 | String key; 10 | /** The numerical rank */ 11 | int rank; 12 | /** The list of decompositions */ 13 | DecompList decomp; 14 | 15 | /** 16 | * Initialize the key. 17 | */ 18 | Key(String key, int rank, DecompList decomp) { 19 | this.key = key; 20 | this.rank = rank; 21 | this.decomp = decomp; 22 | } 23 | 24 | /** 25 | * Another initialization for gotoKey. 26 | */ 27 | Key() { 28 | key = null; 29 | rank = 0; 30 | decomp = null; 31 | } 32 | 33 | public void copy(Key k) { 34 | key = k.key(); 35 | rank = k.rank(); 36 | decomp = k.decomp(); 37 | } 38 | 39 | /** 40 | * Print the key and all under it. 41 | */ 42 | public void print(int indent) { 43 | for (int i = 0; i < indent; i++) System.out.print(" "); 44 | System.out.println("key: " + key + " " + rank); 45 | decomp.print(indent+2); 46 | } 47 | 48 | /** 49 | * Print the key and rank only, not the rest. 50 | */ 51 | public void printKey(int indent) { 52 | for (int i = 0; i < indent; i++) System.out.print(" "); 53 | System.out.println("key: " + key + " " + rank); 54 | } 55 | 56 | /** 57 | * Get the key value. 58 | */ 59 | public String key() { 60 | return key; 61 | } 62 | 63 | /** 64 | * Get the rank. 65 | */ 66 | public int rank() { 67 | return rank; 68 | } 69 | 70 | /** 71 | * Get the decomposition list. 72 | */ 73 | public DecompList decomp() { 74 | return decomp; 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/KeyList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza key list. 7 | * This stores all the keys. 8 | */ 9 | public class KeyList extends Vector { 10 | 11 | /** 12 | * Add a new key. 13 | */ 14 | public void add(String key, int rank, DecompList decomp) { 15 | addElement(new Key(key, rank, decomp)); 16 | } 17 | 18 | /** 19 | * Print all the keys. 20 | */ 21 | public void print(int indent) { 22 | for (int i = 0; i < size(); i++) { 23 | Key k = (Key)elementAt(i); 24 | k.print(indent); 25 | } 26 | } 27 | 28 | /** 29 | * Search the key list for a given key. 30 | * Return the Key if found, else null. 31 | */ 32 | Key getKey(String s) { 33 | for (int i = 0; i < size(); i++) { 34 | Key key = (Key)elementAt(i); 35 | if (s.equals(key.key())) return key; 36 | } 37 | return null; 38 | } 39 | 40 | /** 41 | * Break the string s into words. 42 | * For each word, if isKey is true, then push the key 43 | * into the stack. 44 | */ 45 | public void buildKeyStack(KeyStack stack, String s) { 46 | stack.reset(); 47 | s = EString.trim(s); 48 | String lines[] = new String[2]; 49 | Key k; 50 | while (EString.match(s, "* *", lines)) { 51 | k = getKey(lines[0]); 52 | if (k != null) stack.pushKey(k); 53 | s = lines[1]; 54 | } 55 | k = getKey(s); 56 | if (k != null) stack.pushKey(k); 57 | //stack.print(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/KeyStack.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * A stack of keys. 5 | * The keys are kept in rank order. 6 | */ 7 | public class KeyStack { 8 | 9 | /** The stack size */ 10 | final int stackSize = 20; 11 | /** The key stack */ 12 | Key keyStack[] = new Key[stackSize]; 13 | /** The top of the key stack */ 14 | int keyTop = 0; 15 | 16 | /** 17 | * Prints the key stack. 18 | */ 19 | public void print() { 20 | System.out.println("Key stack " + keyTop); 21 | for (int i = 0; i < keyTop; i++) { 22 | keyStack[i].printKey(0); 23 | } 24 | } 25 | 26 | /** 27 | * Get the stack size. 28 | */ 29 | public int keyTop() { 30 | return keyTop; 31 | } 32 | 33 | /** 34 | * Reset the key stack. 35 | */ 36 | public void reset() { 37 | keyTop = 0; 38 | } 39 | 40 | /** 41 | * Get a key from the stack. 42 | */ 43 | public Key key(int n) { 44 | if (n < 0 || n >= keyTop) return null; 45 | return keyStack[n]; 46 | } 47 | 48 | /** 49 | * Push a key in the stack. 50 | * Keep the highest rank keys at the bottom. 51 | */ 52 | public void pushKey(Key key) { 53 | if (key == null) { 54 | System.out.println("push null key"); 55 | return; 56 | } 57 | int i; 58 | for (i = keyTop; i > 0; i--) { 59 | if (key.rank > keyStack[i-1].rank) keyStack[i] = keyStack[i-1]; 60 | else break; 61 | } 62 | keyStack[i] = key; 63 | keyTop++; 64 | } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/Mem.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * Eliza memory class 5 | */ 6 | 7 | public class Mem { 8 | 9 | /** The memory size */ 10 | final int memMax = 20; 11 | /** The memory */ 12 | String memory[] = new String[memMax]; 13 | /** The memory top */ 14 | int memTop = 0; 15 | 16 | public void save(String str) { 17 | if (memTop < memMax) { 18 | memory[memTop++] = new String(str); 19 | } 20 | } 21 | 22 | public String get() { 23 | if (memTop == 0) return null; 24 | String m = memory[0]; 25 | for (int i = 0; i < memTop-1; i++) 26 | memory[i] = memory[i+1]; 27 | memTop--; 28 | return m; 29 | } 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/PrePost.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | /** 4 | * Eliza pre-post entry (two words). 5 | * This is used to store pre transforms or post transforms. 6 | */ 7 | public class PrePost { 8 | /** The words */ 9 | String src; 10 | String dest; 11 | 12 | /** 13 | * Initialize the pre-post entry. 14 | */ 15 | PrePost(String src, String dest) { 16 | this.src = src; 17 | this.dest = dest; 18 | } 19 | 20 | /** 21 | * Print the pre-post entry. 22 | */ 23 | public void print(int indent) { 24 | for (int i = 0; i < indent; i++) System.out.print(" "); 25 | System.out.println("pre-post: " + src + " " + dest); 26 | } 27 | 28 | /** 29 | * Get src. 30 | */ 31 | public String src() { 32 | return src; 33 | } 34 | 35 | /** 36 | * Get dest. 37 | */ 38 | public String dest() { 39 | return dest; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/PrePostList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza prePost list. 7 | * This list of pre-post entries is used to perform word transformations 8 | * prior to or after other processing. 9 | */ 10 | public class PrePostList extends Vector { 11 | 12 | /** 13 | * Add another entry to the list. 14 | */ 15 | public void add(String src, String dest) { 16 | addElement(new PrePost(src, dest)); 17 | } 18 | 19 | /** 20 | * Prnt the pre-post list. 21 | */ 22 | public void print(int indent) { 23 | for (int i = 0; i < size(); i++) { 24 | PrePost p = (PrePost)elementAt(i); 25 | p.print(indent); 26 | } 27 | } 28 | 29 | /** 30 | * Translate a string. 31 | * If str matches a src string on the list, 32 | * return he corresponding dest. 33 | * If no match, return the input. 34 | */ 35 | String xlate(String str) { 36 | for (int i = 0; i < size(); i++) { 37 | PrePost p = (PrePost)elementAt(i); 38 | if (str.equals(p.src())) { 39 | return p.dest(); 40 | } 41 | } 42 | return str; 43 | } 44 | 45 | /** 46 | * Translate a string s. 47 | * (1) Trim spaces off. 48 | * (2) Break s into words. 49 | * (3) For each word, substitute matching src word with dest. 50 | */ 51 | public String translate(String s) { 52 | String lines[] = new String[2]; 53 | String work = EString.trim(s); 54 | s = ""; 55 | while (EString.match(work, "* *", lines)) { 56 | s += xlate(lines[0]) + " "; 57 | work = EString.trim(lines[1]); 58 | } 59 | s += xlate(work); 60 | return s; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/ReasembList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza reassembly list. 7 | */ 8 | public class ReasembList extends Vector { 9 | 10 | /** 11 | * Add an element to the reassembly list. 12 | */ 13 | public void add(String reasmb) { 14 | addElement(reasmb); 15 | } 16 | 17 | /** 18 | * Print the reassembly list. 19 | */ 20 | public void print(int indent) { 21 | for (int i = 0; i < size(); i++) { 22 | for (int j = 0; j < indent; j++) System.out.print(" "); 23 | String s = (String)elementAt(i); 24 | System.out.println("reasemb: " + s); 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/eliza/WordList.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.eliza; 2 | 3 | import java.util.Vector; 4 | 5 | /** 6 | * Eliza word list. 7 | */ 8 | public class WordList extends Vector { 9 | 10 | /** 11 | * Add another word to the list. 12 | */ 13 | public void add(String word) { 14 | addElement(word); 15 | } 16 | 17 | /** 18 | * Print a word list on one line. 19 | */ 20 | public void print(int indent) { 21 | for (int i = 0; i < size(); i++) { 22 | String s = (String)elementAt(i); 23 | System.out.print(s + " "); 24 | } 25 | System.out.println(); 26 | } 27 | 28 | /** 29 | * Find a string in a word list. 30 | * Return true if the word is in the list, false otherwise. 31 | */ 32 | boolean find(String s) { 33 | for (int i = 0; i < size(); i++) { 34 | if (s.equals((String)elementAt(i))) return true; 35 | } 36 | return false; 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/codeanticode/chatbots/rebecca/Rebecca.java: -------------------------------------------------------------------------------- 1 | package codeanticode.chatbots.rebecca; 2 | 3 | import processing.core.*; 4 | 5 | import rebecca.NetworkAimlFacade; 6 | import rebecca.GraphBuilder; 7 | import rebecca.NetworkException; 8 | 9 | 10 | public class Rebecca { 11 | public Rebecca(PApplet parent, String aimDir) { 12 | this.parent = parent; 13 | parent.registerDispose(this); 14 | try { 15 | aiml = new NetworkAimlFacade(new String[]{"rebecca"}); 16 | builder = aiml.getNetworkGraphBuilder(); 17 | builder.addDirectoryUnlessAlreadyAdded(parent.dataPath(aimDir)); 18 | builder.createGraph(); 19 | botName = builder.getBotPredicate("name"); 20 | initialResponse = builder.getResponse("connect"); 21 | } catch(NetworkException e) { 22 | e.printStackTrace(); 23 | } catch (Exception e) { 24 | e.printStackTrace(); 25 | } 26 | } 27 | 28 | public void dispose() { 29 | try { 30 | aiml.destroy(); 31 | } catch(NetworkException e) { 32 | e.printStackTrace(); 33 | } catch (Exception e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | 38 | public boolean finished() { 39 | return finished; 40 | } 41 | 42 | /** 43 | * Process a line of input. 44 | */ 45 | public String processInput(String s) { 46 | try { 47 | return builder.getResponse(s); 48 | } catch(NetworkException e) { 49 | e.printStackTrace(); 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } 53 | return "Ahhhh!"; 54 | } 55 | 56 | public String initialResponse; 57 | 58 | NetworkAimlFacade aiml = null; 59 | GraphBuilder builder; 60 | String botName; 61 | 62 | PApplet parent; 63 | boolean finished = false; 64 | } 65 | --------------------------------------------------------------------------------
34 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 35 | 36 | Link toNon-frame version. 37 |