データ読み込み時のバグ修正
@@ -1,16 +1,15 @@ | ||
1 | 1 | (in-package :unf) |
2 | 2 | |
3 | 3 | (eval-when (:compile-toplevel) |
4 | - (let ((*default-pathname-defaults* | |
5 | - (pathname (directory-namestring *compile-file-pathname*)))) | |
4 | + (let ((root (pathname (directory-namestring *compile-file-pathname*)))) | |
6 | 5 | (defun load-canonical-combining-class () |
7 | 6 | (coerce |
8 | - (with-open-file (in "data/canonical-combining-class.lisp") | |
7 | + (with-open-file (in (merge-pathnames "data/canonical-combining-class.lisp" root)) | |
9 | 8 | (read in)) |
10 | 9 | '(vector (unsigned-byte 8)))) |
11 | 10 | |
12 | 11 | (defun load-decomposition-mapping (type) |
13 | - (let ((filepath (format nil "data/~(~A~)-decomposition-map.lisp" type))) | |
12 | + (let ((filepath (merge-pathnames (format nil "data/~(~A~)-decomposition-map.lisp" type) root))) | |
14 | 13 | (map 'vector |
15 | 14 | (lambda (o) |
16 | 15 | (if (null o) |
@@ -20,13 +19,13 @@ | ||
20 | 19 | (read in))))) |
21 | 20 | |
22 | 21 | (defun load-illegal-char-list (form) |
23 | - (coerce (with-open-file (in (format nil "data/~(~A~)-illegal-char.lisp" form)) | |
22 | + (coerce (with-open-file (in (merge-pathnames (format nil "data/~(~A~)-illegal-char.lisp" form) root)) | |
24 | 23 | (read in)) |
25 | 24 | 'bit-vector)) |
26 | 25 | |
27 | 26 | (defun load-canonical-composition-mapping () |
28 | 27 | (let ((map (make-hash-table :test #'equal))) |
29 | - (loop FOR ((c1 . c2) . v) IN (with-open-file (in "data/canonical-composition-map.lisp") | |
28 | + (loop FOR ((c1 . c2) . v) IN (with-open-file (in (merge-pathnames "data/canonical-composition-map.lisp" root)) | |
30 | 29 | (read in)) |
31 | 30 | DO |
32 | 31 | (setf (gethash (cons (code-char c1) (code-char c2)) map) (code-char v))) |