Method: StringChinese#initialize

Defined in:
lib/a-b-chi.rb

#initializeStringChinese

Returns a new instance of StringChinese.



38
39
40
41
42
43
44
# File 'lib/a-b-chi.rb', line 38

def initialize
  spec = Gem::Specification.find_by_name("a-b-chi")
  gem_root = spec.gem_dir
  @gem_lib = gem_root + "/lib"
  @characters = File.read("#{@gem_lib}/characters.txt").split("\n")
  @bpmf = File.read("#{@gem_lib}/bopomofo.txt").split("\n")
end