{"id":2373,"date":"2025-03-31T13:22:45","date_gmt":"2025-03-31T12:22:45","guid":{"rendered":"https:\/\/matthewolden.co.uk\/?p=2373"},"modified":"2025-03-31T13:22:45","modified_gmt":"2025-03-31T12:22:45","slug":"eliza-responses","status":"publish","type":"post","link":"https:\/\/matthewolden.co.uk\/?p=2373","title":{"rendered":"ELIZA Responses"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">here is the bit of ELIZA code that gives us the response<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> &nbsp; self.patterns = [<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I need (.*)&#8217;, [&#8220;Why do you need {0}?&#8221;, &#8220;Would it really help you to get {0}?&#8221;, &#8220;Are you sure you need {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Why don\\&#8217;t you (.*)&#8217;, [&#8220;Do you really think I don&#8217;t {0}?&#8221;, &#8220;Perhaps eventually I will {0}.&#8221;, &#8220;Do you want me to {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Why can\\&#8217;t I (.*)&#8217;, [&#8220;Do you think you should be able to {0}?&#8221;, &#8220;If you could {0}, what would you do?&#8221;, &#8220;I don&#8217;t know \u2014 why can&#8217;t you {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I am (.*)&#8217;, [&#8220;Did you come to me because you are {0}?&#8221;, &#8220;How long have you been {0}?&#8221;, &#8220;How do you feel about being {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I\\&#8217;m (.*)&#8217;, [&#8220;How does being {0} make you feel?&#8221;, &#8220;Do you enjoy being {0}?&#8221;, &#8220;Why do you tell me you&#8217;re {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;You are (.*)&#8217;, [&#8220;Why do you think I am {0}?&#8221;, &#8220;Does it please you to believe I am {0}?&#8221;, &#8220;Perhaps you would like to be {0}.&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;What (.*)&#8217;, [&#8220;Why do you ask?&#8221;, &#8220;What do you think?&#8221;, &#8220;What comes to mind when you ask that?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;How (.*)&#8217;, [&#8220;How do you suppose?&#8221;, &#8220;Perhaps you can answer your own question.&#8221;, &#8220;What is it you&#8217;re really asking?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Because (.*)&#8217;, [&#8220;Is that the real reason?&#8221;, &#8220;What other reasons come to mind?&#8221;, &#8220;Does that reason apply to anything else?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*) sorry (.*)&#8217;, [&#8220;There are many times when no apology is needed.&#8221;, &#8220;What feelings do you have when you apologize?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Hello(.*)&#8217;, [&#8220;Hello&#8230; I&#8217;m glad you could drop by today.&#8221;, &#8220;Hi there, how can I help you?&#8221;, &#8220;Hello, how are you feeling today?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I think (.*)&#8217;, [&#8220;Do you doubt {0}?&#8221;, &#8220;Do you really think so?&#8221;, &#8220;But you&#8217;re not sure {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*) friend (.*)&#8217;, [&#8220;Tell me more about your friends.&#8221;, &#8220;Why do you mention friends?&#8221;, &#8220;Do your friends worry you?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Yes&#8217;, [&#8220;You seem quite sure.&#8221;, &#8220;OK, but can you elaborate?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*) computer(.*)&#8217;, [&#8220;Are you really talking about me?&#8221;, &#8220;Does it seem strange to talk to a computer?&#8221;, &#8220;How do computers make you feel?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Is it (.*)&#8217;, [&#8220;Do you think it is {0}?&#8221;, &#8220;Perhaps it&#8217;s {0} \u2014 what do you think?&#8221;, &#8220;If it were {0}, what would that mean?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;It is (.*)&#8217;, [&#8220;You seem very certain.&#8221;, &#8220;If I told you it wasn&#8217;t {0}, how would you feel?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Can you (.*)&#8217;, [&#8220;What makes you think I can&#8217;t {0}?&#8221;, &#8220;If I could {0}, then what?&#8221;, &#8220;Why do you ask if I can {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Can I (.*)&#8217;, [&#8220;Perhaps you don&#8217;t want to {0}.&#8221;, &#8220;Do you want to be able to {0}?&#8221;, &#8220;If you could {0}, would you?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;You (.*)&#8217;, [&#8220;We should be discussing you, not me.&#8221;, &#8220;Why do you say that about me?&#8221;, &#8220;Why do you care if I {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I don\\&#8217;t (.*)&#8217;, [&#8220;Why don&#8217;t you {0}?&#8221;, &#8220;Do you want to {0}?&#8221;, &#8220;What if you did {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I feel (.*)&#8217;, [&#8220;Tell me more about those feelings.&#8221;, &#8220;Do you often feel {0}?&#8221;, &#8220;When do you usually feel {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I have (.*)&#8217;, [&#8220;Why do you tell me that you have {0}?&#8221;, &#8220;Have you ever had {0}?&#8221;, &#8220;I see.&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I would (.*)&#8217;, [&#8220;Why do you think you would {0}?&#8221;, &#8220;Could you explain why {0}?&#8221;, &#8220;If you could {0}, would you?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Is there (.*)&#8217;, [&#8220;Do you think there is {0}?&#8221;, &#8220;It&#8217;s likely that there is {0}.&#8221;, &#8220;Would you like there to be {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;My (.*)&#8217;, [&#8220;I see, your {0}.&#8221;, &#8220;Why do you say your {0}?&#8221;, &#8220;What about your {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;You\\&#8217;re (.*)&#8217;, [&#8220;Why do you say I am {0}?&#8221;, &#8220;Does it please you to think I am {0}?&#8221;, &#8220;Perhaps you would like to be {0}.&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*)&#8217;, [&#8220;Please tell me more.&#8221;, &#8220;Can you elaborate on that?&#8221;, &#8220;Why do you say that?&#8221;, &#8220;I see.&#8221;, &#8220;Interesting.&#8221;])<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> &nbsp; self.patterns = [<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I need (.*)&#8217;, [&#8220;Why do you need {0}?&#8221;, &#8220;Would it really help you to get {0}?&#8221;, &#8220;Are you sure you need {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Why don\\&#8217;t you (.*)&#8217;, [&#8220;Do you really think I don&#8217;t {0}?&#8221;, &#8220;Perhaps eventually I will {0}.&#8221;, &#8220;Do you want me to {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Why can\\&#8217;t I (.*)&#8217;, [&#8220;Do you think you should be able to {0}?&#8221;, &#8220;If you could {0}, what would you do?&#8221;, &#8220;I don&#8217;t know \u2014 why can&#8217;t you {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I am (.*)&#8217;, [&#8220;Did you come to me because you are {0}?&#8221;, &#8220;How long have you been {0}?&#8221;, &#8220;How do you feel about being {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I\\&#8217;m (.*)&#8217;, [&#8220;How does being {0} make you feel?&#8221;, &#8220;Do you enjoy being {0}?&#8221;, &#8220;Why do you tell me you&#8217;re {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;You are (.*)&#8217;, [&#8220;Why do you think I am {0}?&#8221;, &#8220;Does it please you to believe I am {0}?&#8221;, &#8220;Perhaps you would like to be {0}.&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;What (.*)&#8217;, [&#8220;Why do you ask?&#8221;, &#8220;What do you think?&#8221;, &#8220;What comes to mind when you ask that?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;How (.*)&#8217;, [&#8220;How do you suppose?&#8221;, &#8220;Perhaps you can answer your own question.&#8221;, &#8220;What is it you&#8217;re really asking?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Because (.*)&#8217;, [&#8220;Is that the real reason?&#8221;, &#8220;What other reasons come to mind?&#8221;, &#8220;Does that reason apply to anything else?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*) sorry (.*)&#8217;, [&#8220;There are many times when no apology is needed.&#8221;, &#8220;What feelings do you have when you apologize?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Hello(.*)&#8217;, [&#8220;Hello&#8230; I&#8217;m glad you could drop by today.&#8221;, &#8220;Hi there, how can I help you?&#8221;, &#8220;Hello, how are you feeling today?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I think (.*)&#8217;, [&#8220;Do you doubt {0}?&#8221;, &#8220;Do you really think so?&#8221;, &#8220;But you&#8217;re not sure {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*) friend (.*)&#8217;, [&#8220;Tell me more about your friends.&#8221;, &#8220;Why do you mention friends?&#8221;, &#8220;Do your friends worry you?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Yes&#8217;, [&#8220;You seem quite sure.&#8221;, &#8220;OK, but can you elaborate?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*) computer(.*)&#8217;, [&#8220;Are you really talking about me?&#8221;, &#8220;Does it seem strange to talk to a computer?&#8221;, &#8220;How do computers make you feel?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Is it (.*)&#8217;, [&#8220;Do you think it is {0}?&#8221;, &#8220;Perhaps it&#8217;s {0} \u2014 what do you think?&#8221;, &#8220;If it were {0}, what would that mean?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;It is (.*)&#8217;, [&#8220;You seem very certain.&#8221;, &#8220;If I told you it wasn&#8217;t {0}, how would you feel?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Can you (.*)&#8217;, [&#8220;What makes you think I can&#8217;t {0}?&#8221;, &#8220;If I could {0}, then what?&#8221;, &#8220;Why do you ask if I can {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Can I (.*)&#8217;, [&#8220;Perhaps you don&#8217;t want to {0}.&#8221;, &#8220;Do you want to be able to {0}?&#8221;, &#8220;If you could {0}, would you?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;You (.*)&#8217;, [&#8220;We should be discussing you, not me.&#8221;, &#8220;Why do you say that about me?&#8221;, &#8220;Why do you care if I {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I don\\&#8217;t (.*)&#8217;, [&#8220;Why don&#8217;t you {0}?&#8221;, &#8220;Do you want to {0}?&#8221;, &#8220;What if you did {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I feel (.*)&#8217;, [&#8220;Tell me more about those feelings.&#8221;, &#8220;Do you often feel {0}?&#8221;, &#8220;When do you usually feel {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I have (.*)&#8217;, [&#8220;Why do you tell me that you have {0}?&#8221;, &#8220;Have you ever had {0}?&#8221;, &#8220;I see.&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I would (.*)&#8217;, [&#8220;Why do you think you would {0}?&#8221;, &#8220;Could you explain why {0}?&#8221;, &#8220;If you could {0}, would you?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;Is there (.*)&#8217;, [&#8220;Do you think there is {0}?&#8221;, &#8220;It&#8217;s likely that there is {0}.&#8221;, &#8220;Would you like there to be {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;My (.*)&#8217;, [&#8220;I see, your {0}.&#8221;, &#8220;Why do you say your {0}?&#8221;, &#8220;What about your {0}?&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;You\\&#8217;re (.*)&#8217;, [&#8220;Why do you say I am {0}?&#8221;, &#8220;Does it please you to think I am {0}?&#8221;, &#8220;Perhaps you would like to be {0}.&#8221;]),<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r'(.*)&#8217;, [&#8220;Please tell me more.&#8221;, &#8220;Can you elaborate on that?&#8221;, &#8220;Why do you say that?&#8221;, &#8220;I see.&#8221;, &#8220;Interesting.&#8221;])<\/p>\n","protected":false},"excerpt":{"rendered":"<p>here is the bit of ELIZA code that gives us the response &nbsp; self.patterns = [ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (r&#8217;I need (.*)&#8217;, [&#8220;Why do you need {0}?&#8221;, &#8220;Would it really help you to get {0}?&#8221;, &#8220;Are you sure you need {0}?&#8221;]), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2373","post","type-post","status-publish","format-standard","hentry","category-uncategorized","column","fourcol"],"_links":{"self":[{"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2373"}],"version-history":[{"count":1,"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2373\/revisions"}],"predecessor-version":[{"id":2374,"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2373\/revisions\/2374"}],"wp:attachment":[{"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matthewolden.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}