<commit_before>require "score/version"

module Score
  # Your code goes here...
end<commit_msg>Rough score implementation<commit_after>require 'json'
require 'open-uri'

module Score

  class Score
    attr_reader :score

    def initialize(url="https://github.com/databyte.json")
      json = JSON.load(open(url))
      @score = json.reduce(0) { |sum, j| sum + score_map.fetch(j["type"], 1) }
    end

    def to_s
      score.to_s
    end

    def score_map
      {
        "PushEvent" => 5,
        "PullRequestReviewCommentEvent" => 4,
        "WatchEvent" => 3,
        "CreateEvent" => 2,
      }
    end

  end
end
{'fraction_non_alphanumeric': 0.12560386473429952, 'fraction_numerical': 0.00966183574879227, 'mean_word_length': 2.49438202247191, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '7503961', 'n_tokens_mistral': 218, 'n_tokens_neox': 206, 'n_words': 49}