Mercurial > emacs
annotate lisp/play/doctor.el @ 86064:31d99cc7cfc9
*** empty log message ***
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Wed, 14 Nov 2007 11:18:54 +0000 |
parents | 527f752989fc |
children | 54006a859bcc f55f9811f5d7 |
rev | line source |
---|---|
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
32659
diff
changeset
|
1 ;;; doctor.el --- psychological help for frustrated users |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
621
diff
changeset
|
2 |
74509 | 3 ;; Copyright (C) 1985, 1987, 1994, 1996, 2000, 2001, 2002, 2003, 2004, |
75347 | 4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
845 | 5 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
6 ;; Maintainer: FSF |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
7 ;; Keywords: games |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
8 |
400 | 9 ;; This file is part of GNU Emacs. |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
78227
527f752989fc
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
76953
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
400 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
400 | 25 |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
26 ;;; Commentary: |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
27 |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
28 ;; The single entry point `doctor', simulates a Rogerian analyst using |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
29 ;; phrase-production techniques similar to the classic ELIZA demonstration |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
30 ;; of pseudo-AI. |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
31 |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
32 ;; This file was for a while censored by the Communications Decency Act. |
14540
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
33 ;; Some of its features were removed. The law was promoted as a ban |
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
34 ;; on pornography, but it bans far more than that. The doctor program |
14542 | 35 ;; did not contain pornography, but part of it was prohibited |
14540
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
36 ;; nonetheless. |
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
37 |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
38 ;; The Supreme Court overturned the Communications Decency Act, but |
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
39 ;; Congress is sure to look for some other way to try to end free speech. |
14540
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
40 ;; For information on US government censorship of the Internet, and |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
41 ;; what you can do to protect freedom of the press, see the web |
14540
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
42 ;; site http://www.vtw.org/ |
16854 | 43 ;; See also the file etc/CENSORSHIP in the Emacs distribution |
44 ;; for a discussion of why and how this file was censored, and the | |
45 ;; political implications of the issue. | |
14540
bcab69b22ec0
(doctor-mode): State that file has been censored.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
46 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
47 ;;; Code: |
400 | 48 |
68248
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
49 (defvar **mad**) (defvar *debug*) (defvar *print-space*) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
50 (defvar *print-upcase*) (defvar abuselst) (defvar abusewords) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
51 (defvar account) (defvar afraidof) (defvar arerelated) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
52 (defvar areyou) (defvar bak) (defvar beclst) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
53 (defvar bother) (defvar bye) (defvar canyou) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
54 (defvar chatlst) (defvar continue) (defvar deathlst) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
55 (defvar describe) (defvar drnk) (defvar drugs) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
56 (defvar eliza-flag) (defvar elizalst) (defvar famlst) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
57 (defvar feared) (defvar fears) (defvar feelings-about) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
58 (defvar foullst) (defvar found) (defvar hello) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
59 (defvar history) (defvar howareyoulst) (defvar howdyflag) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
60 (defvar huhlst) (defvar ibelieve) (defvar improve) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
61 (defvar inter) (defvar isee) (defvar isrelated) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
62 (defvar lincount) (defvar longhuhlst) (defvar lover) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
63 (defvar machlst) (defvar mathlst) (defvar maybe) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
64 (defvar moods) (defvar neglst) (defvar obj) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
65 (defvar object) (defvar owner) (defvar please) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
66 (defvar problems) (defvar qlist) (defvar random-adjective) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
67 (defvar relation) (defvar remlst) (defvar repetitive-shortness) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
68 (defvar replist) (defvar rms-flag) (defvar schoollst) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
69 (defvar sent) (defvar sexlst) (defvar shortbeclst) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
70 (defvar shortlst) (defvar something) (defvar sportslst) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
71 (defvar stallmanlst) (defvar states) (defvar subj) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
72 (defvar suicide-flag) (defvar sure) (defvar things) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
73 (defvar thlst) (defvar toklst) (defvar typos) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
74 (defvar verb) (defvar want) (defvar whatwhen) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
75 (defvar whereoutp) (defvar whysay) (defvar whywant) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
76 (defvar zippy-flag) (defvar zippylst) |
64715
46d503c20412
(doctor-type-symbol): "?\ " -> "?\s".
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
77 |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
78 (defun doc// (x) x) |
400 | 79 |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
80 (defmacro doc$ (what) |
400 | 81 "quoted arg form of doctor-$" |
82 (list 'doctor-$ (list 'quote what))) | |
83 | |
84 (defun doctor-$ (what) | |
85 "Return the car of a list, rotating the list each time" | |
86 (let* ((vv (symbol-value what)) | |
87 (first (car vv)) | |
88 (ww (append (cdr vv) (list first)))) | |
89 (set what ww) | |
90 first)) | |
91 | |
68346
79697c70111b
(doctor-mode-map): Rename from `doc-mode-map'.
Juri Linkov <juri@jurta.org>
parents:
68248
diff
changeset
|
92 (defvar doctor-mode-map |
68248
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
93 (let ((map (make-sparse-keymap))) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
94 (define-key map "\n" 'doctor-read-print) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
95 (define-key map "\r" 'doctor-ret-or-read) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
96 map)) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
97 |
63240
c1ed13b98cf0
(doctor-mode-map): Remove defvar.
Lute Kamstra <lute@gnu.org>
parents:
62249
diff
changeset
|
98 (define-derived-mode doctor-mode text-mode "Doctor" |
400 | 99 "Major mode for running the Doctor (Eliza) program. |
100 Like Text mode with Auto Fill mode | |
101 except that RET when point is after a newline, or LFD at any time, | |
102 reads the sentence before point, and prints the Doctor's answer." | |
103 (make-doctor-variables) | |
104 (turn-on-auto-fill) | |
105 (doctor-type '(i am the psychotherapist \. | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
106 (doc$ please) (doc$ describe) your (doc$ problems) \. |
400 | 107 each time you are finished talking, type \R\E\T twice \.)) |
108 (insert "\n")) | |
109 | |
110 (defun make-doctor-variables () | |
111 (make-local-variable 'typos) | |
112 (setq typos | |
113 (mapcar (function (lambda (x) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
114 (put (car x) 'doctor-correction (cadr x)) |
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
115 (put (cadr x) 'doctor-expansion (car (cddr x))) |
400 | 116 (car x))) |
117 '((theyll they\'ll (they will)) | |
118 (theyre they\'re (they are)) | |
119 (hes he\'s (he is)) | |
120 (he7s he\'s (he is)) | |
121 (im i\'m (you are)) | |
122 (i7m i\'m (you are)) | |
123 (isa is\ a (is a)) | |
124 (thier their (their)) | |
125 (dont don\'t (do not)) | |
126 (don7t don\'t (do not)) | |
127 (you7re you\'re (i am)) | |
128 (you7ve you\'ve (i have)) | |
129 (you7ll you\'ll (i will))))) | |
130 (make-local-variable 'found) | |
131 (setq found nil) | |
132 (make-local-variable 'owner) | |
133 (setq owner nil) | |
134 (make-local-variable 'history) | |
135 (setq history nil) | |
136 (make-local-variable '*debug*) | |
137 (setq *debug* nil) | |
138 (make-local-variable 'inter) | |
139 (setq inter | |
140 '((well\,) | |
141 (hmmm \.\.\.\ so\,) | |
142 (so) | |
143 (\.\.\.and) | |
144 (then))) | |
145 (make-local-variable 'continue) | |
146 (setq continue | |
147 '((continue) | |
148 (proceed) | |
149 (go on) | |
150 (keep going) )) | |
151 (make-local-variable 'relation) | |
152 (setq relation | |
153 '((your relationship with) | |
154 (something you remember about) | |
155 (your feelings toward) | |
156 (some experiences you have had with) | |
157 (how you feel about))) | |
158 (make-local-variable 'fears) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
159 (setq fears '( ((doc$ whysay) you are (doc$ afraidof) (doc// feared) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
160 (you seem terrified by (doc// feared) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
161 (when did you first feel (doc$ afraidof) (doc// feared) \?) )) |
400 | 162 (make-local-variable 'sure) |
163 (setq sure '((sure)(positive)(certain)(absolutely sure))) | |
164 (make-local-variable 'afraidof) | |
165 (setq afraidof '( (afraid of) (frightened by) (scared of) )) | |
166 (make-local-variable 'areyou) | |
167 (setq areyou '( (are you)(have you been)(have you been) )) | |
168 (make-local-variable 'isrelated) | |
169 (setq isrelated '( (has something to do with)(is related to) | |
170 (could be the reason for) (is caused by)(is because of))) | |
171 (make-local-variable 'arerelated) | |
172 (setq arerelated '((have something to do with)(are related to) | |
173 (could have caused)(could be the reason for) (are caused by) | |
174 (are because of))) | |
175 (make-local-variable 'moods) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
176 (setq moods '( ((doc$ areyou)(doc// found) often \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
177 (what causes you to be (doc// found) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
178 ((doc$ whysay) you are (doc// found) \?) )) |
400 | 179 (make-local-variable 'maybe) |
180 (setq maybe | |
181 '((maybe) | |
182 (perhaps) | |
183 (possibly))) | |
184 (make-local-variable 'whatwhen) | |
185 (setq whatwhen | |
186 '((what happened when) | |
187 (what would happen if))) | |
188 (make-local-variable 'hello) | |
189 (setq hello | |
190 '((how do you do \?) (hello \.) (howdy!) (hello \.) (hi \.) (hi there \.))) | |
191 (make-local-variable 'drnk) | |
192 (setq drnk | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
193 '((do you drink a lot of (doc// found) \?) |
400 | 194 (do you get drunk often \?) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
195 ((doc$ describe) your drinking habits \.) )) |
400 | 196 (make-local-variable 'drugs) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
197 (setq drugs '( (do you use (doc// found) often \?)((doc$ areyou) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
198 addicted to (doc// found) \?)(do you realize that drugs can |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
199 be very harmful \?)((doc$ maybe) you should try to quit using (doc// found) |
400 | 200 \.))) |
201 (make-local-variable 'whywant) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
202 (setq whywant '( ((doc$ whysay) (doc// subj) might (doc$ want) (doc// obj) \?) |
400 | 203 (how does it feel to want \?) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
204 (why should (doc// subj) get (doc// obj) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
205 (when did (doc// subj) first (doc$ want) (doc// obj) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
206 ((doc$ areyou) obsessed with (doc// obj) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
207 (why should i give (doc// obj) to (doc// subj) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
208 (have you ever gotten (doc// obj) \?) )) |
400 | 209 (make-local-variable 'canyou) |
210 (setq canyou '((of course i can \.) | |
211 (why should i \?) | |
212 (what makes you think i would even want to \?) | |
213 (i am the doctor\, i can do anything i damn please \.) | |
214 (not really\, it\'s not up to me \.) | |
215 (depends\, how important is it \?) | |
216 (i could\, but i don\'t think it would be a wise thing to do \.) | |
217 (can you \?) | |
218 (maybe i can\, maybe i can\'t \.\.\.) | |
219 (i don\'t think i should do that \.))) | |
220 (make-local-variable 'want) | |
221 (setq want '( (want) (desire) (wish) (want) (hope) )) | |
222 (make-local-variable 'shortlst) | |
223 (setq shortlst | |
224 '((can you elaborate on that \?) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
225 ((doc$ please) continue \.) |
400 | 226 (go on\, don\'t be afraid \.) |
227 (i need a little more detail please \.) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
228 (you\'re being a bit brief\, (doc$ please) go into detail \.) |
40218
31cee69dfd2c
(make-doctor-variables): Remove a '($ please)'.
Gerd Moellmann <gerd@gnu.org>
parents:
38412
diff
changeset
|
229 (can you be more explicit \?) |
400 | 230 (and \?) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
231 ((doc$ please) go into more detail \?) |
400 | 232 (you aren\'t being very talkative today\!) |
233 (is that all there is to it \?) | |
234 (why must you respond so briefly \?))) | |
235 | |
236 (make-local-variable 'famlst) | |
237 (setq famlst | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
238 '((tell me (doc$ something) about (doc// owner) family \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
239 (you seem to dwell on (doc// owner) family \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
240 ((doc$ areyou) hung up on (doc// owner) family \?))) |
400 | 241 (make-local-variable 'huhlst) |
242 (setq huhlst | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
243 '(((doc$ whysay)(doc// sent) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
244 (is it because of (doc$ things) that you say (doc// sent) \?) )) |
400 | 245 (make-local-variable 'longhuhlst) |
246 (setq longhuhlst | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
247 '(((doc$ whysay) that \?) |
400 | 248 (i don\'t understand \.) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
249 ((doc$ thlst)) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
250 ((doc$ areyou) (doc$ afraidof) that \?))) |
5282
1d3c5ef6e8a1
(make-doctor-variables): Fix some local var names.
Richard M. Stallman <rms@gnu.org>
parents:
4249
diff
changeset
|
251 (make-local-variable 'feelings-about) |
400 | 252 (setq feelings-about |
253 '((feelings about) | |
13956
71284f0d43ac
(make-doctor-variables, doctor-othermodifierp,
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
254 (apprehensions toward) |
400 | 255 (thoughts on) |
256 (emotions toward))) | |
5282
1d3c5ef6e8a1
(make-doctor-variables): Fix some local var names.
Richard M. Stallman <rms@gnu.org>
parents:
4249
diff
changeset
|
257 (make-local-variable 'random-adjective) |
400 | 258 (setq random-adjective |
259 '((vivid) | |
260 (emotionally stimulating) | |
261 (exciting) | |
262 (boring) | |
263 (interesting) | |
264 (recent) | |
265 (random) ;How can we omit this? | |
266 (unusual) | |
267 (shocking) | |
268 (embarrassing))) | |
269 (make-local-variable 'whysay) | |
270 (setq whysay | |
271 '((why do you say) | |
272 (what makes you believe) | |
273 (are you sure that) | |
274 (do you really think) | |
275 (what makes you think) )) | |
276 (make-local-variable 'isee) | |
277 (setq isee | |
278 '((i see \.\.\.) | |
279 (yes\,) | |
280 (i understand \.) | |
281 (oh \.) )) | |
282 (make-local-variable 'please) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
283 (setq please |
400 | 284 '((please\,) |
285 (i would appreciate it if you would) | |
286 (perhaps you could) | |
287 (please\,) | |
288 (would you please) | |
289 (why don\'t you) | |
290 (could you))) | |
291 (make-local-variable 'bye) | |
292 (setq bye | |
293 '((my secretary will send you a bill \.) | |
294 (bye bye \.) | |
295 (see ya \.) | |
296 (ok\, talk to you some other time \.) | |
297 (talk to you later \.) | |
298 (ok\, have fun \.) | |
299 (ciao \.))) | |
300 (make-local-variable 'something) | |
301 (setq something | |
302 '((something) | |
303 (more) | |
304 (how you feel))) | |
305 (make-local-variable 'things) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
306 (setq things |
400 | 307 '(;(your interests in computers) ;; let's make this less computer oriented |
308 ;(the machines you use) | |
309 (your plans) | |
310 ;(your use of computers) | |
311 (your life) | |
312 ;(other machines you use) | |
313 (the people you hang around with) | |
314 ;(computers you like) | |
315 (problems at school) | |
316 (any hobbies you have) | |
317 ;(other computers you use) | |
318 (your sex life) | |
319 (hangups you have) | |
320 (your inhibitions) | |
321 (some problems in your childhood) | |
322 ;(knowledge of computers) | |
323 (some problems at home))) | |
324 (make-local-variable 'describe) | |
325 (setq describe | |
326 '((describe) | |
327 (tell me about) | |
328 (talk about) | |
329 (discuss) | |
330 (tell me more about) | |
331 (elaborate on))) | |
332 (make-local-variable 'ibelieve) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
333 (setq ibelieve |
400 | 334 '((i believe) (i think) (i have a feeling) (it seems to me that) |
335 (it looks like))) | |
336 (make-local-variable 'problems) | |
337 (setq problems '( (problems) | |
338 (inhibitions) | |
339 (hangups) | |
340 (difficulties) | |
341 (anxieties) | |
342 (frustrations) )) | |
343 (make-local-variable 'bother) | |
344 (setq bother | |
345 '((does it bother you that) | |
346 (are you annoyed that) | |
347 (did you ever regret) | |
348 (are you sorry) | |
349 (are you satisfied with the fact that))) | |
350 (make-local-variable 'machlst) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
351 (setq machlst |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
352 '((you have your mind on (doc// found) \, it seems \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
353 (you think too much about (doc// found) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
354 (you should try taking your mind off of (doc// found)\.) |
400 | 355 (are you a computer hacker \?))) |
356 (make-local-variable 'qlist) | |
357 (setq qlist | |
358 '((what do you think \?) | |
359 (i\'ll ask the questions\, if you don\'t mind!) | |
360 (i could ask the same thing myself \.) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
361 ((doc$ please) allow me to do the questioning \.) |
400 | 362 (i have asked myself that question many times \.) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
363 ((doc$ please) try to answer that question yourself \.))) |
400 | 364 (make-local-variable 'foullst) |
365 (setq foullst | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
366 '(((doc$ please) watch your tongue!) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
367 ((doc$ please) avoid such unwholesome thoughts \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
368 ((doc$ please) get your mind out of the gutter \.) |
400 | 369 (such lewdness is not appreciated \.))) |
370 (make-local-variable 'deathlst) | |
371 (setq deathlst | |
372 '((this is not a healthy way of thinking \.) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
373 ((doc$ bother) you\, too\, may die someday \?) |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
2307
diff
changeset
|
374 (i am worried by your obsession with this topic!) |
400 | 375 (did you watch a lot of crime and violence on television as a child \?)) |
376 ) | |
377 (make-local-variable 'sexlst) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
378 (setq sexlst |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
379 '(((doc$ areyou) (doc$ afraidof) sex \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
380 ((doc$ describe)(doc$ something) about your sexual history \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
381 ((doc$ please)(doc$ describe) your sex life \.\.\.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
382 ((doc$ describe) your (doc$ feelings-about) your sexual partner \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
383 ((doc$ describe) your most (doc$ random-adjective) sexual experience \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
384 ((doc$ areyou) satisfied with (doc// lover) \.\.\. \?))) |
400 | 385 (make-local-variable 'neglst) |
386 (setq neglst | |
387 '((why not \?) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
388 ((doc$ bother) i ask that \?) |
400 | 389 (why not \?) |
390 (why not \?) | |
391 (how come \?) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
392 ((doc$ bother) i ask that \?))) |
400 | 393 (make-local-variable 'beclst) |
394 (setq beclst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
395 (is it because (doc// sent) that you came to me \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
396 ((doc$ bother)(doc// sent) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
397 (when did you first know that (doc// sent) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
398 (is the fact that (doc// sent) the real reason \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
399 (does the fact that (doc// sent) explain anything else \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
400 ((doc$ areyou)(doc$ sure)(doc// sent) \? ) )) |
400 | 401 (make-local-variable 'shortbeclst) |
402 (setq shortbeclst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
403 ((doc$ bother) i ask you that \?) |
400 | 404 (that\'s not much of an answer!) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
405 ((doc$ inter) why won\'t you talk about it \?) |
400 | 406 (speak up!) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
407 ((doc$ areyou) (doc$ afraidof) talking about it \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
408 (don\'t be (doc$ afraidof) elaborating \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
409 ((doc$ please) go into more detail \.))) |
400 | 410 (make-local-variable 'thlst) |
411 (setq thlst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
412 ((doc$ maybe)(doc$ things)(doc$ arerelated) this \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
413 (is it because of (doc$ things) that you are going through all this \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
414 (how do you reconcile (doc$ things) \? ) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
415 ((doc$ maybe) this (doc$ isrelated)(doc$ things) \?) )) |
400 | 416 (make-local-variable 'remlst) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
417 (setq remlst '( (earlier you said (doc$ history) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
418 (you mentioned that (doc$ history) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
419 ((doc$ whysay)(doc$ history) \? ) )) |
400 | 420 (make-local-variable 'toklst) |
421 (setq toklst | |
422 '((is this how you relax \?) | |
423 (how long have you been smoking grass \?) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
424 ((doc$ areyou) (doc$ afraidof) of being drawn to using harder stuff \?))) |
400 | 425 (make-local-variable 'states) |
426 (setq states | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
427 '((do you get (doc// found) often \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
428 (do you enjoy being (doc// found) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
429 (what makes you (doc// found) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
430 (how often (doc$ areyou)(doc// found) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
431 (when were you last (doc// found) \?))) |
400 | 432 (make-local-variable 'replist) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
433 (setq replist |
400 | 434 '((i . (you)) |
435 (my . (your)) | |
436 (me . (you)) | |
437 (you . (me)) | |
438 (your . (my)) | |
439 (mine . (yours)) | |
440 (yours . (mine)) | |
441 (our . (your)) | |
442 (ours . (yours)) | |
443 (we . (you)) | |
444 (dunno . (do not know)) | |
445 ;; (yes . ()) | |
446 (no\, . ()) | |
447 (yes\, . ()) | |
448 (ya . (i)) | |
449 (aint . (am not)) | |
450 (wanna . (want to)) | |
451 (gimme . (give me)) | |
452 (gotta . (have to)) | |
453 (gonna . (going to)) | |
454 (never . (not ever)) | |
455 (doesn\'t . (does not)) | |
456 (don\'t . (do not)) | |
457 (aren\'t . (are not)) | |
458 (isn\'t . (is not)) | |
459 (won\'t . (will not)) | |
460 (can\'t . (cannot)) | |
461 (haven\'t . (have not)) | |
462 (i\'m . (you are)) | |
463 (ourselves . (yourselves)) | |
464 (myself . (yourself)) | |
465 (yourself . (myself)) | |
466 (you\'re . (i am)) | |
467 (you\'ve . (i have)) | |
468 (i\'ve . (you have)) | |
469 (i\'ll . (you will)) | |
470 (you\'ll . (i shall)) | |
471 (i\'d . (you would)) | |
472 (you\'d . (i would)) | |
473 (here . (there)) | |
474 (please . ()) | |
475 (eh\, . ()) | |
476 (eh . ()) | |
477 (oh\, . ()) | |
478 (oh . ()) | |
479 (shouldn\'t . (should not)) | |
480 (wouldn\'t . (would not)) | |
481 (won\'t . (will not)) | |
482 (hasn\'t . (has not)))) | |
483 (make-local-variable 'stallmanlst) | |
484 (setq stallmanlst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
485 ((doc$ describe) your (doc$ feelings-about) him \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
486 ((doc$ areyou) a friend of Stallman \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
487 ((doc$ bother) Stallman is (doc$ random-adjective) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
488 ((doc$ ibelieve) you are (doc$ afraidof) him \.))) |
400 | 489 (make-local-variable 'schoollst) |
490 (setq schoollst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
491 ((doc$ describe) your (doc// found) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
492 ((doc$ bother) your grades could (doc$ improve) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
493 ((doc$ areyou) (doc$ afraidof) (doc// found) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
494 ((doc$ maybe) this (doc$ isrelated) to your attitude \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
495 ((doc$ areyou) absent often \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
496 ((doc$ maybe) you should study (doc$ something) \.))) |
400 | 497 (make-local-variable 'improve) |
498 (setq improve '((improve) (be better) (be improved) (be higher))) | |
499 (make-local-variable 'elizalst) | |
500 (setq elizalst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
501 ((doc$ areyou) (doc$ sure) \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
502 ((doc$ ibelieve) you have (doc$ problems) with (doc// found) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
503 ((doc$ whysay) (doc// sent) \?))) |
400 | 504 (make-local-variable 'sportslst) |
505 (setq sportslst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
506 (tell me (doc$ something) about (doc// found) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
507 ((doc$ describe) (doc$ relation) (doc// found) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
508 (do you find (doc// found) (doc$ random-adjective) \?))) |
400 | 509 (make-local-variable 'mathlst) |
510 (setq mathlst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
511 ((doc$ describe) (doc$ something) about math \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
512 ((doc$ maybe) your (doc$ problems) (doc$ arerelated) (doc// found) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
513 (i don\'t know much (doc// found) \, but (doc$ continue) |
400 | 514 anyway \.))) |
515 (make-local-variable 'zippylst) | |
516 (setq zippylst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
517 ((doc$ areyou) Zippy \?) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
518 ((doc$ ibelieve) you have some serious (doc$ problems) \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
519 ((doc$ bother) you are a pinhead \?))) |
400 | 520 (make-local-variable 'chatlst) |
521 (setq chatlst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
522 ((doc$ maybe) we could chat \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
523 ((doc$ please) (doc$ describe) (doc$ something) about chat mode \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
524 ((doc$ bother) our discussion is so (doc$ random-adjective) \?))) |
400 | 525 (make-local-variable 'abuselst) |
526 (setq abuselst '( | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
527 ((doc$ please) try to be less abusive \.) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
528 ((doc$ describe) why you call me (doc// found) \.) |
400 | 529 (i\'ve had enough of you!))) |
530 (make-local-variable 'abusewords) | |
531 (setq abusewords '(boring bozo clown clumsy cretin dumb dummy | |
532 fool foolish gnerd gnurd idiot jerk | |
533 lose loser louse lousy luse luser | |
534 moron nerd nurd oaf oafish reek | |
535 stink stupid tool toolish twit)) | |
536 (make-local-variable 'howareyoulst) | |
537 (setq howareyoulst '((how are you) (hows it going) (hows it going eh) | |
538 (how\'s it going) (how\'s it going eh) (how goes it) | |
539 (whats up) (whats new) (what\'s up) (what\'s new) | |
540 (howre you) (how\'re you) (how\'s everything) | |
541 (how is everything) (how do you do) | |
542 (how\'s it hanging) (que pasa) | |
543 (how are you doing) (what do you say))) | |
544 (make-local-variable 'whereoutp) | |
545 (setq whereoutp '( huh remem rthing ) ) | |
546 (make-local-variable 'subj) | |
547 (setq subj nil) | |
548 (make-local-variable 'verb) | |
549 (setq verb nil) | |
550 (make-local-variable 'obj) | |
551 (setq obj nil) | |
552 (make-local-variable 'feared) | |
553 (setq feared nil) | |
554 (make-local-variable 'repetitive-shortness) | |
555 (setq repetitive-shortness '(0 . 0)) | |
556 (make-local-variable '**mad**) | |
557 (setq **mad** nil) | |
558 (make-local-variable 'rms-flag) | |
559 (setq rms-flag nil) | |
560 (make-local-variable 'eliza-flag) | |
561 (setq eliza-flag nil) | |
562 (make-local-variable 'zippy-flag) | |
563 (setq zippy-flag nil) | |
18389
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
564 (make-local-variable 'suicide-flag) |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
565 (setq suicide-flag nil) |
400 | 566 (make-local-variable 'lover) |
567 (setq lover '(your partner)) | |
568 (make-local-variable 'bak) | |
569 (setq bak nil) | |
570 (make-local-variable 'lincount) | |
571 (setq lincount 0) | |
572 (make-local-variable '*print-upcase*) | |
573 (setq *print-upcase* nil) | |
574 (make-local-variable '*print-space*) | |
575 (setq *print-space* nil) | |
576 (make-local-variable 'howdyflag) | |
577 (setq howdyflag nil) | |
578 (make-local-variable 'object) | |
579 (setq object nil)) | |
580 | |
581 ;; Define equivalence classes of words that get treated alike. | |
582 | |
583 (defun doctor-meaning (x) (get x 'doctor-meaning)) | |
584 | |
585 (defmacro doctor-put-meaning (symb val) | |
586 "Store the base meaning of a word on the property list." | |
587 (list 'put (list 'quote symb) ''doctor-meaning val)) | |
588 | |
589 (doctor-put-meaning howdy 'howdy) | |
590 (doctor-put-meaning hi 'howdy) | |
591 (doctor-put-meaning greetings 'howdy) | |
592 (doctor-put-meaning hello 'howdy) | |
593 (doctor-put-meaning tops20 'mach) | |
594 (doctor-put-meaning tops-20 'mach) | |
595 (doctor-put-meaning tops 'mach) | |
596 (doctor-put-meaning pdp11 'mach) | |
597 (doctor-put-meaning computer 'mach) | |
598 (doctor-put-meaning unix 'mach) | |
599 (doctor-put-meaning machine 'mach) | |
600 (doctor-put-meaning computers 'mach) | |
601 (doctor-put-meaning machines 'mach) | |
602 (doctor-put-meaning pdp11s 'mach) | |
603 (doctor-put-meaning foo 'mach) | |
604 (doctor-put-meaning foobar 'mach) | |
605 (doctor-put-meaning multics 'mach) | |
606 (doctor-put-meaning macsyma 'mach) | |
607 (doctor-put-meaning teletype 'mach) | |
608 (doctor-put-meaning la36 'mach) | |
609 (doctor-put-meaning vt52 'mach) | |
610 (doctor-put-meaning zork 'mach) | |
611 (doctor-put-meaning trek 'mach) | |
612 (doctor-put-meaning startrek 'mach) | |
613 (doctor-put-meaning advent 'mach) | |
614 (doctor-put-meaning pdp 'mach) | |
615 (doctor-put-meaning dec 'mach) | |
616 (doctor-put-meaning commodore 'mach) | |
617 (doctor-put-meaning vic 'mach) | |
618 (doctor-put-meaning bbs 'mach) | |
619 (doctor-put-meaning modem 'mach) | |
620 (doctor-put-meaning baud 'mach) | |
621 (doctor-put-meaning macintosh 'mach) | |
622 (doctor-put-meaning vax 'mach) | |
623 (doctor-put-meaning vms 'mach) | |
624 (doctor-put-meaning ibm 'mach) | |
625 (doctor-put-meaning pc 'mach) | |
626 (doctor-put-meaning bitching 'foul) | |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
627 (doctor-put-meaning shit 'foul) |
400 | 628 (doctor-put-meaning bastard 'foul) |
629 (doctor-put-meaning damn 'foul) | |
630 (doctor-put-meaning damned 'foul) | |
631 (doctor-put-meaning hell 'foul) | |
632 (doctor-put-meaning suck 'foul) | |
633 (doctor-put-meaning sucking 'foul) | |
634 (doctor-put-meaning sux 'foul) | |
635 (doctor-put-meaning ass 'foul) | |
636 (doctor-put-meaning whore 'foul) | |
637 (doctor-put-meaning bitch 'foul) | |
638 (doctor-put-meaning asshole 'foul) | |
639 (doctor-put-meaning shrink 'foul) | |
640 (doctor-put-meaning pot 'toke) | |
641 (doctor-put-meaning grass 'toke) | |
642 (doctor-put-meaning weed 'toke) | |
643 (doctor-put-meaning marijuana 'toke) | |
644 (doctor-put-meaning acapulco 'toke) | |
645 (doctor-put-meaning columbian 'toke) | |
646 (doctor-put-meaning tokin 'toke) | |
647 (doctor-put-meaning joint 'toke) | |
648 (doctor-put-meaning toke 'toke) | |
649 (doctor-put-meaning toking 'toke) | |
650 (doctor-put-meaning tokin\' 'toke) | |
651 (doctor-put-meaning toked 'toke) | |
652 (doctor-put-meaning roach 'toke) | |
653 (doctor-put-meaning pills 'drug) | |
654 (doctor-put-meaning dope 'drug) | |
655 (doctor-put-meaning acid 'drug) | |
656 (doctor-put-meaning lsd 'drug) | |
657 (doctor-put-meaning speed 'drug) | |
658 (doctor-put-meaning heroin 'drug) | |
659 (doctor-put-meaning hash 'drug) | |
660 (doctor-put-meaning cocaine 'drug) | |
661 (doctor-put-meaning uppers 'drug) | |
662 (doctor-put-meaning downers 'drug) | |
663 (doctor-put-meaning loves 'loves) | |
664 (doctor-put-meaning love 'love) | |
665 (doctor-put-meaning loved 'love) | |
666 (doctor-put-meaning hates 'hates) | |
667 (doctor-put-meaning dislikes 'hates) | |
668 (doctor-put-meaning hate 'hate) | |
669 (doctor-put-meaning hated 'hate) | |
670 (doctor-put-meaning dislike 'hate) | |
671 (doctor-put-meaning stoned 'state) | |
672 (doctor-put-meaning drunk 'state) | |
673 (doctor-put-meaning drunken 'state) | |
674 (doctor-put-meaning high 'state) | |
675 (doctor-put-meaning horny 'state) | |
676 (doctor-put-meaning blasted 'state) | |
677 (doctor-put-meaning happy 'state) | |
678 (doctor-put-meaning paranoid 'state) | |
679 (doctor-put-meaning wish 'desire) | |
680 (doctor-put-meaning wishes 'desire) | |
681 (doctor-put-meaning want 'desire) | |
682 (doctor-put-meaning desire 'desire) | |
683 (doctor-put-meaning like 'desire) | |
684 (doctor-put-meaning hope 'desire) | |
685 (doctor-put-meaning hopes 'desire) | |
686 (doctor-put-meaning desires 'desire) | |
687 (doctor-put-meaning wants 'desire) | |
688 (doctor-put-meaning desires 'desire) | |
689 (doctor-put-meaning likes 'desire) | |
690 (doctor-put-meaning needs 'desire) | |
691 (doctor-put-meaning need 'desire) | |
692 (doctor-put-meaning frustrated 'mood) | |
693 (doctor-put-meaning depressed 'mood) | |
694 (doctor-put-meaning annoyed 'mood) | |
695 (doctor-put-meaning upset 'mood) | |
696 (doctor-put-meaning unhappy 'mood) | |
697 (doctor-put-meaning excited 'mood) | |
698 (doctor-put-meaning worried 'mood) | |
699 (doctor-put-meaning lonely 'mood) | |
700 (doctor-put-meaning angry 'mood) | |
701 (doctor-put-meaning mad 'mood) | |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
702 (doctor-put-meaning pissed 'mood) |
400 | 703 (doctor-put-meaning jealous 'mood) |
704 (doctor-put-meaning afraid 'fear) | |
705 (doctor-put-meaning terrified 'fear) | |
706 (doctor-put-meaning fear 'fear) | |
707 (doctor-put-meaning scared 'fear) | |
708 (doctor-put-meaning frightened 'fear) | |
709 (doctor-put-meaning virginity 'sexnoun) | |
710 (doctor-put-meaning virgins 'sexnoun) | |
711 (doctor-put-meaning virgin 'sexnoun) | |
712 (doctor-put-meaning cock 'sexnoun) | |
713 (doctor-put-meaning cocks 'sexnoun) | |
714 (doctor-put-meaning dick 'sexnoun) | |
715 (doctor-put-meaning dicks 'sexnoun) | |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
716 (doctor-put-meaning cunt 'sexnoun) |
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
717 (doctor-put-meaning cunts 'sexnoun) |
400 | 718 (doctor-put-meaning prostitute 'sexnoun) |
719 (doctor-put-meaning condom 'sexnoun) | |
720 (doctor-put-meaning sex 'sexnoun) | |
721 (doctor-put-meaning rapes 'sexnoun) | |
722 (doctor-put-meaning wife 'family) | |
723 (doctor-put-meaning family 'family) | |
724 (doctor-put-meaning brothers 'family) | |
725 (doctor-put-meaning sisters 'family) | |
726 (doctor-put-meaning parent 'family) | |
727 (doctor-put-meaning parents 'family) | |
728 (doctor-put-meaning brother 'family) | |
729 (doctor-put-meaning sister 'family) | |
730 (doctor-put-meaning father 'family) | |
731 (doctor-put-meaning mother 'family) | |
732 (doctor-put-meaning husband 'family) | |
733 (doctor-put-meaning siblings 'family) | |
734 (doctor-put-meaning grandmother 'family) | |
735 (doctor-put-meaning grandfather 'family) | |
736 (doctor-put-meaning maternal 'family) | |
737 (doctor-put-meaning paternal 'family) | |
738 (doctor-put-meaning stab 'death) | |
739 (doctor-put-meaning murder 'death) | |
740 (doctor-put-meaning murders 'death) | |
741 (doctor-put-meaning suicide 'death) | |
742 (doctor-put-meaning suicides 'death) | |
743 (doctor-put-meaning kill 'death) | |
744 (doctor-put-meaning kills 'death) | |
18389
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
745 (doctor-put-meaning killing 'death) |
400 | 746 (doctor-put-meaning die 'death) |
747 (doctor-put-meaning dies 'death) | |
748 (doctor-put-meaning died 'death) | |
749 (doctor-put-meaning dead 'death) | |
750 (doctor-put-meaning death 'death) | |
751 (doctor-put-meaning deaths 'death) | |
752 (doctor-put-meaning pain 'symptoms) | |
753 (doctor-put-meaning ache 'symptoms) | |
754 (doctor-put-meaning fever 'symptoms) | |
755 (doctor-put-meaning sore 'symptoms) | |
756 (doctor-put-meaning aching 'symptoms) | |
757 (doctor-put-meaning stomachache 'symptoms) | |
758 (doctor-put-meaning headache 'symptoms) | |
759 (doctor-put-meaning hurts 'symptoms) | |
760 (doctor-put-meaning disease 'symptoms) | |
761 (doctor-put-meaning virus 'symptoms) | |
762 (doctor-put-meaning vomit 'symptoms) | |
763 (doctor-put-meaning vomiting 'symptoms) | |
764 (doctor-put-meaning barf 'symptoms) | |
765 (doctor-put-meaning toothache 'symptoms) | |
766 (doctor-put-meaning hurt 'symptoms) | |
767 (doctor-put-meaning rum 'alcohol) | |
768 (doctor-put-meaning gin 'alcohol) | |
769 (doctor-put-meaning vodka 'alcohol) | |
770 (doctor-put-meaning alcohol 'alcohol) | |
771 (doctor-put-meaning bourbon 'alcohol) | |
772 (doctor-put-meaning beer 'alcohol) | |
773 (doctor-put-meaning wine 'alcohol) | |
774 (doctor-put-meaning whiskey 'alcohol) | |
775 (doctor-put-meaning scotch 'alcohol) | |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
776 (doctor-put-meaning fuck 'sexverb) |
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
777 (doctor-put-meaning fucked 'sexverb) |
400 | 778 (doctor-put-meaning screw 'sexverb) |
779 (doctor-put-meaning screwing 'sexverb) | |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
780 (doctor-put-meaning fucking 'sexverb) |
400 | 781 (doctor-put-meaning rape 'sexverb) |
782 (doctor-put-meaning raped 'sexverb) | |
783 (doctor-put-meaning kiss 'sexverb) | |
784 (doctor-put-meaning kissing 'sexverb) | |
785 (doctor-put-meaning kisses 'sexverb) | |
786 (doctor-put-meaning screws 'sexverb) | |
18456
201152eafd1d
Undo previous censorship changes.
Richard M. Stallman <rms@gnu.org>
parents:
18389
diff
changeset
|
787 (doctor-put-meaning fucks 'sexverb) |
400 | 788 (doctor-put-meaning because 'conj) |
789 (doctor-put-meaning but 'conj) | |
790 (doctor-put-meaning however 'conj) | |
791 (doctor-put-meaning besides 'conj) | |
792 (doctor-put-meaning anyway 'conj) | |
793 (doctor-put-meaning that 'conj) | |
794 (doctor-put-meaning except 'conj) | |
795 (doctor-put-meaning why 'conj) | |
796 (doctor-put-meaning how 'conj) | |
797 (doctor-put-meaning until 'when) | |
798 (doctor-put-meaning when 'when) | |
799 (doctor-put-meaning whenever 'when) | |
800 (doctor-put-meaning while 'when) | |
801 (doctor-put-meaning since 'when) | |
802 (doctor-put-meaning rms 'rms) | |
803 (doctor-put-meaning stallman 'rms) | |
804 (doctor-put-meaning school 'school) | |
805 (doctor-put-meaning schools 'school) | |
806 (doctor-put-meaning skool 'school) | |
807 (doctor-put-meaning grade 'school) | |
808 (doctor-put-meaning grades 'school) | |
809 (doctor-put-meaning teacher 'school) | |
810 (doctor-put-meaning teachers 'school) | |
811 (doctor-put-meaning classes 'school) | |
812 (doctor-put-meaning professor 'school) | |
813 (doctor-put-meaning prof 'school) | |
814 (doctor-put-meaning profs 'school) | |
815 (doctor-put-meaning professors 'school) | |
816 (doctor-put-meaning mit 'school) | |
817 (doctor-put-meaning emacs 'eliza) | |
818 (doctor-put-meaning eliza 'eliza) | |
819 (doctor-put-meaning liza 'eliza) | |
820 (doctor-put-meaning elisa 'eliza) | |
821 (doctor-put-meaning weizenbaum 'eliza) | |
822 (doctor-put-meaning doktor 'eliza) | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
2307
diff
changeset
|
823 (doctor-put-meaning athletics 'sports) |
400 | 824 (doctor-put-meaning baseball 'sports) |
825 (doctor-put-meaning basketball 'sports) | |
826 (doctor-put-meaning football 'sports) | |
827 (doctor-put-meaning frisbee 'sports) | |
828 (doctor-put-meaning gym 'sports) | |
829 (doctor-put-meaning gymnastics 'sports) | |
830 (doctor-put-meaning hockey 'sports) | |
831 (doctor-put-meaning lacrosse 'sports) | |
832 (doctor-put-meaning soccer 'sports) | |
833 (doctor-put-meaning softball 'sports) | |
834 (doctor-put-meaning sports 'sports) | |
835 (doctor-put-meaning swimming 'sports) | |
836 (doctor-put-meaning swim 'sports) | |
837 (doctor-put-meaning tennis 'sports) | |
838 (doctor-put-meaning volleyball 'sports) | |
839 (doctor-put-meaning math 'math) | |
840 (doctor-put-meaning mathematics 'math) | |
841 (doctor-put-meaning mathematical 'math) | |
842 (doctor-put-meaning theorem 'math) | |
843 (doctor-put-meaning axiom 'math) | |
844 (doctor-put-meaning lemma 'math) | |
845 (doctor-put-meaning algebra 'math) | |
846 (doctor-put-meaning algebraic 'math) | |
847 (doctor-put-meaning trig 'math) | |
848 (doctor-put-meaning trigonometry 'math) | |
849 (doctor-put-meaning trigonometric 'math) | |
850 (doctor-put-meaning geometry 'math) | |
851 (doctor-put-meaning geometric 'math) | |
852 (doctor-put-meaning calculus 'math) | |
853 (doctor-put-meaning arithmetic 'math) | |
854 (doctor-put-meaning zippy 'zippy) | |
855 (doctor-put-meaning zippy 'zippy) | |
856 (doctor-put-meaning pinhead 'zippy) | |
857 (doctor-put-meaning chat 'chat) | |
858 | |
859 ;;;###autoload | |
860 (defun doctor () | |
861 "Switch to *doctor* buffer and start giving psychotherapy." | |
862 (interactive) | |
863 (switch-to-buffer "*doctor*") | |
864 (doctor-mode)) | |
865 | |
866 (defun doctor-ret-or-read (arg) | |
867 "Insert a newline if preceding character is not a newline. | |
868 Otherwise call the Doctor to parse preceding sentence." | |
869 (interactive "*p") | |
870 (if (= (preceding-char) ?\n) | |
871 (doctor-read-print) | |
872 (newline arg))) | |
873 | |
874 (defun doctor-read-print nil | |
875 "top level loop" | |
876 (interactive) | |
877 (let ((sent (doctor-readin))) | |
878 (insert "\n") | |
879 (setq lincount (1+ lincount)) | |
880 (doctor-doc sent) | |
881 (insert "\n") | |
882 (setq bak sent))) | |
883 | |
884 (defun doctor-readin nil | |
885 "Read a sentence. Return it as a list of words." | |
886 (let (sentence) | |
887 (backward-sentence 1) | |
888 (while (not (eobp)) | |
889 (setq sentence (append sentence (list (doctor-read-token))))) | |
890 sentence)) | |
891 | |
892 (defun doctor-read-token () | |
893 "read one word from buffer" | |
894 (prog1 (intern (downcase (buffer-substring (point) | |
895 (progn | |
896 (forward-word 1) | |
897 (point))))) | |
898 (re-search-forward "\\Sw*"))) | |
899 | |
900 ;; Main processing function for sentences that have been read. | |
901 | |
902 (defun doctor-doc (sent) | |
903 (cond | |
904 ((equal sent '(foo)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
905 (doctor-type '(bar! (doc$ please)(doc$ continue) \.))) |
400 | 906 ((member sent howareyoulst) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
907 (doctor-type '(i\'m ok \. (doc$ describe) yourself \.))) |
400 | 908 ((or (member sent '((good bye) (see you later) (i quit) (so long) |
909 (go away) (get lost))) | |
910 (memq (car sent) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
911 '(bye halt break quit done exit goodbye |
400 | 912 bye\, stop pause goodbye\, stop pause))) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
913 (doctor-type (doc$ bye))) |
400 | 914 ((and (eq (car sent) 'you) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
915 (memq (cadr sent) abusewords)) |
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
916 (setq found (cadr sent)) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
917 (doctor-type (doc$ abuselst))) |
400 | 918 ((eq (car sent) 'whatmeans) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
919 (doctor-def (cadr sent))) |
400 | 920 ((equal sent '(parse)) |
921 (doctor-type (list 'subj '= subj ", " | |
922 'verb '= verb "\n" | |
923 'object 'phrase '= obj "," | |
924 'noun 'form '= object "\n" | |
925 'current 'keyword 'is found | |
926 ", " | |
927 'most 'recent 'possessive | |
928 'is owner "\n" | |
929 'sentence 'used 'was | |
930 "..." | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
931 '(doc// bak)))) |
47588
73e46b26325e
(doctor-doc): Add 2 question words.
Richard M. Stallman <rms@gnu.org>
parents:
47367
diff
changeset
|
932 ((memq (car sent) '(are is do has have how when where who why)) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
933 (doctor-type (doc$ qlist))) |
400 | 934 ;; ((eq (car sent) 'forget) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
935 ;; (set (cadr sent) nil) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
936 ;; (doctor-type '((doc$ isee)(doc$ please) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
937 ;; (doc$ continue)\.))) |
400 | 938 (t |
939 (if (doctor-defq sent) (doctor-define sent found)) | |
47314
0b575bd912a4
(doctor-doc): Recognize question words and use qlist.
Richard M. Stallman <rms@gnu.org>
parents:
40218
diff
changeset
|
940 (if (> (length sent) 12)(setq sent (doctor-shorten sent))) |
400 | 941 (setq sent (doctor-correct-spelling (doctor-replace sent replist))) |
942 (cond ((and (not (memq 'me sent))(not (memq 'i sent)) | |
943 (memq 'am sent)) | |
944 (setq sent (doctor-replace sent '((am . (are))))))) | |
945 (cond ((equal (car sent) 'yow) (doctor-zippy)) | |
946 ((< (length sent) 2) | |
947 (cond ((eq (doctor-meaning (car sent)) 'howdy) | |
948 (doctor-howdy)) | |
949 (t (doctor-short)))) | |
950 (t | |
951 (if (memq 'am sent) | |
952 (setq sent (doctor-replace sent '((me . (i)))))) | |
953 (setq sent (doctor-fixup sent)) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
954 (if (and (eq (car sent) 'do) (eq (cadr sent) 'not)) |
400 | 955 (cond ((zerop (random 3)) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
956 (doctor-type '(are you (doc$ afraidof) that \?))) |
400 | 957 ((zerop (random 2)) |
958 (doctor-type '(don\'t tell me what to do \. i am the | |
66342
a4fe475f3c8b
(doctor-doc): Don't say "psychiatrist".
Richard M. Stallman <rms@gnu.org>
parents:
64715
diff
changeset
|
959 doctor here!)) |
400 | 960 (doctor-rthing)) |
961 (t | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
962 (doctor-type '((doc$ whysay) that i shouldn\'t |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
963 (cddr sent) |
400 | 964 \?)))) |
965 (doctor-go (doctor-wherego sent)))))))) | |
966 | |
967 ;; Things done to process sentences once read. | |
968 | |
969 (defun doctor-correct-spelling (sent) | |
970 "Correct the spelling and expand each word in sentence." | |
971 (if sent | |
30887
c4366892a814
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
20978
diff
changeset
|
972 (apply 'append (mapcar (lambda (word) |
400 | 973 (if (memq word typos) |
974 (get (get word 'doctor-correction) 'doctor-expansion) | |
975 (list word))) | |
976 sent)))) | |
977 | |
978 (defun doctor-shorten (sent) | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
2307
diff
changeset
|
979 "Make a sentence manageably short using a few hacks." |
400 | 980 (let (foo |
47314
0b575bd912a4
(doctor-doc): Recognize question words and use qlist.
Richard M. Stallman <rms@gnu.org>
parents:
40218
diff
changeset
|
981 (retval sent) |
400 | 982 (temp '(because but however besides anyway until |
983 while that except why how))) | |
984 (while temp | |
985 (setq foo (memq (car temp) sent)) | |
986 (if (and foo | |
987 (> (length foo) 3)) | |
47314
0b575bd912a4
(doctor-doc): Recognize question words and use qlist.
Richard M. Stallman <rms@gnu.org>
parents:
40218
diff
changeset
|
988 (setq retval (doctor-fixup foo) |
0b575bd912a4
(doctor-doc): Recognize question words and use qlist.
Richard M. Stallman <rms@gnu.org>
parents:
40218
diff
changeset
|
989 temp nil) |
400 | 990 (setq temp (cdr temp)))) |
991 retval)) | |
992 | |
993 (defun doctor-define (sent found) | |
994 (doctor-svo sent found 1 nil) | |
995 (and | |
996 (doctor-nounp subj) | |
997 (not (doctor-pronounp subj)) | |
998 subj | |
999 (doctor-meaning object) | |
1000 (put subj 'doctor-meaning (doctor-meaning object)) | |
1001 t)) | |
1002 | |
1003 (defun doctor-defq (sent) | |
1004 "Set global var FOUND to first keyword found in sentence SENT." | |
1005 (setq found nil) | |
1006 (let ((temp '(means applies mean refers refer related | |
1007 similar defined associated linked like same))) | |
1008 (while temp | |
1009 (if (memq (car temp) sent) | |
1010 (setq found (car temp) | |
1011 temp nil) | |
1012 (setq temp (cdr temp))))) | |
1013 found) | |
1014 | |
1015 (defun doctor-def (x) | |
1016 (progn | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
1017 (doctor-type (list 'the 'word x 'means (doctor-meaning x) 'to 'me)) |
400 | 1018 nil)) |
1019 | |
1020 (defun doctor-forget () | |
1021 "Delete the last element of the history list." | |
1022 (setq history (reverse (cdr (reverse history))))) | |
1023 | |
1024 (defun doctor-query (x) | |
1025 "Prompt for a line of input from the minibuffer until a noun or verb is seen. | |
1026 Put dialogue in buffer." | |
1027 (let (a | |
1028 (prompt (concat (doctor-make-string x) | |
1029 " what \? ")) | |
1030 retval) | |
1031 (while (not retval) | |
1032 (while (not a) | |
1033 (insert ?\n | |
1034 prompt | |
1035 (read-string prompt) | |
1036 ?\n) | |
1037 (setq a (doctor-readin))) | |
1038 (while (and a (not retval)) | |
1039 (cond ((doctor-nounp (car a)) | |
1040 (setq retval (car a))) | |
1041 ((doctor-verbp (car a)) | |
1042 (setq retval (doctor-build | |
1043 (doctor-build x " ") | |
1044 (car a)))) | |
1045 ((setq a (cdr a)))))) | |
1046 retval)) | |
1047 | |
1048 (defun doctor-subjsearch (sent key type) | |
1049 "Search for the subject of a sentence SENT, looking for the noun closest | |
1050 to and preceding KEY by at least TYPE words. Set global variable subj to | |
1051 the subject noun, and return the portion of the sentence following it." | |
1052 (let ((i (- (length sent) (length (memq key sent)) type))) | |
1053 (while (and (> i -1) (not (doctor-nounp (nth i sent)))) | |
1054 (setq i (1- i))) | |
1055 (cond ((> i -1) | |
1056 (setq subj (nth i sent)) | |
1057 (nthcdr (1+ i) sent)) | |
1058 (t | |
1059 (setq subj 'you) | |
1060 nil)))) | |
1061 | |
1062 (defun doctor-nounp (x) | |
1063 "Returns t if the symbol argument is a noun." | |
1064 (or (doctor-pronounp x) | |
1065 (not (or (doctor-verbp x) | |
1066 (equal x 'not) | |
1067 (doctor-prepp x) | |
1068 (doctor-modifierp x) )) )) | |
1069 | |
1070 (defun doctor-pronounp (x) | |
1071 "Returns t if the symbol argument is a pronoun." | |
1072 (memq x '( | |
1073 i me mine myself | |
1074 we us ours ourselves ourself | |
1075 you yours yourself yourselves | |
1076 he him himself she hers herself | |
1077 it that those this these things thing | |
1078 they them themselves theirs | |
1079 anybody everybody somebody | |
1080 anyone everyone someone | |
1081 anything something everything))) | |
1082 | |
68248
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1083 (dolist (x |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1084 '(abort aborted aborts ask asked asks am |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1085 applied applies apply are associate |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1086 associated ate |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1087 be became become becomes becoming |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1088 been being believe believed believes |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1089 bit bite bites bore bored bores boring bought buy buys buying |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1090 call called calling calls came can caught catch come |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1091 contract contracted contracts control controlled controls |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1092 could croak croaks croaked cut cuts |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1093 dare dared define defines dial dialed dials did die died dies |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1094 dislike disliked |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1095 dislikes do does drank drink drinks drinking |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1096 drive drives driving drove dying |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1097 eat eating eats expand expanded expands |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1098 expect expected expects expel expels expelled |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1099 explain explained explains |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1100 fart farts feel feels felt fight fights find finds finding |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1101 forget forgets forgot fought found |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1102 fuck fucked fucking fucks |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1103 gave get gets getting give gives go goes going gone got gotten |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1104 had harm harms has hate hated hates have having |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1105 hear heard hears hearing help helped helping helps |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1106 hit hits hope hoped hopes hurt hurts |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1107 implies imply is |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1108 join joined joins jump jumped jumps |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1109 keep keeping keeps kept |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1110 kill killed killing kills kiss kissed kisses kissing |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1111 knew know knows |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1112 laid lay lays let lets lie lied lies like liked likes |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1113 liking listen listens |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1114 login look looked looking looks |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1115 lose losing lost |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1116 love loved loves loving |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1117 luse lusing lust lusts |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1118 made make makes making may mean means meant might |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1119 move moved moves moving must |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1120 need needed needs |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1121 order ordered orders ought |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1122 paid pay pays pick picked picking picks |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1123 placed placing prefer prefers put puts |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1124 ran rape raped rapes |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1125 read reading reads recall receive received receives |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1126 refer refered referred refers |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1127 relate related relates remember remembered remembers |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1128 romp romped romps run running runs |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1129 said sang sat saw say says |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1130 screw screwed screwing screws scrod see sees seem seemed |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1131 seems seen sell selling sells |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1132 send sendind sends sent shall shoot shot should |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1133 sing sings sit sits sitting sold studied study |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1134 take takes taking talk talked talking talks tell tells telling |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1135 think thinks |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1136 thought told took tooled touch touched touches touching |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1137 transfer transferred transfers transmit transmits transmitted |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1138 type types types typing |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1139 walk walked walking walks want wanted wants was watch |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1140 watched watching went were will wish would work worked works |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1141 write writes writing wrote use used uses using)) |
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1142 (put x 'doctor-sentence-type 'verb)) |
400 | 1143 |
1144 (defun doctor-verbp (x) (if (symbolp x) | |
1145 (eq (get x 'doctor-sentence-type) 'verb))) | |
1146 | |
1147 (defun doctor-plural (x) | |
1148 "Form the plural of the word argument." | |
1149 (let ((foo (doctor-make-string x))) | |
1150 (cond ((string-equal (substring foo -1) "s") | |
1151 (cond ((string-equal (substring foo -2 -1) "s") | |
1152 (intern (concat foo "es"))) | |
1153 (t x))) | |
1154 ((string-equal (substring foo -1) "y") | |
1155 (intern (concat (substring foo 0 -1) | |
1156 "ies"))) | |
1157 (t (intern (concat foo "s")))))) | |
1158 | |
1159 (defun doctor-setprep (sent key) | |
1160 (let ((val) | |
1161 (foo (memq key sent))) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1162 (cond ((doctor-prepp (cadr foo)) |
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1163 (setq val (doctor-getnoun (cddr foo))) |
400 | 1164 (cond (val val) |
1165 (t 'something))) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1166 ((doctor-articlep (cadr foo)) |
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1167 (setq val (doctor-getnoun (cddr foo))) |
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1168 (cond (val (doctor-build (doctor-build (cadr foo) " ") val)) |
400 | 1169 (t 'something))) |
1170 (t 'something)))) | |
1171 | |
1172 (defun doctor-getnoun (x) | |
1173 (cond ((null x)(setq object 'something)) | |
1174 ((atom x)(setq object x)) | |
1175 ((eq (length x) 1) | |
1176 (setq object (cond | |
1177 ((doctor-nounp (setq object (car x))) object) | |
1178 (t (doctor-query object))))) | |
1179 ((eq (car x) 'to) | |
1180 (doctor-build 'to\ (doctor-getnoun (cdr x)))) | |
1181 ((doctor-prepp (car x)) | |
1182 (doctor-getnoun (cdr x))) | |
1183 ((not (doctor-nounp (car x))) | |
1184 (doctor-build (doctor-build (cdr (assq (car x) | |
1185 (append | |
1186 '((a . this) | |
1187 (some . this) | |
1188 (one . that)) | |
1189 (list | |
1190 (cons | |
1191 (car x) (car x)))))) | |
1192 " ") | |
1193 (doctor-getnoun (cdr x)))) | |
47588
73e46b26325e
(doctor-doc): Add 2 question words.
Richard M. Stallman <rms@gnu.org>
parents:
47367
diff
changeset
|
1194 (t (setq object (car x)) |
73e46b26325e
(doctor-doc): Add 2 question words.
Richard M. Stallman <rms@gnu.org>
parents:
47367
diff
changeset
|
1195 (doctor-build (doctor-build (car x) " ") (doctor-getnoun (cdr x)))) |
73e46b26325e
(doctor-doc): Add 2 question words.
Richard M. Stallman <rms@gnu.org>
parents:
47367
diff
changeset
|
1196 )) |
400 | 1197 |
1198 (defun doctor-modifierp (x) | |
1199 (or (doctor-adjectivep x) | |
1200 (doctor-adverbp x) | |
1201 (doctor-othermodifierp x))) | |
1202 | |
1203 (defun doctor-adjectivep (x) | |
1204 (or (numberp x) | |
1205 (doctor-nmbrp x) | |
1206 (doctor-articlep x) | |
1207 (doctor-colorp x) | |
1208 (doctor-sizep x) | |
1209 (doctor-possessivepronounp x))) | |
1210 | |
1211 (defun doctor-adverbp (xx) | |
5282
1d3c5ef6e8a1
(make-doctor-variables): Fix some local var names.
Richard M. Stallman <rms@gnu.org>
parents:
4249
diff
changeset
|
1212 (let ((xxstr (doctor-make-string xx))) |
1d3c5ef6e8a1
(make-doctor-variables): Fix some local var names.
Richard M. Stallman <rms@gnu.org>
parents:
4249
diff
changeset
|
1213 (and (>= (length xxstr) 2) |
1d3c5ef6e8a1
(make-doctor-variables): Fix some local var names.
Richard M. Stallman <rms@gnu.org>
parents:
4249
diff
changeset
|
1214 (string-equal (substring (doctor-make-string xx) -2) "ly")))) |
400 | 1215 |
1216 (defun doctor-articlep (x) | |
1217 (memq x '(the a an))) | |
1218 | |
1219 (defun doctor-nmbrp (x) | |
1220 (memq x '(one two three four five six seven eight nine ten | |
1221 eleven twelve thirteen fourteen fifteen | |
1222 sixteen seventeen eighteen nineteen | |
1223 twenty thirty forty fifty sixty seventy eighty ninety | |
1224 hundred thousand million billion | |
1225 half quarter | |
1226 first second third fourth fifth | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
2307
diff
changeset
|
1227 sixth seventh eighth ninth tenth))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
1228 |
400 | 1229 (defun doctor-colorp (x) |
1230 (memq x '(beige black blue brown crimson | |
1231 gray grey green | |
1232 orange pink purple red tan tawny | |
1233 violet white yellow))) | |
1234 | |
1235 (defun doctor-sizep (x) | |
1236 (memq x '(big large tall fat wide thick | |
1237 small petite short thin skinny))) | |
1238 | |
1239 (defun doctor-possessivepronounp (x) | |
1240 (memq x '(my your his her our their))) | |
1241 | |
1242 (defun doctor-othermodifierp (x) | |
1243 (memq x '(all also always amusing any anyway associated awesome | |
1244 bad beautiful best better but certain clear | |
1245 ever every fantastic fun funny | |
13956
71284f0d43ac
(make-doctor-variables, doctor-othermodifierp,
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
1246 good great grody gross however if ignorant |
400 | 1247 less linked losing lusing many more much |
1248 never nice obnoxious often poor pretty real related rich | |
1249 similar some stupid super superb | |
1250 terrible terrific too total tubular ugly very))) | |
1251 | |
1252 (defun doctor-prepp (x) | |
1253 (memq x '(about above after around as at | |
1254 before beneath behind beside between by | |
1255 for from in inside into | |
1256 like near next of on onto over | |
1257 same through thru to toward towards | |
1258 under underneath with without))) | |
1259 | |
1260 (defun doctor-remember (thing) | |
1261 (cond ((null history) | |
1262 (setq history (list thing))) | |
1263 (t (setq history (append history (list thing)))))) | |
1264 | |
1265 (defun doctor-type (x) | |
1266 (setq x (doctor-fix-2 x)) | |
1267 (doctor-txtype (doctor-assm x))) | |
1268 | |
1269 (defun doctor-fixup (sent) | |
1270 (setq sent (append | |
1271 (cdr | |
1272 (assq (car sent) | |
1273 (append | |
1274 '((me i) | |
1275 (him he) | |
1276 (her she) | |
1277 (them they) | |
1278 (okay) | |
1279 (well) | |
1280 (sigh) | |
1281 (hmm) | |
1282 (hmmm) | |
1283 (hmmmm) | |
1284 (hmmmmm) | |
1285 (gee) | |
1286 (sure) | |
1287 (great) | |
1288 (oh) | |
1289 (fine) | |
1290 (ok) | |
1291 (no)) | |
1292 (list (list (car sent) | |
1293 (car sent)))))) | |
1294 (cdr sent))) | |
1295 (doctor-fix-2 sent)) | |
1296 | |
1297 (defun doctor-fix-2 (sent) | |
1298 (let ((foo sent)) | |
1299 (while foo | |
1300 (if (and (eq (car foo) 'me) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1301 (doctor-verbp (cadr foo))) |
400 | 1302 (rplaca foo 'i) |
1303 (cond ((eq (car foo) 'you) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1304 (cond ((memq (cadr foo) '(am be been is)) |
400 | 1305 (rplaca (cdr foo) 'are)) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1306 ((memq (cadr foo) '(has)) |
400 | 1307 (rplaca (cdr foo) 'have)) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1308 ((memq (cadr foo) '(was)) |
400 | 1309 (rplaca (cdr foo) 'were)))) |
1310 ((equal (car foo) 'i) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1311 (cond ((memq (cadr foo) '(are is be been)) |
400 | 1312 (rplaca (cdr foo) 'am)) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1313 ((memq (cadr foo) '(were)) |
400 | 1314 (rplaca (cdr foo) 'was)) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1315 ((memq (cadr foo) '(has)) |
400 | 1316 (rplaca (cdr foo) 'have)))) |
1317 ((and (doctor-verbp (car foo)) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1318 (eq (cadr foo) 'i) |
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1319 (not (doctor-verbp (car (cddr foo))))) |
400 | 1320 (rplaca (cdr foo) 'me)) |
1321 ((and (eq (car foo) 'a) | |
1322 (doctor-vowelp (string-to-char | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1323 (doctor-make-string (cadr foo))))) |
400 | 1324 (rplaca foo 'an)) |
1325 ((and (eq (car foo) 'an) | |
1326 (not (doctor-vowelp (string-to-char | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1327 (doctor-make-string (cadr foo)))))) |
400 | 1328 (rplaca foo 'a))) |
1329 (setq foo (cdr foo)))) | |
1330 sent)) | |
1331 | |
1332 (defun doctor-vowelp (x) | |
1333 (memq x '(?a ?e ?i ?o ?u))) | |
1334 | |
1335 (defun doctor-replace (sent rlist) | |
1336 "Replace any element of SENT that is the car of a replacement | |
1337 element pair in RLIST." | |
1338 (apply 'append | |
1339 (mapcar | |
1340 (function | |
1341 (lambda (x) | |
1342 (cdr (or (assq x rlist) ; either find a replacement | |
1343 (list x x))))) ; or fake an identity mapping | |
1344 sent))) | |
1345 | |
1346 (defun doctor-wherego (sent) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1347 (cond ((null sent)(doc$ whereoutp)) |
400 | 1348 ((null (doctor-meaning (car sent))) |
1349 (doctor-wherego (cond ((zerop (random 2)) | |
1350 (reverse (cdr sent))) | |
1351 (t (cdr sent))))) | |
1352 (t | |
1353 (setq found (car sent)) | |
1354 (doctor-meaning (car sent))))) | |
1355 | |
1356 (defun doctor-svo (sent key type mem) | |
1357 "Find subject, verb and object in sentence SENT with focus on word KEY. | |
1358 TYPE is number of words preceding KEY to start looking for subject. | |
1359 MEM is t if results are to be put on Doctor's memory stack. | |
1360 Return in the global variables SUBJ, VERB and OBJECT." | |
621 | 1361 (let ((foo (doctor-subjsearch sent key type))) |
400 | 1362 (or foo |
1363 (setq foo sent | |
1364 mem nil)) | |
1365 (while (and (null (doctor-verbp (car foo))) (cdr foo)) | |
1366 (setq foo (cdr foo))) | |
1367 (setq verb (car foo)) | |
1368 (setq obj (doctor-getnoun (cdr foo))) | |
1369 (cond ((eq object 'i)(setq object 'me)) | |
1370 ((eq subj 'me)(setq subj 'i))) | |
1371 (cond (mem (doctor-remember (list subj verb obj)))))) | |
1372 | |
1373 (defun doctor-possess (sent key) | |
1374 "Set possessive in SENT for keyword KEY. | |
1375 Hack on previous word, setting global variable OWNER to correct result." | |
1376 (let* ((i (- (length sent) (length (memq key sent)) 1)) | |
1377 (prev (if (< i 0) 'your | |
1378 (nth i sent)))) | |
1379 (setq owner (if (or (doctor-possessivepronounp prev) | |
1380 (string-equal "s" | |
1381 (substring (doctor-make-string prev) | |
1382 -1))) | |
1383 prev | |
1384 'your)))) | |
1385 | |
1386 ;; Output of replies. | |
1387 | |
1388 (defun doctor-txtype (ans) | |
1389 "Output to buffer a list of symbols or strings as a sentence." | |
1390 (setq *print-upcase* t *print-space* nil) | |
68248
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1391 (mapc 'doctor-type-symbol ans) |
400 | 1392 (insert "\n")) |
1393 | |
1394 (defun doctor-type-symbol (word) | |
1395 "Output a symbol to the buffer with some fancy case and spacing hacks." | |
1396 (setq word (doctor-make-string word)) | |
1397 (if (string-equal word "i") (setq word "I")) | |
1398 (if *print-upcase* | |
1399 (progn | |
1400 (setq word (capitalize word)) | |
1401 (if *print-space* | |
1402 (insert " ")))) | |
1403 (cond ((or (string-match "^[.,;:?! ]" word) | |
1404 (not *print-space*)) | |
1405 (insert word)) | |
64715
46d503c20412
(doctor-type-symbol): "?\ " -> "?\s".
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
1406 (t (insert ?\s word))) |
4249
5f6e6ea4c7af
(doctor-type-symbol): Win if auto-fill-function is nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1407 (and auto-fill-function |
5f6e6ea4c7af
(doctor-type-symbol): Win if auto-fill-function is nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1408 (> (current-column) fill-column) |
5f6e6ea4c7af
(doctor-type-symbol): Win if auto-fill-function is nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1409 (apply auto-fill-function nil)) |
400 | 1410 (setq *print-upcase* (string-match "[.?!]$" word) |
1411 *print-space* t)) | |
1412 | |
1413 (defun doctor-build (str1 str2) | |
1414 "Make a symbol out of the concatenation of the two non-list arguments." | |
1415 (cond ((null str1) str2) | |
1416 ((null str2) str1) | |
1417 ((and (atom str1) | |
1418 (atom str2)) | |
1419 (intern (concat (doctor-make-string str1) | |
1420 (doctor-make-string str2)))) | |
1421 (t nil))) | |
1422 | |
1423 (defun doctor-make-string (obj) | |
1424 (cond ((stringp obj) obj) | |
1425 ((symbolp obj) (symbol-name obj)) | |
1426 ((numberp obj) (int-to-string obj)) | |
1427 (t ""))) | |
1428 | |
1429 (defun doctor-concat (x y) | |
1430 "Like append, but force atomic arguments to be lists." | |
1431 (append | |
1432 (if (and x (atom x)) (list x) x) | |
1433 (if (and y (atom y)) (list y) y))) | |
1434 | |
1435 (defun doctor-assm (proto) | |
1436 (cond ((null proto) nil) | |
1437 ((atom proto) (list proto)) | |
1438 ((atom (car proto)) | |
1439 (cons (car proto) (doctor-assm (cdr proto)))) | |
1440 (t (doctor-concat (doctor-assm (eval (car proto))) (doctor-assm (cdr proto)))))) | |
1441 | |
1442 ;; Functions that handle specific words or meanings when found. | |
1443 | |
1444 (defun doctor-go (destination) | |
1445 "Call a `doctor-*' function." | |
1446 (funcall (intern (concat "doctor-" (doctor-make-string destination))))) | |
1447 | |
1448 (defun doctor-desire1 () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1449 (doctor-go (doc$ whereoutp))) |
400 | 1450 |
1451 (defun doctor-huh () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1452 (cond ((< (length sent) 9) (doctor-type (doc$ huhlst))) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1453 (t (doctor-type (doc$ longhuhlst))))) |
400 | 1454 |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1455 (defun doctor-rthing () (doctor-type (doc$ thlst))) |
400 | 1456 |
1457 (defun doctor-remem () (cond ((null history)(doctor-huh)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1458 ((doctor-type (doc$ remlst))))) |
400 | 1459 |
1460 (defun doctor-howdy () | |
1461 (cond ((not howdyflag) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1462 (doctor-type '((doc$ hello) what brings you to see me \?)) |
400 | 1463 (setq howdyflag t)) |
1464 (t | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1465 (doctor-type '((doc$ ibelieve) we\'ve introduced ourselves already \.)) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1466 (doctor-type '((doc$ please) (doc$ describe) (doc$ things) \.))))) |
400 | 1467 |
1468 (defun doctor-when () | |
1469 (cond ((< (length (memq found sent)) 3)(doctor-short)) | |
1470 (t | |
1471 (setq sent (cdr (memq found sent))) | |
1472 (setq sent (doctor-fixup sent)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1473 (doctor-type '((doc$ whatwhen)(doc// sent) \?))))) |
400 | 1474 |
1475 (defun doctor-conj () | |
1476 (cond ((< (length (memq found sent)) 4)(doctor-short)) | |
1477 (t | |
1478 (setq sent (cdr (memq found sent))) | |
1479 (setq sent (doctor-fixup sent)) | |
1480 (cond ((eq (car sent) 'of) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1481 (doctor-type '(are you (doc$ sure) that is the real reason \?)) |
400 | 1482 (setq things (cons (cdr sent) things))) |
1483 (t | |
1484 (doctor-remember sent) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1485 (doctor-type (doc$ beclst))))))) |
400 | 1486 |
1487 (defun doctor-short () | |
1488 (cond ((= (car repetitive-shortness) (1- lincount)) | |
1489 (rplacd repetitive-shortness | |
1490 (1+ (cdr repetitive-shortness)))) | |
1491 (t | |
1492 (rplacd repetitive-shortness 1))) | |
1493 (rplaca repetitive-shortness lincount) | |
1494 (cond ((> (cdr repetitive-shortness) 6) | |
1495 (cond ((not **mad**) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1496 (doctor-type '((doc$ areyou) |
400 | 1497 just trying to see what kind of things |
1498 i have in my vocabulary \? please try to | |
1499 carry on a reasonable conversation!)) | |
1500 (setq **mad** t)) | |
1501 (t | |
1502 (doctor-type '(i give up \. you need a lesson in creative | |
1503 writing \.\.\.)) | |
1504 ))) | |
1505 (t | |
1506 (cond ((equal sent (doctor-assm '(yes))) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1507 (doctor-type '((doc$ isee) (doc$ inter) (doc$ whysay) this is so \?))) |
400 | 1508 ((equal sent (doctor-assm '(because))) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1509 (doctor-type (doc$ shortbeclst))) |
400 | 1510 ((equal sent (doctor-assm '(no))) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1511 (doctor-type (doc$ neglst))) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1512 (t (doctor-type (doc$ shortlst))))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
1513 |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1514 (defun doctor-alcohol () (doctor-type (doc$ drnk))) |
400 | 1515 |
1516 (defun doctor-desire () | |
1517 (let ((foo (memq found sent))) | |
1518 (cond ((< (length foo) 2) | |
1519 (doctor-go (doctor-build (doctor-meaning found) 1))) | |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1520 ((memq (cadr foo) '(a an)) |
400 | 1521 (rplacd foo (append '(to have) (cdr foo))) |
1522 (doctor-svo sent found 1 nil) | |
1523 (doctor-remember (list subj 'would 'like obj)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1524 (doctor-type (doc$ whywant))) |
47322
8a11a2109567
(doctor-cadr, doctor-caddr, doctor-cddr): Remove.
John Paul Wallington <jpw@pobox.com>
parents:
47314
diff
changeset
|
1525 ((not (eq (cadr foo) 'to)) |
400 | 1526 (doctor-go (doctor-build (doctor-meaning found) 1))) |
1527 (t | |
1528 (doctor-svo sent found 1 nil) | |
1529 (doctor-remember (list subj 'would 'like obj)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1530 (doctor-type (doc$ whywant)))))) |
400 | 1531 |
1532 (defun doctor-drug () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1533 (doctor-type (doc$ drugs)) |
400 | 1534 (doctor-remember (list 'you 'used found))) |
1535 | |
1536 (defun doctor-toke () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1537 (doctor-type (doc$ toklst))) |
400 | 1538 |
1539 (defun doctor-state () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1540 (doctor-type (doc$ states))(doctor-remember (list 'you 'were found))) |
400 | 1541 |
1542 (defun doctor-mood () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1543 (doctor-type (doc$ moods))(doctor-remember (list 'you 'felt found))) |
400 | 1544 |
1545 (defun doctor-fear () | |
1546 (setq feared (doctor-setprep sent found)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1547 (doctor-type (doc$ fears)) |
400 | 1548 (doctor-remember (list 'you 'were 'afraid 'of feared))) |
1549 | |
1550 (defun doctor-hate () | |
1551 (doctor-svo sent found 1 t) | |
1552 (cond ((memq 'not sent) (doctor-forget) (doctor-huh)) | |
1553 ((equal subj 'you) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1554 (doctor-type '(why do you (doc// verb)(doc// obj) \?))) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1555 (t (doctor-type '((doc$ whysay)(list subj verb obj)))))) |
400 | 1556 |
1557 (defun doctor-symptoms () | |
66342
a4fe475f3c8b
(doctor-doc): Don't say "psychiatrist".
Richard M. Stallman <rms@gnu.org>
parents:
64715
diff
changeset
|
1558 (doctor-type '((doc$ maybe) you should consult a medical doctor\; |
a4fe475f3c8b
(doctor-doc): Don't say "psychiatrist".
Richard M. Stallman <rms@gnu.org>
parents:
64715
diff
changeset
|
1559 i am a psychotherapist. \.))) |
400 | 1560 |
1561 (defun doctor-hates () | |
1562 (doctor-svo sent found 1 t) | |
1563 (doctor-hates1)) | |
1564 | |
1565 (defun doctor-hates1 () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1566 (doctor-type '((doc$ whysay)(list subj verb obj) \?))) |
400 | 1567 |
1568 (defun doctor-loves () | |
1569 (doctor-svo sent found 1 t) | |
1570 (doctor-qloves)) | |
1571 | |
1572 (defun doctor-qloves () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1573 (doctor-type '((doc$ bother)(list subj verb obj) \?))) |
400 | 1574 |
1575 (defun doctor-love () | |
1576 (doctor-svo sent found 1 t) | |
1577 (cond ((memq 'not sent) (doctor-forget) (doctor-huh)) | |
1578 ((memq 'to sent) (doctor-hates1)) | |
1579 (t | |
1580 (cond ((equal object 'something) | |
1581 (setq object '(this person you love)))) | |
1582 (cond ((equal subj 'you) | |
1583 (setq lover obj) | |
1584 (cond ((equal lover '(this person you love)) | |
1585 (setq lover '(your partner)) | |
1586 (doctor-forget) | |
1587 (doctor-type '(with whom are you in love \?))) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1588 ((doctor-type '((doc$ please) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1589 (doc$ describe) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1590 (doc$ relation) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1591 (doc// lover) |
400 | 1592 \.))))) |
1593 ((equal subj 'i) | |
1594 (doctor-txtype '(we were discussing you!))) | |
1595 (t (doctor-forget) | |
1596 (setq obj 'someone) | |
1597 (setq verb (doctor-build verb 's)) | |
1598 (doctor-qloves)))))) | |
1599 | |
1600 (defun doctor-mach () | |
1601 (setq found (doctor-plural found)) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1602 (doctor-type (doc$ machlst))) |
400 | 1603 |
1604 (defun doctor-sexnoun () (doctor-sexverb)) | |
1605 | |
1606 (defun doctor-sexverb () | |
1607 (if (or (memq 'me sent)(memq 'myself sent)(memq 'i sent)) | |
1608 (doctor-foul) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1609 (doctor-type (doc$ sexlst)))) |
400 | 1610 |
18389
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1611 (defun doctor-death () |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1612 (cond (suicide-flag (doctor-type (doc$ deathlst))) |
18389
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1613 ((or (equal found 'suicide) |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1614 (and (or (equal found 'kill) |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1615 (equal found 'killing)) |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1616 (memq 'yourself sent))) |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1617 (setq suicide-flag t) |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1618 (doctor-type '(If you are really suicidal, you might |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1619 want to contact the Samaritans via |
f5f7ca6c4a96
(doctor-death): Give real advice to truly suicidal.
Richard M. Stallman <rms@gnu.org>
parents:
18383
diff
changeset
|
1620 E-mail: jo@samaritans.org or, at your option, |
32659
8f47d09a2be7
(doctor-death): Update the Samaritans'
Gerd Moellmann <gerd@gnu.org>
parents:
30887
diff
changeset
|
1621 anonymous E-mail: samaritans@anon.twwells.com\ \. |
8f47d09a2be7
(doctor-death): Update the Samaritans'
Gerd Moellmann <gerd@gnu.org>
parents:
30887
diff
changeset
|
1622 or find a Befrienders crisis center at |
8f47d09a2be7
(doctor-death): Update the Samaritans'
Gerd Moellmann <gerd@gnu.org>
parents:
30887
diff
changeset
|
1623 http://www.befrienders.org/\ \. |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1624 (doc$ please) (doc$ continue) \.))) |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1625 (t (doctor-type (doc$ deathlst))))) |
400 | 1626 |
1627 (defun doctor-foul () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1628 (doctor-type (doc$ foullst))) |
400 | 1629 |
1630 (defun doctor-family () | |
1631 (doctor-possess sent found) | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1632 (doctor-type (doc$ famlst))) |
400 | 1633 |
1634 ;; I did not add this -- rms. | |
1635 ;; But he might have removed it. I put it back. --roland | |
1636 (defun doctor-rms () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1637 (cond (rms-flag (doctor-type (doc$ stallmanlst))) |
400 | 1638 (t (setq rms-flag t) (doctor-type '(do you know Stallman \?))))) |
1639 | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1640 (defun doctor-school nil (doctor-type (doc$ schoollst))) |
400 | 1641 |
1642 (defun doctor-eliza () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1643 (cond (eliza-flag (doctor-type (doc$ elizalst))) |
400 | 1644 (t (setq eliza-flag t) |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1645 (doctor-type '((doc// found) \? hah ! |
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1646 (doc$ please) (doc$ continue) \.))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47588
diff
changeset
|
1647 |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1648 (defun doctor-sports () (doctor-type (doc$ sportslst))) |
400 | 1649 |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1650 (defun doctor-math () (doctor-type (doc$ mathlst))) |
400 | 1651 |
1652 (defun doctor-zippy () | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1653 (cond (zippy-flag (doctor-type (doc$ zippylst))) |
400 | 1654 (t (setq zippy-flag t) |
1655 (doctor-type '(yow! are we interactive yet \?))))) | |
1656 | |
1657 | |
47367
d8c0258cdf14
2002-09-10 Deepak Goel <deego@glue.umd.edu>
John Paul Wallington <jpw@pobox.com>
parents:
47322
diff
changeset
|
1658 (defun doctor-chat () (doctor-type (doc$ chatlst))) |
400 | 1659 |
76953 | 1660 (random t) |
1661 | |
18383 | 1662 (provide 'doctor) |
1663 | |
68248
3a3f5ed673b0
Move defvars out of eval-when-compile. Use dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66342
diff
changeset
|
1664 ;; arch-tag: 579380f6-4902-4ea5-bccb-6339e30e1257 |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
621
diff
changeset
|
1665 ;;; doctor.el ends here |