<commit_before>#!/usr/bin/ruby
require 'json'

class Emoji_Commit

  attr_accessor :msg_file

  def initialize(file)
    @msg_file = file
  end

  def emoji_exists?(message)
    message.match(/^:(-|e-\w+)?(\w+):/) ? true : false
  end

  def get_emoji
    emojis_file = File.read("#{File.dirname(__FILE__)}/emojis.json")
    emojis_hash = JSON.parse(emojis_file)
    emojis_hash[emojis_hash.keys.sample].strip
  end

  def edit_commit_msg
    commit_msg = File.read(@msg_file)
    unless emoji_exists?(commit_msg)
      File.write(@msg_file, "#{get_emoji} #{commit_msg}")
    end
  end

end<commit_msg>:zero: pwd hack<commit_after>#!/usr/bin/ruby
require 'json'

class Emoji_Commit

  attr_accessor :msg_file

  def initialize(file)
    @msg_file = file
  end

  def emoji_exists?(message)
    message.match(/^:(-|e-\w+)?(\w+):/) ? true : false
  end

  def get_emoji
    emojis_file = File.read("#{Dir.pwd}/.git/hooks/emojis.json")
    emojis_hash = JSON.parse(emojis_file)
    emojis_hash[emojis_hash.keys.sample].strip
  end

  def edit_commit_msg
    commit_msg = File.read(@msg_file)
    unless emoji_exists?(commit_msg)
      File.write(@msg_file, "#{get_emoji} #{commit_msg}")
    end
  end

end
{'fraction_non_alphanumeric': 0.14226289517470883, 'fraction_numerical': 0.0, 'mean_word_length': 3.6627906976744184, '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': '6475891', 'n_tokens_mistral': 483, 'n_tokens_neox': 483, 'n_words': 77}