#!/usr/bin/env ruby
# Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
-require "libchise_c"
+require "libchise"
$LOAD_PATH.unshift("..")
require "chise/qp"
end
def main
- db_dir = CHISE::DB_DIR
+ db_dir = CHISE::DataSource::DB_DIR
@ds = CHISE::DataSource.new(CHISE::DataSource::Berkeley_DB, db_dir, 0, 0755)
die "Can't open data source" if @ds.nil?
ft = @ds.get_feature("ideographic-structure")
value = ft.get_value(char_id)
- printf("#x%X => %s\n", char_id, value.to_s)
+ printf("#x%X => %s\n", char_id, value)
@ds.each_feature_name {|name|
- #puts "rb_feature : "+name
+ puts "feature : "+name
}
ft = @ds.get_feature("numeric-value")
ucs = @ds.get_feature("=ucs").get_value(cid)
if ucs
- printf("[U-%08X]", ucs.to_s.to_i)
+ printf("[U-%08X]", ucs.to_i)
else
ucs = @ds.get_feature("=>ucs").get_value(cid)
if ucs
- printf("(U-%08X)", ucs.to_s.to_i)
+ printf("(U-%08X)", ucs.to_i)
else
printf(" ")
end
end
printf(" %s", @ds.get_feature("name").get_value(cid))
- printf(" %s\n", valdatum.to_s)
+ printf(" %s\n", valdatum)
}
@ds.close