ezEliza.pas 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. { $HDR$}
  2. {**********************************************************************}
  3. { Unit archived using Team Coherence }
  4. { Team Coherence is Copyright 2002 by Quality Software Components }
  5. { }
  6. { For further information / comments, visit our WEB site at }
  7. { http://www.TeamCoherence.com }
  8. {**********************************************************************}
  9. {
  10. $Log: 21826: EZEliza.pas
  11. Rev 1.0 2003.07.13 12:12:00 AM czhower
  12. Initial checkin
  13. Rev 1.0 2003.05.19 2:54:14 PM czhower
  14. }
  15. unit ezEliza;
  16. interface
  17. {$ifdef fpc}
  18. {$mode objfpc}{$H+}
  19. {$endif}
  20. uses
  21. EZPersonality;
  22. type
  23. TPersonalityEliza = class(TEZPersonality)
  24. protected
  25. procedure InitReplies; override;
  26. public
  27. class function Attributes: TEZPersonalityAttributes; override;
  28. end;
  29. implementation
  30. { TPersonalityEliza }
  31. class function TPersonalityEliza.Attributes: TEZPersonalityAttributes;
  32. begin
  33. with Result do begin
  34. Name := 'Eliza';
  35. Description := 'Original Eliza implementation.';
  36. end;
  37. end;
  38. procedure TPersonalityEliza.InitReplies;
  39. begin
  40. // These are parsed in order - first one wins
  41. // If no space before, it can be the end of a word
  42. // If no space on either side, can be the middle of word
  43. AddReply([' CAN YOU '], [
  44. 'Don''t you believe that I can *?'
  45. , 'Perhaps you would like to be like me.'
  46. , 'You want me to be able to *?'
  47. ]);
  48. AddReply([' CAN I '], [
  49. 'Perhaps you don''t want to *?'
  50. , 'Do you want to be able to *?'
  51. ]);
  52. AddReply([' YOU ARE ', ' YOU''RE '], [
  53. 'What makes you think I am *?'
  54. , 'Does it please you to believe I am *?'
  55. , 'Perhaps you would like to be", *?'
  56. , 'Do you sometimes wish you were *?'
  57. ]);
  58. AddReply(['I DON''T '], [
  59. 'don''t you really *?'
  60. , 'Why don''t you *?'
  61. , 'Do you wish to be able to *?'
  62. , 'Does that trouble you?'
  63. ]);
  64. AddReply(['I FEEL '], [
  65. 'Do you often feel *?'
  66. , 'Do you enjoy feeling *?'
  67. ]);
  68. AddReply(['WHY DON''T YOU '], [
  69. 'Do you really believe I don''t *?'
  70. , 'Perhaps in good time I will", *?'
  71. , 'Do you want me to *?'
  72. ]);
  73. AddReply(['WHY CAN''T I '], [
  74. 'Do you think you should be able to *?'
  75. , 'Why can''t you *?'
  76. ]);
  77. AddReply(['ARE YOU '], [
  78. 'Why are you interested in whether or not I am *?'
  79. , 'Would you prefer if I were not *?'
  80. , 'Perhaps in your fantasies I am", *?'
  81. ]);
  82. AddReply(['I CAN''T ', 'I CANNOT', 'I CAN NOT'], [
  83. 'How do you know you can''t *?'
  84. , 'Have you tried?'
  85. , 'Perhaps you can now *.'
  86. ]);
  87. AddReply(['I AM ', 'I''M'], [
  88. 'Did you come to me because you are *?'
  89. , 'How long have you been *?'
  90. , 'Do you believe it is normal to be *?'
  91. , 'Do you enjoy being *?'
  92. ]);
  93. AddReply(['YOU '], [
  94. 'We were discussing you--not me.'
  95. , 'Oh, I ?'
  96. , 'You''re not really talking about me, are you?'
  97. ]);
  98. AddReply(['I WANT '], [
  99. 'What would it mean to you if you got *?'
  100. , 'Why do you want *?'
  101. , 'Suppose you soon got *?'
  102. , 'What if you never got *?'
  103. , 'I sometimes also want *?'
  104. ]);
  105. AddReply(['WHAT ', 'HOW ', 'WHO ', 'WHERE ', 'WHEN ', 'WHY '], [
  106. 'Why do you ask?'
  107. , 'Does that question interest you?'
  108. , 'What answer would please you the most?'
  109. , 'What do you think?'
  110. , 'Are such questions on your mind often?'
  111. , 'What is it that you really want to know?'
  112. , 'Have you asked anyone else?'
  113. , 'Have you asked such questions before?'
  114. , 'What else comes to mind when you ask that?'
  115. ]);
  116. AddReply(['NAME '], [
  117. 'Names don''t interest me.'
  118. , 'I don''t care about names --please go on.'
  119. ]);
  120. AddReply(['CAUSE '], [
  121. 'Is that the real reason?'
  122. , 'don''t any other reasons come to mind?'
  123. , 'Does that reason explain anything else?'
  124. , 'What other reasons might there be?'
  125. ]);
  126. AddReply(['SORRY '], [
  127. 'Please don''t apologize!'
  128. , 'Apologies are not necessary.'
  129. , 'What feelings do you have when you apologize?'
  130. , 'don''t be so defensive!'
  131. ]);
  132. AddReply(['DREAM '], [
  133. 'What does that dream suggest to you?'
  134. , 'Do you dream often?'
  135. , 'What persons appear in your dreams?'
  136. , 'Are you disturbed by your dreams?'
  137. ]);
  138. AddReply(['HELLO ', 'HI '], [
  139. 'How do you do ...please state your problem.'
  140. ]);
  141. AddReply(['MAYBE '], [
  142. 'You don''t seem quite certain.'
  143. , 'Why the uncertain tone?'
  144. , 'can''t you be more positive?'
  145. , 'You aren''t sure?'
  146. , 'don''t you know?'
  147. ]);
  148. AddReply(['NO '], [
  149. 'Are you saying no just to be negative?'
  150. , 'You are being a bit negative.'
  151. , 'Why not?'
  152. , 'Are you sure?'
  153. , 'Why no?'
  154. ]);
  155. AddReply(['YOUR '], [
  156. 'Why are you concerned about my *?'
  157. , 'What about your own *?'
  158. ]);
  159. AddReply(['ALWAYS '], [
  160. 'Can you think of a specific example?'
  161. , 'When?'
  162. , 'What are you thinking of?'
  163. , 'Really, always?'
  164. ]);
  165. AddReply(['THINK '], [
  166. 'Do you really think so?'
  167. , 'But you are not sure you, *?'
  168. , 'Do you doubt you *?'
  169. ]);
  170. AddReply(['ALIKE '], [
  171. 'In what way?'
  172. , 'What resemblance do you see?'
  173. , 'What does the similarity suggest to you?'
  174. , 'What other connections do you see?'
  175. , 'Could there really be some connection?'
  176. , 'How?'
  177. , 'You seem quite positive.'
  178. ]);
  179. AddReply(['YES '], [
  180. 'Are you sure?'
  181. , 'I see.'
  182. , 'I understand.'
  183. ]);
  184. AddReply(['FRIEND '], [
  185. 'Why do you bring up the topic of friends?'
  186. , 'Do your friends worry you?'
  187. , 'Do your friends pick on you?'
  188. , 'Are you sure you have any friends?'
  189. , 'Do you impose on your friends?'
  190. , 'Perhaps your love for friends worries you.'
  191. ]);
  192. AddReply(['COMPUTER'], [
  193. 'Do computers worry you?'
  194. , 'Are you talking about me in particular?'
  195. , 'Are you frightened by machines?'
  196. , 'Why do you mention computers?'
  197. , 'What do you think machines have to do with your problem?'
  198. , 'don''t you think computers can help people?'
  199. , 'What is it about machines that worries you?'
  200. ]);
  201. AddReply(['--NOKEYFOUND--'], [
  202. 'Say, do you have any psychological problems?'
  203. , 'What does that suggest to you?'
  204. , 'I see.'
  205. , 'I''m not sure I understand you fully.'
  206. , 'Come come elucidate your thoughts.'
  207. , 'Can you elaborate on that?'
  208. , 'That is quite interesting.'
  209. ]);
  210. end;
  211. initialization
  212. TPersonalityEliza.RegisterPersonality;
  213. end.