Method: Ariel::ExampleDocumentLoader.load_directory

Defined in:
lib/ariel/example_document_loader.rb

.load_directory(dir, structure) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ariel/example_document_loader.rb', line 45

def self.load_directory(dir, structure)
  loaded_example_hash = Hash.new {|h, k| h[k]=[]}
  Dir.glob("#{dir}/*") do |doc|
    next if doc=~ /structure\.rb\z/
    File.open(doc) do |file|
      self.load_labeled_example(file, structure, loaded_example_hash)
    end
  end
  self.supervise_learning structure, loaded_example_hash
  return structure
end