<commit_before>#!/usr/bin/env ruby

require_relative 'lib/hshtg'

# Check for .env file
if File.exist?('.env')
  File.open('.env', 'r').each_line do |line|
    a = line.chomp("\n").split('=', 2)
    a[1].gsub!(/^"|"$/, '') if ['\'', '"'].include?(a[1][0])
    eval "ENV['#{a[0]}']='#{a[1] || ''}'"
  end
end
<commit_msg>Bootstrap code for running from file<commit_after>#!/usr/bin/env ruby

require_relative 'lib/hshtg'

# Check for .env file
if File.exist?('.env')
  File.open('.env', 'r').each_line do |line|
    a = line.chomp("\n").split('=', 2)
    a[1].gsub!(/^"|"$/, '') if ['\'', '"'].include?(a[1][0])
    eval "ENV['#{a[0]}']='#{a[1] || ''}'"
  end
end


if __FILE__== $0
  if Hshtg::Configuration.is_valid?
    Hshtg::ServerBootstrapper.start
  else
    puts 'Please ensure all environment variables are set.'
  end
end

{'fraction_non_alphanumeric': 0.26353790613718414, 'fraction_numerical': 0.015643802647412757, 'mean_word_length': 3.781609195402299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '578217', 'n_tokens_mistral': 348, 'n_tokens_neox': 346, 'n_words': 70}