Update of /project/cl-irc/cvsroot/cl-irc/example In directory common-lisp.net:/home/lisppaste/cl-irc/example
Modified Files: cliki.lisp Log Message: for bmastenbrook: length limit
Date: Thu Oct 13 21:52:34 2005 Author: lisppaste
Index: cl-irc/example/cliki.lisp diff -u cl-irc/example/cliki.lisp:1.36 cl-irc/example/cliki.lisp:1.37 --- cl-irc/example/cliki.lisp:1.36 Thu Oct 13 20:35:08 2005 +++ cl-irc/example/cliki.lisp Thu Oct 13 21:52:33 2005 @@ -1,4 +1,4 @@ -;;;; $Id: cliki.lisp,v 1.36 2005/10/13 18:35:08 lisppaste Exp $ +;;;; $Id: cliki.lisp,v 1.37 2005/10/13 19:52:33 lisppaste Exp $ ;;;; $Source: /project/cl-irc/cvsroot/cl-irc/example/cliki.lisp,v $
;;;; cliki.lisp - CLiki as an infobot; only works on SBCL. @@ -684,10 +684,11 @@ (nth-value 1 (scan-to-strings "^(?i)what\s+([a-zA-Z"]+)\s+(means|stands\s+for)$" first-pass))))) (and str (let ((letters (remove #" (elt str 0)))) - (if (and (> (length letters) 2) - (string-equal (subseq letters (- (length letters) 2)) "cl")) - (steel-bazooka:steel-whatever :letters (string-downcase (subseq letters 0 (- (length letters) 2)))) - (steel-bazooka:steel-whatever :letters (string-downcase letters) :suffix nil))))) + (when (< (length letters) 9) + (if (and (> (length letters) 2) + (string-equal (subseq letters (- (length letters) 2)) "cl")) + (steel-bazooka:steel-whatever :letters (string-downcase (subseq letters 0 (- (length letters) 2)))) + (steel-bazooka:steel-whatever :letters (string-downcase letters) :suffix nil)))))) (let ((str (nth-value 1 (scan-to-strings "^(?i)shorten\s+(\w+://.+\S)\s*$" term-with-question)))) (and str (shorten (elt str 0))))