|
|
@@ -24,7 +24,9 @@
|
|
|
(в жопу себе его засунь) (хуюровень) ,@*fuck-off*)
|
|
|
(((?* ?a) (?is ?x ,(lambda (i) (search "ХАХА" (symbol-name i)))) (?* ?b))
|
|
|
(очень смешно) (клоунов тут нашел?) (посмейся мне еще) ,@*fuck-off*)
|
|
|
- (((?* ?a) (?or ты бот) (?* ?x))
|
|
|
+ (((?* ?a) (?or сиськи титьки буфера tits) (?* ?b))
|
|
|
+ (#'tumblr-random-photo))
|
|
|
+ (((?* ?a) (?or ты бот ботяра) (?* ?x))
|
|
|
(сам ?x) (сам ты ?x) (а по ебалу?) (сейчас мы разберемся кто еще тут ?x) ,@*fuck-off*)
|
|
|
(((?* x))
|
|
|
(:text . "И чё?")
|
|
|
@@ -56,18 +58,6 @@
|
|
|
(defun print-with-spaces (list)
|
|
|
(format nil "~@(~{~a~^ ~}~)" list))
|
|
|
|
|
|
-(defun mappend (fn &rest lists)
|
|
|
- "Apply fn to each element of lists and append the results."
|
|
|
- (apply #'append (apply #'mapcar fn lists)))
|
|
|
-
|
|
|
-(defun random-elt (choices)
|
|
|
- "Choose an element from a list at random."
|
|
|
- (elt choices (random (length choices))))
|
|
|
-
|
|
|
-(defun flatten (the-list)
|
|
|
- "Append together elements (or lists) in the list."
|
|
|
- (mappend #'(lambda (x) (if (listp x) (flatten x) (list x))) the-list))
|
|
|
-
|
|
|
(defun switch-viewpoint (words)
|
|
|
"Change I to you and vice versa, and so on."
|
|
|
(sublis '((I . you) (you . I) (me . you) (am . are)
|
|
|
@@ -82,11 +72,13 @@
|
|
|
(random-elt responses)))))
|
|
|
|
|
|
(defun eliza (input)
|
|
|
- (let ((response (use-eliza-rules
|
|
|
- (read-from-string-no-punct input))))
|
|
|
- (when response
|
|
|
- (if (keywordp (first response))
|
|
|
- response
|
|
|
- (print-with-spaces (flatten response))))))
|
|
|
+ (let ((r (use-eliza-rules
|
|
|
+ (read-from-string-no-punct input))))
|
|
|
+ (cond
|
|
|
+ ((null r))
|
|
|
+ ((and (consp (car r)) (eq 'function (caar r)))
|
|
|
+ (apply (cadar r) (cdr r)))
|
|
|
+ ((keywordp (car r)) r)
|
|
|
+ (t (print-with-spaces (flatten r))))))
|
|
|
|
|
|
|