<commit_before>require 'json'
require 'json-schema'

class CommandError < StandardError
end

class CommandParser

    SCHEMA_FILE = "./lib/json_schemas/command.json"

    def initialize
        @handlers = Hash.new

        # Read schema
        @schema = File.read(SCHEMA_FILE)
    end

    def registerHandler commandkey, handler
        @handlers[commandkey.downcase] = handler
    end

    def parse json_string
        # Parse and validate json info
        parsed_json = JSON.parse(json_string)
        warnings = JSON::Validator.fully_validate(@schema, parsed_json)
        raise CommandError.new warnings unless warnings.empty?
<commit_msg>Remove some unneeded comments<commit_after>require 'json'
require 'json-schema'

class CommandError < StandardError
end

class CommandParser

    SCHEMA_FILE = "./lib/json_schemas/command.json"

    def initialize
        @handlers = Hash.new
        @schema = File.read(SCHEMA_FILE)
    end

    def registerHandler commandkey, handler
        @handlers[commandkey.downcase] = handler
    end

    def parse json_string
        # Parse and validate json info
        parsed_json = JSON.parse(json_string)
        warnings = JSON::Validator.fully_validate(@schema, parsed_json)
        raise CommandError.new warnings unless warnings.empty?

{'fraction_non_alphanumeric': 0.07370054305663305, 'fraction_numerical': 0.0, 'mean_word_length': 3.056603773584906, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6846337', 'n_tokens_mistral': 364, 'n_tokens_neox': 355, 'n_words': 93}