<commit_before>module Pidgin
  class Schema
    include Singleton

    def initialize
      @schema = load_schema
      @router = Router.new(@schema)
    end

    def load_schema
      json_data = JSON.parse(File.read(Pidgin::Config.schema_path))
      schema = JsonSchema.parse!(json_data)
      schema.expand_references!
      schema
    end

    def definitions
      @schema.definitions
    end

    def get_link method, href
      Link.new(@router.find_by(method: method, href: href))
    end
  end
end
<commit_msg>:+1: enable to resolve reference<commit_after>module Pidgin
  class Schema
    include Singleton

    def initialize
      @schema = load_schema
      @router = Router.new(@schema)
      @evaluator = JsonPointer::Evaluator.new(@schema)
    end

    def load_schema
      json_data = JSON.parse(File.read(Pidgin::Config.schema_path))
      schema = JsonSchema.parse!(json_data)
      schema.expand_references!
      schema
    end

    def definitions
      @schema.definitions
    end

    def resolve_path(path)
      @evaluator.evaluate(path)
    end

    def get_link method, href
      Link.new(@router.find_by(method: method, href: href))
    end
  end
end

{'fraction_non_alphanumeric': 0.08375634517766498, 'fraction_numerical': 0.0008460236886632825, 'mean_word_length': 2.70846394984326, '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': '5256913', 'n_tokens_mistral': 372, 'n_tokens_neox': 363, 'n_words': 84}