;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are ;; met: ;; ;; - Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; ;; - Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in ;; the documentation and/or other materials provided with the ;; distribution. ;; ;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the ;; names of its contributors may be used to endorse or promote products ;; derived from this software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS and CONTRIBUTorS "AS ;; IS" and ANY EXPRESS or IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY and FITNESS For A ;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER ;; or CONTRIBUTorS BE LIABLE For ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ;; EXEMPLARY, or consEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ;; PROCUREMENT OF SUBSTITUTE GOODS or SERVICES; LOSS OF USE, DATA, or ;; PROFITS; or BUSINESS INTERRUPTION) HOWEVER CAUSED and ON ANY THEorY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, or TorT (INCLUDING ;; NEGLIGENCE or OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (defun substring (cvec start length) (setq cvec (string cvec)) (if length (subseq cvec start (+ start length)) (subseq cvec start))) (defun maxindex (str) (1- (length str))) (setq |$charPeriod| #\.) (setq |$charBack| #\\) (setq |$charQuote| #\') (setq |$charSemiColon| #\;) (setq |$charComma| #\,) (setq |$charDash| #\-) (defun |checkSplitPunctuation| (|x|) (prog (|m| |lastchar|) (return (progn (setq |m| (MAXINDEX |x|)) (cond ((> 1 |m|) (cons |x| nil)) (t (setq |lastchar| (elt |x| |m|)) (cond ((and (equal |lastchar| |$charPeriod|) (equal (elt |x| (- |m| 1)) |$charPeriod|)) (cons |x| nil)) ((or (equal |lastchar| |$charPeriod|) (equal |lastchar| |$charSemiColon|) (equal |lastchar| |$charComma|)) (cons (SUBSTRING |x| 0 |m|) (cons |lastchar| nil))) ((and (> |m| 1) (equal (elt |x| (- |m| 1)) |$charQuote|)) (format t "char quote detected but m is: ~D" |m|) (cons (SUBSTRING |x| 0 (- |m| 1)) (cons (SUBSTRING |x| (- |m| 1) nil) nil))) (t (cons |x| nil)))))))))