require "chise/parser"
require "chise/chisedb"
require "chise/iconv"
+require "chise/utf8"
+require "chise/ids"
module CHISE
class CharacterFactory # generate Character object and cache them
end
class Character
+ include UTF8Value
+ include IDS_Module
+
def initialize(char_id)
raise if char_id.nil?
- raise unless char_id.is_a?(Fixnum) # char_id sure is a Fixnum.
- raise if char_id < 0 # char_id sure is a positive value.
+ raise unless char_id.kind_of?(Integer) # make sure char_id is Integer.
+ raise if char_id < 0 # make sure char_id is positive.
@char_id = char_id
@char_id.freeze
- @utf8_mcs = CHISE.i_tou8(@char_id)
+ # @utf8_mcs = CHISE.i_tou8(@char_id)
+ @utf8_mcs = itou8(@char_id)
@utf8_mcs.freeze
@feature = {}
@check_all_done = nil
en.to_er(self)
end
+ def is_idc?
+ 0x2ff0 <= @char_id && @char_id <= 0x2fff
+ end
+
+ def idc_argument_number
+ return 0 unless is_idc?
+ return 3 if @char_id == 0x2ff2 || @char_id == 0x2ff3
+ return 2
+ end
+
private
def get_feature(f)