1 (concord-assign-genre 'glyph-image "/usr/local/var/photo/db")
3 ;; (concord-assign-genre 'hng-card "/usr/local/var/hng-card/db")
4 ;; (mount-char-attribute-table '->HNG)
5 ;; (mount-char-attribute-table '<-HNG)
7 (defun concord-setsumon-add-rep-img (img-specifier char)
8 (let ((ret (split-string img-specifier "_"))
9 folder page char-num geo width height off-x off-y ratio
10 img-url base-cobj base-id
12 seg-glyph-cobj seg-glyph-id
13 page-offset ccs rep-glyph)
16 char-num (string-to-int (pop ret))
18 (setq folder (substring page 0 4)
19 page (substring page 4))
22 "http://image.kanji.zinbun.kyoto-u.ac.jp/images/zinbun/toho/%s/%s%s.jpg"
25 "^\\([0-9]+\\)x\\([0-9]+\\)\\+\\([0-9]+\\)\\+\\([0-9]+\\)$" geo)
26 (setq width (string-to-int (match-string 1 geo))
27 height (string-to-int (match-string 2 geo))
28 off-x (string-to-int (match-string 3 geo))
29 off-y (string-to-int (match-string 4 geo)))
31 (cond ((string= folder "A024")
33 ccs '===shuowen-jiguge4)
35 ((string= folder "A020")
37 ccs '===shuowen-jiguge5)
42 (concord-images-add-url
45 "http://image.kanji.zinbun.kyoto-u.ac.jp/images/iiif/zinbun/toho/%s/%s%s.tif"
48 "http://image.kanji.zinbun.kyoto-u.ac.jp/iipsrv/iipsrv.fcgi?FIF=/zinbun/toho/%s/%s%s.tif&CVT=jpeg"
50 (setq base-id (concord-object-get base-cobj '=id))
52 (concord-images-add-segments base-cobj
53 (round (* off-x ratio))
54 (round (* off-y ratio))
55 (round (* width ratio))
56 (round (* height ratio))))
57 (setq seg-glyph-id (intern (format "%s/char=%d" base-id char-num)))
58 (unless (setq seg-glyph-cobj
59 (concord-decode-object '=id seg-glyph-id))
61 (concord-make-object 'glyph-image seg-glyph-id))
62 (concord-object-adjoin*
63 seg-glyph-cobj '->image-resource seg-cobj)
64 (concord-object-adjoin*
65 seg-glyph-cobj '<-segmented-glyph-image base-cobj)
67 (concord-object-adjoin*
68 seg-glyph-cobj 'character char)
71 (decode-char ccs (+ (* (- (string-to-int page) page-offset)
74 (concord-object-put seg-glyph-cobj 'representative-glyph