ó <żCVc%@sdZddlmZddlmZmZddzfd d{fd d|fdd}fdd~fddfdd€fddfd!d‚fd$dƒfd(d„fd,d…fd/d†fd2d‡fd5dˆfd8d‰fd=dŠfdAd‹fdEdŒfd dfdJdŽfdNdfdRdfdUd‘fdXd’fd[d“fd^d”fdad•fddd–fdid—fdld˜fdpd™ff ZeeeƒZdv„Zdw„Z e dxkr‰e ƒndyS(šs Zen Chatbot talks in gems of Zen wisdom. This is a sample conversation with Zen Chatbot: ZC: Welcome, my child. me: Good afternoon. ZC: Ask the question you have come to ask. me: How can I achieve enlightenment? ZC: How do you suppose? me: Through meditation. ZC: Form is emptiness, and emptiness form. me: How can I empty my mind of worldly troubles? ZC: Will an answer to that really help in your search for enlightenment? me: Yes. ZC: It is better to be right than to be certain. me: I seek truth and wisdom. ZC: The search for truth is a long journey. me: Are you sure? ZC: Maybe sure, maybe not sure. The chatbot structure is based on that of chat.eliza. Thus, it uses a translation table to convert from question to response i.e. "I am" --> "you are" Of course, since Zen Chatbot does not understand the meaning of any words, responses are very limited. Zen Chatbot will usually answer very vaguely, or respond to a question by asking a different question, in much the same way as Eliza. i˙˙˙˙(tprint_function(tChatt reflectionss(hello(.*))|(good [a-zA-Z]+)s4The path to enlightenment is often difficult to see.sCGreetings. I sense your mind is troubled. Tell me of your troubles.s&Ask the question you have come to ask.s"Hello. Do you seek englightenment?s i need (.*)s;%1 can be achieved by hard work and dedication of the mind.sM%1 is not a need, but a desire of the mind. Clear your mind of such concerns.s6Focus your mind on%1, and you will find what you need.s i want (.*)sFDesires of the heart will distract you from the path to enlightenment.s%Will%1 help you attain enlightenment?s+Is%1 a desire of the mind, or of the heart?swhy (.*) i (.*)\?sYou%1%2?sPerhaps you only think you%1%2swhy (.*) you(.*)\?s Why%1 you%2?s%2 I%1sAre you sure I%2?s why (.*)\?sI cannot tell you why%1.sWhy do you think %1?sare you (.*)\?sMaybe%1, maybe not%1.s(Whether I am%1 or not is God's business.s am i (.*)\?sPerhaps%1, perhaps not%1.s.Whether you are%1 or not is not for me to say.s what (.*)\?sSeek truth, not what%1.sWhat%1 should not concern you.s how (.*)\?sHow do you suppose?sDWill an answer to that really help in your search for enlightenment?sAsk yourself not how, but why.scan you (.*)\?sI probably can, but I may not.s"Maybe I can%1, and maybe I cannot.s#I can do all, and I can do nothing.s can i (.*)\?s;You can%1 if you believe you can%1, and have a pure spirit.s*Seek truth and you will know if you can%1.s it is (.*)sBHow can you be certain that%1, when you do not even know yourself?s<Whether it is%1 or not does not change the way the world is.sis there (.*)\?s#There is%1 if you believe there is.sIt is possible that there is%1.sis(.*)\?s%1 is not relevant.sDoes this matter?s(.*)\?sDo you think %1?s,You seek the truth. Does the truth seek you?sZIf you intentionally pursue the answers to your questions, the answers become hard to see.sCThe answer to your question cannot be told. It must be experienced.s/(.*) (hate[s]?)|(dislike[s]?)|(don\'t like)(.*)s>Perhaps it is not about hating %2, but about hate from within.s$Weeds only grow when we dislike themsHate is a very strong emotion.s(.*) truth(.*)s$Seek truth, and truth will seek you.s:Remember, it is not the spoon which bends - only yourself.s'The search for truth is a long journey.si want to (.*)s*You may %1 if your heart truly desires to.sYou may have to %1.s Does your heart truly desire %1?s.Is this a desire of the heart, or of the mind?s i can\'t (.*)s5What we can and can't do is a limitation of the mind.s?There are limitations of the body, and limitations of the mind.s&Have you tried to%1 with a clear mind?s i think (.*)s"Uncertainty in an uncertain world.sBIndeed, how can we be certain of anything in such uncertain times.s%Are you not, in fact, certain that%1?s i feel (.*)slYour body and your emotions are both symptoms of your mind.What do you believe is the root of such feelings?s.Feeling%1 can be a sign of your state-of-mind.s(.*)!s-I sense that you are feeling emotional today.sYou need to calm your emotions.s because (.*)sUDoes knowning the reasons behind things help you to understand the things themselves?sIf%1, what else must be true?s (yes)|(no)s)Is there certainty in an uncertain world?s,It is better to be right than to be certain.s (.*)love(.*)sıThink of the trees: they let the birds perch and fly with no intention to call them when they come, and no longing for their return when they fly away. Let your heart be like the trees.s Free love!s(.*)understand(.*)sfIf you understand, things are just as they are; if you do not understand, things are just as they are.s-Imagination is more important than knowledge.s#(.*)(me )|( me)|(my)|(mine)|(i)(.*)s1'I', 'me', 'my'... these are selfish expressions.s<Have you ever considered that you might be a selfish person?s*Try to consider others, not just yourself.s*Think not just of yourself, but of others.syou (.*)s My path is not of conern to you.s#I am but one, and you but one more.texits#Farewell. The obstacle is the path.s/Farewell. Life is a journey, not a destination.sŒGood bye. We are cups, constantly and quietly being filled. The trick is knowning how to tip ourselves over and let the beautiful stuff out.s(.*)s.When you're enlightened, every word is wisdom.sRandom talk is useless.s)The reverse side also has a reverse side.s)Form is emptiness, and emptiness is form.s,I pour out a cup of water. Is the cup empty?cCs|tddƒtdjdƒƒtddƒtdjdƒƒtdƒtdƒtddƒtdƒtjƒdS(Nt*iKs Zen Chatbot!s:"Look beyond mere words and letters - look into your mind"s** Talk your way to truth with Zen Chatbot.s'* Type 'quit' when you have had enough.sWelcome, my child.(tprinttcentert zen_chatbottconverse(((s_/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/chat/zen.pytzen_chat s   cCs tƒdS(N(R (((s_/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/chat/zen.pytdemost__main__N(s4The path to enlightenment is often difficult to see.sCGreetings. I sense your mind is troubled. Tell me of your troubles.s&Ask the question you have come to ask.s"Hello. Do you seek englightenment?(s;%1 can be achieved by hard work and dedication of the mind.sM%1 is not a need, but a desire of the mind. Clear your mind of such concerns.s6Focus your mind on%1, and you will find what you need.(sFDesires of the heart will distract you from the path to enlightenment.s%Will%1 help you attain enlightenment?s+Is%1 a desire of the mind, or of the heart?(sYou%1%2?sPerhaps you only think you%1%2(s Why%1 you%2?s%2 I%1sAre you sure I%2?(sI cannot tell you why%1.sWhy do you think %1?(sMaybe%1, maybe not%1.s(Whether I am%1 or not is God's business.(sPerhaps%1, perhaps not%1.s.Whether you are%1 or not is not for me to say.(sSeek truth, not what%1.sWhat%1 should not concern you.(sHow do you suppose?sDWill an answer to that really help in your search for enlightenment?sAsk yourself not how, but why.(sI probably can, but I may not.s"Maybe I can%1, and maybe I cannot.s#I can do all, and I can do nothing.(s;You can%1 if you believe you can%1, and have a pure spirit.s*Seek truth and you will know if you can%1.(sBHow can you be certain that%1, when you do not even know yourself?s<Whether it is%1 or not does not change the way the world is.(s#There is%1 if you believe there is.sIt is possible that there is%1.(s%1 is not relevant.sDoes this matter?(sDo you think %1?s,You seek the truth. Does the truth seek you?sZIf you intentionally pursue the answers to your questions, the answers become hard to see.sCThe answer to your question cannot be told. It must be experienced.(s>Perhaps it is not about hating %2, but about hate from within.s$Weeds only grow when we dislike themsHate is a very strong emotion.(s$Seek truth, and truth will seek you.s:Remember, it is not the spoon which bends - only yourself.s'The search for truth is a long journey.(s*You may %1 if your heart truly desires to.sYou may have to %1.(s Does your heart truly desire %1?s.Is this a desire of the heart, or of the mind?(s5What we can and can't do is a limitation of the mind.s?There are limitations of the body, and limitations of the mind.s&Have you tried to%1 with a clear mind?(s"Uncertainty in an uncertain world.sBIndeed, how can we be certain of anything in such uncertain times.s%Are you not, in fact, certain that%1?(slYour body and your emotions are both symptoms of your mind.What do you believe is the root of such feelings?s.Feeling%1 can be a sign of your state-of-mind.(s-I sense that you are feeling emotional today.sYou need to calm your emotions.(sUDoes knowning the reasons behind things help you to understand the things themselves?sIf%1, what else must be true?(s)Is there certainty in an uncertain world?s,It is better to be right than to be certain.(sıThink of the trees: they let the birds perch and fly with no intention to call them when they come, and no longing for their return when they fly away. Let your heart be like the trees.s Free love!(sfIf you understand, things are just as they are; if you do not understand, things are just as they are.s-Imagination is more important than knowledge.(s1'I', 'me', 'my'... these are selfish expressions.s<Have you ever considered that you might be a selfish person?s*Try to consider others, not just yourself.s*Think not just of yourself, but of others.(s My path is not of conern to you.s#I am but one, and you but one more.(s#Farewell. The obstacle is the path.s/Farewell. Life is a journey, not a destination.sŒGood bye. We are cups, constantly and quietly being filled. The trick is knowning how to tip ourselves over and let the beautiful stuff out.(s.When you're enlightened, every word is wisdom.sRandom talk is useless.s)The reverse side also has a reverse side.s)Form is emptiness, and emptiness is form.s,I pour out a cup of water. Is the cup empty?( t__doc__t __future__Rtnltk.chat.utilRRt responsesRR R t__name__(((s_/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/chat/zen.pyt%sô