X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fruby.git;a=blobdiff_plain;f=chise%2Fchisedb.rb;h=4b930a1ae8b6fc81e409791a6a24319a792c44ea;hp=2969383bd421fea64b47d7a5e485f0550dfbd9c2;hb=HEAD;hpb=8feecfd1d87e83209d2e46a4115be7854dd79088;ds=sidebyside diff --git a/chise/chisedb.rb b/chise/chisedb.rb index 2969383..4b930a1 100755 --- a/chise/chisedb.rb +++ b/chise/chisedb.rb @@ -22,7 +22,8 @@ module CHISE setup_ds @feature_db = {} @ccs_db = {} - @byids_db = {} + # @byids_db = {} + @ccsstr_db = {} end attr_reader :ds, :location @@ -68,11 +69,17 @@ module CHISE ccsdb.decode(code_point) end - def get_by_ids_db(n) + def nuget_by_ids_db(n) @byids_db[n] = ByIDS_DB.new(self, n) if @byids_db[n].nil? @byids_db[n] end + def get_ccs_str(n) + @ccsstr_db[n] = CCS_STR.new(self, n) if @ccsstr_db[n].nil? +# @ccsstr_db[n] = CCS_STR_DB.new(self, n) if @ccsstr_db[n].nil? + @ccsstr_db[n] + end + private include EachEntryModule end @@ -166,7 +173,7 @@ module CHISE end end - class ByIDS_DB + class CCS_STR_DB include ParseValueModule include ChiseValue include TableAccessModule @@ -182,16 +189,16 @@ module CHISE } end - def decode(ids) + def get_by_str(str) setup_db return nil if @db.nil? - parse_c_string(@db.get(ids)) + parse_c_string(@db.get(str)) end - def set_decoded_char(ids, cid) + def set_by_str(str, cid) setup_db(true) raise "@db is nil." if @db.nil? - @db.put(ids, format_char_id(cid)) + @db.put(str, format_char_id(cid)) end def each_char @@ -202,4 +209,5 @@ module CHISE } end end + end