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