I'm glad you could drop by today.", "Hi there. pairs = ( ( r "I need (.*)", ( "Why do you need %1?", "Would it really help you to get %1?", "Are you sure you need %1?", ), ), ( r "Why don\'t you (.*)", ( "Do you really think I don't %1?", "Perhaps eventually I will %1.", "Do you really want me to %1?", ), ), ( r "Why can\'t I (.*)", ( "Do you think you should be able to %1?", "If you could %1, what would you do?", "I don't know - why can't you %1?", "Have you really tried?", ), ), ( r "I can\'t (.*)", ( "How do you know you can't %1?", "Perhaps you could %1 if you tried.", "What would it take for you to %1?", ), ), ( r "I am (.*)", ( "Did you come to me because you are %1?", "How long have you been %1?", "How do you feel about being %1?", ), ), ( r "I\'m (.*)", ( "How does being %1 make you feel?", "Do you enjoy being %1?", "Why do you tell me you're %1?", "Why do you think you're %1?", ), ), ( r "Are you (.*)", ( "Why does it matter whether I am %1?", "Would you prefer it if I were not %1?", "Perhaps you believe I am %1.", "I may be %1 - what do you think?", ), ), ( r "What (.*)", ( "Why do you ask?", "How would an answer to that help you?", "What do you think?", ), ), ( r "How (.*)", ( "How do you suppose?", "Perhaps you can answer your own question.", "What is it you're really asking?", ), ), ( r "Because (.*)", ( "Is that the real reason?", "What other reasons come to mind?", "Does that reason apply to anything else?", "If %1, what else must be true?", ), ), ( r "(.*) sorry (.*)", ( "There are many times when no apology is needed.", "What feelings do you have when you apologize?", ), ), ( r "Hello(.*)", ( "Hello. "I am" -> "you are" from import Chat, reflections # a table of response pairs, where each pair consists of a # regular expression, and a list of possible responses, # with group-macros labelled as %1, %2. # a translation table used to convert things you say into things the # computer says back, e.g. # Natural Language Toolkit: Eliza # Copyright (C) 2001-2023 NLTK Project # Authors: Steven Bird # Edward Loper # URL: # For license information, see LICENSE.TXT # Based on an Eliza implementation by Joe Strout, # Jeff Epler and Jez Higgins.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |