Changeset 58


Ignore:
Timestamp:
08/05/04 16:54:09 (21 years ago)
Author:
bmastenbrook
Message:

um, not sure

Location:
trunk/example
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/example/advice

    r51 r58  
    9696 (11964
    9797  . "I guess this just goes to show that you can lead a horse to water, but you can't make him drink it.")
    98  (11999 . "You are a stupid asshole.  Shut the fuck up."))
     98 (11999 . "You are a stupid asshole.  Shut the fuck up.")
     99 (12000 . "Looking for a compiler bug is the second-to-last resort. The last resort is blaming bad RAM. It's never the correct hypothesis."))
  • TabularUnified trunk/example/cliki.lisp

    r57 r58  
    488488                    (return-from cliki-lookup nil))
    489489                  (or
    490                    (let ((strings
    491                           (or
    492                            (aif
    493                             (nth-value 1 (scan-to-strings "^(?i)(direct|tell|show|inform|teach|give)\\s+(\\S+)\\s+(about|on|in|to|through|for|some|)\\s*(.+)$" first-pass))
    494                             (cons :forward it))
    495                            (aif
    496                             (nth-value 1 (scan-to-strings "^(?i)(look\\s+up\\s+|)\\s*(.+)\\s+(for|to|at)\\s+(\\S+)$" first-pass))
    497                             (cons :backward it))
    498                            )))
    499                      (if strings
    500                          (let* ((term (case (car strings)
    501                                         (:forward (elt (cdr strings) 3))
    502                                         (:backward (elt (cdr strings) 1))))
    503                                 (person (case (car strings)
    504                                         (:forward (elt (cdr strings) 1))
    505                                         (:backward (elt (cdr strings) 3))))
    506                                 (person (if (string-equal person "me")
    507                                             (or sender channel "you")
    508                                             person))
    509                                 (about (cliki-lookup term :sender sender
    510                                                     :channel channel)))
    511                            (if about
    512                                (format nil "~A: ~A~A"
    513                                        person
    514                                        (if (scan "http:" about)
    515                                            (concatenate 'string
    516                                                         (random-element
    517                                                          '("have a look at"
    518                                                            "please look at"
    519                                                            "please see"
    520                                                            "direct your attention towards"
    521                                                            "look at"))
    522                                                         " ")
    523                                            "")
    524                                        about)
    525                                (setf should-send-cant-find nil)))))
     490                   
    526491                   (if (string-equal first-pass "help")
    527492                       (if (should-do-lookup first-pass (or channel sender ""))
     
    576541                     (and strs
    577542                          (lookup-paste (parse-integer (elt strs 0)))))
    578                    
     543                   (let ((strings
     544                          (or
     545                           (aif
     546                            (nth-value 1 (scan-to-strings "^(?i)(direct|tell|show|inform|teach|give)\\s+(\\S+)\\s+(about|on|in|to|through|for|some|)\\s*(.+)$" first-pass))
     547                            (cons :forward it))
     548                           (aif
     549                            (nth-value 1 (scan-to-strings "^(?i)(look\\s+up\\s+|)\\s*(.+)\\s+(for|to|at)\\s+(\\S+)$" first-pass))
     550                            (cons :backward it))
     551                           )))
     552                     (if strings
     553                         (let* ((term (case (car strings)
     554                                        (:forward (elt (cdr strings) 3))
     555                                        (:backward (elt (cdr strings) 1))))
     556                                (person (case (car strings)
     557                                        (:forward (elt (cdr strings) 1))
     558                                        (:backward (elt (cdr strings) 3))))
     559                                (person (if (string-equal person "me")
     560                                            (or sender channel "you")
     561                                            person))
     562                                (about (cliki-lookup term :sender sender
     563                                                    :channel channel)))
     564                           (if about
     565                               (format nil "~A: ~A~A"
     566                                       person
     567                                       (if (scan "http:" about)
     568                                           (concatenate 'string
     569                                                        (random-element
     570                                                         '("have a look at"
     571                                                           "please look at"
     572                                                           "please see"
     573                                                           "direct your attention towards"
     574                                                           "look at"))
     575                                                        " ")
     576                                           "")
     577                                       about)
     578                               (setf should-send-cant-find nil)))))
    579579                   (if (scan "^(?i)hello(\\s|$)*" first-pass) "what's up?")
    580580                   (if (scan "^(?i)hi(\\s|$)*" first-pass) "what's up?")
  • TabularUnified trunk/example/specbot.lisp

    r50 r58  
    130130                         *default-pathname-defaults*)))))
    131131
     132(defparameter *ppc-file*
     133  (merge-pathnames "ppc-assem.lisp-expr"
     134                   (make-pathname
     135                    :directory
     136                    (pathname-directory
     137                     (or *load-truename*
     138                         *default-pathname-defaults*)))))
     139
    132140(defun start-specbot (nick server &rest channels)
    133141  (add-simple-alist-lookup *754-file* 'ieee754 "ieee754" "Section numbers of IEEE 754")
     142  (add-simple-alist-lookup *ppc-file* 'ppc "ppc" "PowerPC assembly mnemonics")
    134143  (setf *nickname* nick)
    135144  (setf *connection* (connect :nickname *nickname* :server server))
Note: See TracChangeset for help on using the changeset viewer.