2 # define local kanji features, by eto 2003-0305
7 class IDS_Definition #======================================================================
10 #●ids-element: stop-character。これ以上分割しない、基本要素文字。
11 #その文字自身を値として持つ。それ以外の値を持つ場合は、それを代りの値として使うことを意味する。
12 #つまり、101字の基本漢字は最小構成要素なので、それ以上分解しませんよ、ということ。
13 IDS_ELEMENT = "六百回交向歩考出書多少高可"
14 BASIC_KANJI = "人子女母父王口耳手足力目首毛心犬牛鳥貝角羽虫馬魚羊肉皮米竹木麦豆山川雨風水土石金田穴日月火音糸刀舟門戸衣矢弓車皿一二三四五六七八九十百千万寸尺上中下本玉立回食行止交向歩考入示走生出来書言大小白青多少高長"
16 AWASE_KANJI = "鳴名加品古知問間聞取兄見切分粉貧林森校東明住位好岩砂里男畑習休短空坂島倉美孝赤看光初努協解新歌語話張強忘悲答晴現正字安守灰秋秒困国医包同合舌居右左受友反道返迷花菜集机主太氷州点店庫仕帳幼防引配早直班筆重番北化比死夏後進酒福私家世内谷半原前寺思電雲気布旅衆泣"
18 #●ids-meaning: 意味的に考えるところのIDS。形としてはつながらないが、意味としてはこう分割できるというものを表す。
50 #●ids-represent: これを持つもつ字は、それ以外の字を意味するということを意味する。
51 #例えば人偏は、人を意味する。これは再帰的に摘要する。
83 #●ids-link: 横列びの関係があるもの
93 #show_ids(IDS_ELEMENT) #ar = BASIC_KANJI+IDS_ELEMENT
94 #show_ids(IDS_MEANING.join())
95 #show_ids(KanjiList.instance.joyo)
96 #show_ids(KanjiList.instance.awase(0))
97 #show_ids(open("0208-shell.txt").read)
99 #p "休".decompose.to_er
103 str.de_er.to_a.sort.uniq.each {|ch|
105 ids = char.decompose_all
106 print "#{char} #{ids.map_ucs}\n" #できるだけucsに正規化するべし。
113 exit if line.nil? || line =~ /end/
114 print "#{line.decompose} #{line.decompose.to_er}\n"
115 print "#{line.decompose_all} #{line.decompose_all.to_er}\n"
125 def define_ids_element
126 IDS_ELEMENT.each_char {|ch|
128 char.ids_element = ch
131 def define_ids_meaning
132 IDS_MEANING.each {|line|
133 next if line.nil? || line == "" || line =~ /^#/
136 char.ids_meaning = ids.de_er
137 print "#{ch} #{ids}\n"
140 def define_ids_represent
141 IDS_REPRESENT.each {|line|
142 next if line.nil? || line == "" || line =~ /^#/
145 char.ids_represent = rep.de_er
146 print "#{char.map_ucs} #{rep}\n"
150 IDS_LINK.each {|line|
151 next if line.nil? || line == "" || line =~ /^#/
154 char.ids_link = rep.de_er
155 print "#{char.map_ucs} #{rep}\n"
163 ide = IDS_Definition.instance
169 #----------------------------------------------------------------------end.