2 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
5 $LOAD_PATH.unshift("..")
10 @ds.close unless @ds.nil?
15 db_dir = CHISE::DB_DIR
16 @ds = CHISE::DataSource.new(CHISE::DataSource::Berkeley_DB, db_dir, 0, 0755)
17 die "Can't open data source" if @ds.nil?
19 # get a character by Daikanwa number 364.
21 char_id = @ds.decode_char("=daikanwa", 364)
23 ccs = @ds.get_ccs("=daikanwa")
24 die "Can't open CCS =daikanwa" if ccs.nil?
25 char_id = ccs.decode(364)
29 ft = @ds.get_feature("ideographic-structure")
30 value = ft.get_value(char_id)
31 printf("#x%X => %s\n", char_id, value.to_s)
33 @ds.each_feature_name {|name|
34 #puts "rb_feature : "+name
37 ft = @ds.get_feature("numeric-value")
38 ft.each_char {|cid, valdatum|
39 printf("#x%08X ", cid)
41 ucs = @ds.get_feature("=ucs").get_value(cid)
43 printf("[U-%08X]", ucs.to_s.to_i)
45 ucs = @ds.get_feature("=>ucs").get_value(cid)
47 printf("(U-%08X)", ucs.to_s.to_i)
53 printf(" %s", @ds.get_feature("name").get_value(cid))
54 printf(" %s\n", valdatum.to_s)