1 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
4 require "chise/libchise"
11 db_dir = CHISE::DataSource::DB_DIR
12 @ds = DataSource.new(CHISE::DataSource::Berkeley_DB, db_dir, 0, 0755)
16 def location() @ds.location; end
18 def get_feature(f) @ds.get_feature(f) end
20 def get_ccs(c) @ds.get_ccs(c) end
22 def decode_char(n, cid) @ds.decode_char(n, cid) end
24 def load_feature(n, cid) @ds.load_feature(n, cid) end
26 def each_feature_name() @ds.each_feature_name {|f| yield f } end
28 #def each_ccs() @ds.each_ccs {|c| yield c } end
31 @byids_db[n] = ByIDS_DB.new(@ds, n) if @byids_db[n].nil?
37 def initialize(ds, name)
49 include TableAccessModule
51 def initialize(ds, name)
53 @category, @keyvalue = "character", "by_ids"
59 return nil if @db.nil?
60 parse_c_string(@db.get(ids))
63 def set_decoded_char(ids, cid)
65 raise "@db is nil." if @db.nil?
66 @db.put(ids, format_char_id(cid))
71 raise "@db is nil." if @db.nil?
73 yield(parse_value(k), parse_c_string(v))