update.
[chise/xemacs-chise.git] / lisp / utf-2000 / char-db-util.el
index 02eb939..87d11f6 100644 (file)
@@ -1,7 +1,8 @@
 ;;; char-db-util.el --- Character Database utility -*- coding: utf-8-er; -*-
 
-;; Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,
-;;   2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 MORIOKA Tomohiko.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
+;;   2020, 2021, 2022, 2023, 2024 MORIOKA Tomohiko.
 
 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
 ;; Keywords: CHISE, Character Database, ISO/IEC 10646, UCS, Unicode, MULE.
    ?屮 ?艸 ?蓐 ?茻 ?小 ?八 ?釆 ?半 ?牛 ?犛 ; 020
    ?告 ?口 ?凵 ?吅 ?哭 ?走 ?止 ?癶 ?步 ?此 ; 030
    ?正 ?是 ?辵 ?彳 ?廴 ?㢟 ?行 ?齒 ?牙 ?足 ; 040
-   ?疋 ?品 ?龠 ?冊 ?㗊 ?舌 ?干 ?谷 ?只 ?㕯 ; 050
+   ?疋 ?品 ?龠 ?冊 ?㗊 ?舌 ?干 ?𧮫 ?只 ?㕯 ; 050
    ?句 ?丩 ?古 ?十 ?卅 ?言 ?誩 ?音 ?䇂 ?丵 ; 060
    ?菐 ?𠬞 ?𠬜 ?共 ?異 ?舁 ?𦥑 ?䢅 ?爨 ?革 ; 070
-   ?鬲 ?䰜 ?爪 ?𠃨 ?鬥 ?又 ?𠂇 ?㕜 ?支 ?𦘒 ; 080
+   ?鬲 ?䰜 ?爪 ?𠃨 ?鬥 ?又 ?𠂇 ?史 ?支 ?𦘒 ; 080
    ?聿 ?畫 ?隶 ?臤 ?臣 ?殳 ?殺 ?𠘧 ?寸 ?皮 ; 090
    ?㼱 ?攴 ?敎 ?卜 ?用 ?爻 ?㸚 ?𥄎 ?目 ?䀠 ; 100
    ?眉 ?盾 ?自 ?白 ?鼻 ?皕 ?習 ?羽 ?隹 ?奞 ; 110
-   ?萑 ?𦫳 ?苜 ?羊 ?羴 ?瞿 ?雔 ?雥 ?鳥 ?烏 ; 120
+   ?雈 ?𦫳 ?𥄕 ?羊 ?羴 ?瞿 ?雔 ?雥 ?鳥 ?烏 ; 120
    ?𠦒 ?冓 ?幺 ?𢆶 ?叀 ?玄 ?予 ?放 ?𠬪 ?𣦼 ; 130
-   ?歺 ?死 ?冎 ?骨 ?肉 ?筋 ?刀 ?刃 ?㓞 ?丰 ; 140
-   ?耒 ?𧢲 ?竹 ?箕 ?丌 ?左 ?工 ?㠭 ?巫 ?甘 ; 150
+   ?歺 ?死 ?冎 ?骨 ?肉 ?筋 ?刀 ?刃 ?㓞 ?丯 ; 140
+   ?耒 ?角 ?竹 ?箕 ?丌 ?左 ?工 ?㠭 ?巫 ?甘 ; 150
    ?曰 ?乃 ?丂 ?可 ?兮 ?号 ?亏 ?旨 ?喜 ?壴 ; 160
 ;  ?旨 ?曰 ?乃 ?丂 ?可 ?兮 ?号 ?亏 ?喜 ?壴 ; 160
    ?鼓 ?豈 ?豆 ?豊 ?豐 ?䖒 ?虍 ?虎 ?虤 ?皿 ; 170
@@ -91,8 +92,8 @@
    ?日 ?旦 ?倝 ?㫃 ?冥 ?晶 ?月 ?有 ?明 ?囧 ; 240
    ?夕 ?多 ?毌 ?𢎘 ?𣐺 ?卣 ?齊 ?朿 ?片 ?鼎 ; 250
    ?克 ?彔 ?禾 ?秝 ?黍 ?香 ?米 ?毇 ?臼 ?凶 ; 260
-   ?𣎳 ?林 ?麻 ?尗 ?耑 ?韭 ?瓜 ?瓠 ?宀 ?宮 ; 270
-   ?呂 ?穴 ?㝱 ?𤕫 ?冖 ?𠔼 ?冃 ?㒳 ?网 ?襾 ; 280
+   ?𣎳 ?𣏟 ?麻 ?尗 ?耑 ?韭 ?瓜 ?瓠 ?宀 ?宮 ; 270
+   ?呂 ?穴 ?㝱 ?疒 ?冖 ?𠔼 ?冃 ?㒳 ?网 ?襾 ; 280
    ?巾 ?巿 ?帛 ?白 ?㡀 ?黹 ?人 ?𠤎 ?匕 ?从 ; 290
    ?比 ?北 ?丘 ?㐺 ?𡈼 ?重 ?臥 ?身 ?㐆 ?衣 ; 300
    ?裘 ?老 ?毛 ?毳 ?尸 ?尺 ?尾 ?履 ?舟 ?方 ; 310
    ?而 ?豕 ?㣇 ?彑 ?豚 ?豸 ?𤉡 ?易 ?象 ?馬 ; 370
    ?𢊁 ?鹿 ?麤 ?㲋 ?兔 ?萈 ?犬 ?㹜 ?鼠 ?能 ; 380
    ?熊 ?火 ?炎 ?黑 ?囪 ?焱 ?炙 ?赤 ?大 ?亦 ; 390
+   ?夨 ?夭 ?交 ?尣 ?壺 ?壹 ?㚔 ?奢 ?亢 ?夲 ; 400
+   ?夰 ?亣 ?夫 ?立 ?竝 ?囟 ?思 ?心 ?惢 ?水 ; 410
+   ?沝 ?瀕 ?𡿨 ?巜 ?川 ?泉 ?灥 ?永 ?𠂢 ?谷 ; 420
+   ?仌 ?雨 ?雲 ?魚 ?𩺰 ?燕 ?龍 ?飛 ?非 ?卂 ; 430
+   ?𠃉 ?不 ?至 ?西 ?鹵 ?鹽 ?戶 ?門 ?耳 ?𦣝 ; 440
+   ?手 ?𠦬 ?女 ?毋 ?民 ?丿 ?𠂆 ?乁 ?氏 ?氐 ; 450
+   ?戈 ?戉 ?我 ?亅 ?琴 ?𠃊 ?亡 ?匸 ?匚 ?曲 ; 460
+   ?甾 ?瓦 ?弓 ?弜 ?弦 ?系 ?糸 ?素 ?絲 ?率 ; 470
+   ?虫 ?䖵 ?蟲 ?風 ?它 ?龜 ?黽 ?卵 ?二 ?土 ; 480
+   ?垚 ?堇 ?里 ?田 ?畕 ?黃 ?男 ?力 ?劦 ?金 ; 490
+   ?幵 ?勺 ?几 ?且 ?斤 ?斗 ?矛 ?車 ?𠂤 ?𨸏 ; 500
+   ?𨺅 ?厽 ?四 ?宁 ?叕 ?亞 ?五 ?六 ?七 ?九 ; 510
+   ?禸 ?嘼 ?甲 ?乙 ?丙 ?丁 ?戊 ?己 ?巴 ?庚 ; 520
+   ?辛 ?辡 ?壬 ?癸 ?子 ?了 ?孨 ?𠫓 ?丑 ?寅 ; 530
+   ?卯 ?辰 ?巳 ?午 ?未 ?申 ?酉 ?酋 ?戌 ?亥 ; 540
    ])
 
 (defun shuowen-radical (number)
     =hanyo-denshi/ia
     =hanyo-denshi/ib
     =hanyo-denshi/hg
+    =hanyo-denshi/ip
     =hanyo-denshi/jt
     =hanyo-denshi/ks
     =hanyo-denshi/tk
     =gt
     =gt-k
     =daikanwa
+    =daijiten
     =daikanwa@rev2
     =daikanwa@rev1
     =daikanwa/+p
+    =daikanwa/ho
     ==daikanwa
+    ==daijiten
     =cbeta
     ideograph-hanziku-1
     ideograph-hanziku-2
     ;; =>>>hanyo-denshi/jt
     ;; =>>>hanyo-denshi/ks
     ;; =>>>gt
+    =>>mj
     =>>adobe-japan1-0
     =>>adobe-japan1-1
     =>>adobe-japan1-2
     =>jis-x0213-1@2004
     =>jis-x0213-2
     ==>ucs@bucs
-    =>iwds-1
-    =>ucs@hanyo-denshi
+    ==>daijiten
+    ;; =>ucs@hanyo-denshi
     =>ucs@iso
     =>ucs@unicode
     =>ucs@jis
     =>>ucs@iso
     =>>ucs@unicode
     =>>ucs@jis
+    =>>ucs@JP
     =>>ucs@cns
     =>>>ucs@iso
     =>>>ucs@unicode
     =>>big5-cdp
     =>>gt-k
     =+>gt
-    =>gt
-    =>mj
+    =+>big5-cdp
     =>big5-cdp
-    =>daikanwa
-    =>daikanwa/ho
-    =>cns11643-5
-    =>cns11643-7
+    =>big5-cdp@iwds-1
+    =>mj
+    =>hanyo-denshi/tk
+    =>iwds-1
     =big5
     =big5-eten
-    =>gt-k
     =zinbun-oracle
     =>zinbun-oracle
     =ruimoku-v6
     =>>ruimoku-v6
     ==ruimoku-v6
+    =>ruimoku-v6
     =jef-china3
-    =>cbeta
     =shinjigen
+    =>cns11643-5
+    =>cns11643-7
+    =>gt
+    =>gt-k
+    =>daikanwa
+    =>daikanwa/ho
+    =>cbeta
     =ucs-var-001
     =ucs-var-002
     =ucs-var-003
     =ucs-var-004
     =ucs-var-005
     =ucs-var-006
+    =ucs-var-007
     =ucs-var-008
     =ucs-var-010
     =ucs-itaiji-001
     =ucs-itaiji-004
     =ucs-itaiji-005
     =ucs-itaiji-006
+    =ucs-itaiji-007
     =ucs-itaiji-008
     =ucs-itaiji-009
+    =ucs-itaiji-010
+    =ucs-itaiji-011
+    =ucs-itaiji-012
+    =ucs-itaiji-013
+    =ucs-itaiji-014
+    =ucs-itaiji-015
+    =ucs-itaiji-016
+    =ucs-itaiji-018
+    =+>ucs-var-003
     =>ucs-itaiji-001
     =>ucs-itaiji-002
+    =>ucs-itaiji-003
+    =>ucs-itaiji-004
     =>ucs-itaiji-005
+    =>ucs-itaiji-006
+    =>ucs-itaiji-007
+    =>ucs-itaiji-008
+    =>ucs-itaiji-009
+    =>ucs-itaiji-010
+    =>ucs-itaiji-011
+    =>ucs-itaiji-012
+    =>ucs-itaiji-014
+    =>ucs-itaiji-015
+    =>ucs-itaiji-016
+    =>ucs-var-001
+    =big5-cdp-var-001
+    =big5-cdp-var-002
     =big5-cdp-var-003
     =big5-cdp-var-004
     =big5-cdp-var-005
+    =big5-cdp-var-007
+    =big5-cdp-var-008
+    =big5-cdp-var-010
     =big5-cdp-itaiji-001
     =big5-cdp-itaiji-002
     =big5-cdp-itaiji-003
+    =big5-cdp-itaiji-004
+    =big5-cdp-itaiji-005
     =>big5-cdp-itaiji-001
+    =>big5-cdp-itaiji-002
+    =>big5-cdp-itaiji-003
+    =>big5-cdp-itaiji-004
+    =>big5-cdp-itaiji-005
+    =>big5-cdp-itaiji-006
+    =>big5-cdp-var-001
     =>ucs@iwds-1
+    =>ucs@cognate
     =>ucs@component
+    =>ucs@iwds-1/normalized
+    =>ucs-itaiji-001@iwds-1
+    =>ucs-itaiji-002@iwds-1
+    =>ucs-itaiji-003@iwds-1
+    =>ucs-itaiji-006@iwds-1
+    =>big5-cdp@component
+    =>big5-cdp@cognate
     ==ucs@gb
-    =ucs@JP/hanazono))
+    =ucs@gb
+    ==ucs-var-002
+    ==ucs-itaiji-002
+    =ucs@JP/hanazono
+    =koseki
+    =shuowen-jiguge
+    =>shuowen-jiguge
+    ===shuowen-jiguge5
+    ===shuowen-jiguge4
+    ===chise-hdic-ktb-seal))
 
 
 ;;; @ char-db formatters
                                         ;; =gt-k
                                         =jis-x0208@1997
                                         ))
-                                 (eq (charset-property ccs 'iso-ir) 177)
+                                (and (eq (charset-property ccs 'iso-ir) 177)
+                                     (not (eq (charset-name ccs) '=ucs@big5)))
                                 ;; (string-match "=ucs@" (symbol-name ccs))
                                 )
                             (setq ccs (charset-name ccs))
                 =>>adobe-japan1-6 =+>adobe-japan1-6
                 =>cbeta =cbeta =>>cbeta ==cbeta ===cbeta
                 =zinbun-oracle =>zinbun-oracle
+                =daijiten ==daijiten ===daijiten ==>daijiten
                 ===hng-jou ===hng-keg ===hng-dng ===hng-mam
                 ===hng-drt ===hng-kgk ===hng-myz ===hng-kda
-                ===hng-khi ===hng-khm ===hng-hok ===hng-kyd ===hng-sok
+                ===hng-khi ===hng-khm ===hng-fhs ===hng-hok
+                ===hng-kyd ===hng-sok
                 ===hng-yhk ===hng-kak ===hng-kar ===hng-kae
                 ===hng-sys ===hng-tsu ===hng-tzj
-                ===hng-hos ===hng-nak ===hng-jhk
+                ===hng-hos ===hng-kkh ===hng-nak ===hng-jhk
                 ===hng-hod ===hng-gok ===hng-ink ===hng-nto
-                ===hng-nkm ===hng-k24 ===hng-nkk
+                ===hng-nkm ===hng-k24 ===hng-ini ===hng-nkk
                 ===hng-kcc ===hng-kcj ===hng-kbk ===hng-sik
                 ===hng-skk ===hng-kyu ===hng-ksk ===hng-wan
                 ===hng-okd ===hng-wad ===hng-kmi
-                ===hng-zkd ===hng-doh ===hng-jyu
-                ===hng-tzs ===hng-kss ===hng-kyo
-                ===hng-smk))
+                ===hng-zkd ===hng-doh ===hng-jyu ===hng-tzs
+                ===hng-sai ===hng-kad ===hng-kss
+                ===hng-kyo ===hng-ykk ===hng-saa
+                ===hng-sab ===hng-wks ===hng-wke ===hng-smk
+                ===hng-sgs ===hng-sts ===hng-kkd
+                =>shuowen-jiguge =shuowen-jiguge
+                ===shuowen-jiguge4 ===shuowen-jiguge5 ===shuowen-jiguge-A30))
         ;; (string-match "^=adobe-" (symbol-name name))
         )
        "(%-18s . %05d)\t; %c")
                     =mj ==mj ===mj =>>mj =>mj
                     =zihai mojikyo))
        "(%-18s . %06d)\t; %c")
-       ((memq name '(=hanyo-denshi/tk ==hanyo-denshi/tk))
+       ((memq name '(=hanyo-denshi/tk =>hanyo-denshi/tk ==hanyo-denshi/tk))
        "(%-18s . %08d)\t; %c")
        ((>= (charset-dimension name) 2)
        "(%-18s . #x%04X)\t; %c")
                                       line-breaking
                                       ccss readable)
       (setq attributes (delq '<-denotational@component attributes)))
+    (when (and (memq '<-denotational@usage attributes)
+              (setq value (get-char-attribute char '<-denotational@usage)))
+      (char-db-insert-relation-feature char '<-denotational@usage value
+                                      line-breaking
+                                      ccss readable)
+      (setq attributes (delq '<-denotational@usage attributes)))
     (when (and (memq 'name attributes)
               (setq value (get-char-attribute char 'name)))
       (insert (format
            (setq strokes value)))
       (setq attributes (delq 'cns-strokes attributes))
       )
-    ;; (when (and (memq 'shinjigen-1-radical attributes)
-    ;;            (setq value (get-char-attribute char 'shinjigen-1-radical)))
-    ;;   (unless (eq value radical)
-    ;;     (insert (format "(shinjigen-1-radical . %S)\t; %c%s"
-    ;;                     value
-    ;;                     (ideographic-radical value)
-    ;;                     line-breaking))
-    ;;     (or radical
-    ;;         (setq radical value)))
-    ;;   (setq attributes (delq 'shinjigen-1-radical attributes))
-    ;;   )
     ;; (when (and (memq 'ideographic- attributes)
     ;;            (setq value (get-char-attribute char 'ideographic-)))
     ;;   (insert "(ideographic-       ")
                      line-breaking))
       (setq attributes (delq '->mojikyo attributes))
       )
-    ;; (when (and (memq 'hanyu-dazidian-vol attributes)
-    ;;            (setq value (get-char-attribute char 'hanyu-dazidian-vol)))
-    ;;   (insert (format "(hanyu-dazidian-vol  . %d)%s"
-    ;;                   value line-breaking))
-    ;;   (setq attributes (delq 'hanyu-dazidian-vol attributes))
-    ;;   )
-    ;; (when (and (memq 'hanyu-dazidian-page attributes)
-    ;;            (setq value (get-char-attribute char 'hanyu-dazidian-page)))
-    ;;   (insert (format "(hanyu-dazidian-page . %d)%s"
-    ;;                   value line-breaking))
-    ;;   (setq attributes (delq 'hanyu-dazidian-page attributes))
-    ;;   )
-    ;; (when (and (memq 'hanyu-dazidian-char attributes)
-    ;;            (setq value (get-char-attribute char 'hanyu-dazidian-char)))
-    ;;   (insert (format "(hanyu-dazidian-char . %d)%s"
-    ;;                   value line-breaking))
-    ;;   (setq attributes (delq 'hanyu-dazidian-char attributes))
-    ;;   )
     (unless readable
       (dolist (ignored '(composition
                         ->denotational <-subsumptive ->ucs-unified
-                        ->ideographic-component-forms))
+                        ;; ->ideographic-component-forms
+                        ))
        (setq attributes (delq ignored attributes))))
     (while attributes
       (setq name (car attributes))
                    ))
               )
              ((or (eq name 'ideographic-structure)
+                  (eq name 'ideographic-structure@apparent)
+                  (eq name 'ideographic-structure@apparent/leftmost)
+                  (eq name 'ideographic-structure@apparent/rightmost)
                   (eq name 'ideographic-combination)
                    ;; (eq name 'ideographic-)
                   (eq name '=decomposition)