<commit_before># Wooter an html report :) --matt

# get info from my hacky comparison tools
info = eval `ruby -W0 #{File.dirname(__FILE__) + '/compare_info.rb'}`
info.each do |key, value|
  self.class.send(:define_method, key) { value }
end

# helpers (probably need to make this whole thing way less messy)
require 'cgi'
def h(html)
  CGI.escapeHTML(html)
end

def percent_bar(pct)
  width = (pct * 200).round
  rest = 200 - width
  percent = ((pct * 100.0).round).to_s + '%'
  <<HTML
<table style="height: 25px; width: 200px" cellpadding="0" cellspacing="0">
  <tr>
    <td style="width: #{width}px; text-align: right; color: #000000; background: #00f000">
      #{pct >= 0.5 ? percent + '&nbsp;&nbsp;' : ''}</td>
    <td style="width: #{width}px; text-align: left; color: #ffffff; background: #e00000"><commit_msg>Bars are slightly more realistic :-)<commit_after># Wooter an html report :) --matt

# get info from my hacky comparison tools
info = eval `ruby -W0 #{File.dirname(__FILE__) + '/compare_info.rb'}`
info.each do |key, value|
  self.class.send(:define_method, key) { value }
end

# helpers (probably need to make this whole thing way less messy)
require 'cgi'
def h(html)
  CGI.escapeHTML(html)
end

def percent_bar(pct)
  width = (pct * 200).round
  rest = 200 - width
  percent = ((pct * 100.0).round).to_s + '%'
  <<HTML
<table style="height: 25px; width: 200px" cellpadding="0" cellspacing="0">
  <tr>
    <td style="width: #{width}px; text-align: right; color: #000000; background: #00f000">
      #{pct >= 0.5 ? percent + '&nbsp;&nbsp;' : ''}</td>
    <td style="width: #{rest}px; text-align: left; color: #ffffff; background: #e00000">
{'fraction_non_alphanumeric': 0.17330917874396135, 'fraction_numerical': 0.043478260869565216, 'mean_word_length': 4.2271293375394325, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '7629855', 'n_tokens_mistral': 655, 'n_tokens_neox': 589, 'n_words': 178}