;;; RASP/PROB - patch1.lsp ;;; ;;; Copyright: John Carroll January 2009 (in-package #+(or cltl2 x3j13 ansi-cl) common-lisp-user #-(or cltl2 x3j13 ansi-cl) 'user) ;;; #+allegro (when (search "ix86_linux" (SYS:COMMAND-LINE-ARGUMENT 0)) (format t "[patch1...~%") (finish-output) (defun yes-for-question (&rest x) (declare (ignore x)) t) (clear-whole-grammar) (embed lr1-parse-analysis-trees (lambda (in-sentences out-prob-trees &optional (logfile t)) (with-output-file-or-stream (log-str logfile :direction :output :if-exists :overwrite :if-does-not-exist :create) (let ((*error-output* log-str) (*trace-output* log-str) (*standard-output* log-str)) (time (lr1-parse-analysis-trees in-sentences out-prob-trees)))))) (progn (gc :tenure) (setf (sys:gsgc-switch :auto-step) nil) (embed read-sentence-from-file (lambda (in-str out-str) (gc) (sys:gsgc-step-generation) (read-sentence-from-file in-str out-str)))) (setq +prob-data-pathname+ (make-pathname :directory (append (pathname-directory *load-pathname*) '("data")))) (format t "Loading from ~A~%" +prob-data-pathname+) (read-grammar (merge-pathnames "tsg15" +prob-data-pathname+)) (progn (install-unification-grammar t) (install-grammar-from-file (merge-pathnames "tsg15.backbone" +prob-data-pathname+)) (install-machine-from-file (merge-pathnames "tsg15.machine" +prob-data-pathname+))) (lr1-read-history-probs (merge-pathnames "tsg15.probs-ti" +prob-data-pathname+)) (format t "]~%") (finish-output) ) ;;; End of file