<commit_before>require File.expand_path('../../lib/acts-as-taggable-on', __FILE__)
Bundler.require :test

module Rspec::Core::ExampleGroupSubject
  alias :context :describe
end

class Array
  def freq
    k=Hash.new(0)
    each {|e| k[e]+=1}
    k
  end
end

TEST_DATABASE_FILE = File.join(File.dirname(__FILE__), '..', 'test.sqlite3')

File.unlink(TEST_DATABASE_FILE) if File.exist?(TEST_DATABASE_FILE)
ActiveRecord::Base.establish_connection(
  "adapter" => "sqlite3", "database" => TEST_DATABASE_FILE
)

Rails.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))

ActiveRecord::Base.silence do
  ActiveRecord::Migration.verbose = false
  load(File.dirname(__FILE__) + '/schema.rb')
end

$: << File.join(File.dirname(__FILE__), '..', 'lib')
require File.join(File.dirname(__FILE__), '..', 'init')<commit_msg>Don't require init.rb file in tests anymore.<commit_after>require File.expand_path('../../lib/acts-as-taggable-on', __FILE__)
Bundler.require :test

module Rspec::Core::ExampleGroupSubject
  alias :context :describe
end

class Array
  def freq
    k=Hash.new(0)
    each {|e| k[e]+=1}
    k
  end
end

TEST_DATABASE_FILE = File.join(File.dirname(__FILE__), '..', 'test.sqlite3')

File.unlink(TEST_DATABASE_FILE) if File.exist?(TEST_DATABASE_FILE)
ActiveRecord::Base.establish_connection(
  "adapter" => "sqlite3", "database" => TEST_DATABASE_FILE
)

Rails.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))

ActiveRecord::Base.silence do
  ActiveRecord::Migration.verbose = false
  load(File.dirname(__FILE__) + '/schema.rb')
end

$: << File.join(File.dirname(__FILE__), '..', 'lib')
{'fraction_non_alphanumeric': 0.168, 'fraction_numerical': 0.004923076923076923, 'mean_word_length': 5.277992277992278, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6301688', 'n_tokens_mistral': 592, 'n_tokens_neox': 590, 'n_words': 98}