Method: Dat::Dict#initialize

Defined in:
lib/dat/dict.rb

#initialize(opt = {}) ⇒ Dict

Returns a new instance of Dict.



6
7
8
9
10
11
12
13
# File 'lib/dat/dict.rb', line 6

def initialize(opt={})
  @dict = {} # The internal hash which maps string words to Dat::Word objects
  file = opt[:file] || File.open(File.expand_path("../../../data/dict", __FILE__))
  bogus = opt[:bogus] || File.open(File.expand_path("../../../data/bogus", __FILE__))

  import file
  remove bogus
end