<commit_before>#!/bin/ruby

require 'json'
require 'pry'

def encode(buf)
  get_block_start = JSON.parse(File.read('./get-block-start.json'))
  strs = []
  i = 0
  while i < buf.length
    b1 = buf[i]
    b2 = if i + 1 < buf.length then buf[i+1] else -1 end
    codepoint = get_block_start[b2.to_s] + b1
    str = [codepoint].pack('U*')
    strs << str
    i += 2
  end<commit_msg>ruby can be anywhere, removed unused require<commit_after>#!/usr/bin/env ruby

require 'json'

def encode(buf)
  get_block_start = JSON.parse(File.read('./get-block-start.json'))
  strs = []
  i = 0
  while i < buf.length
    b1 = buf[i]
    b2 = if i + 1 < buf.length then buf[i+1] else -1 end
    codepoint = get_block_start[b2.to_s] + b1
    str = [codepoint].pack('U*')
    strs << str
    i += 2
  end
{'fraction_non_alphanumeric': 0.15756035578144853, 'fraction_numerical': 0.022871664548919948, 'mean_word_length': 2.8067632850241546, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1480791', 'n_tokens_mistral': 328, 'n_tokens_neox': 320, 'n_words': 78}