<commit_before>module GovukContentSchemaTestHelpers
  class Examples
    def initialize
      Util.check_govuk_content_schemas_path!
    end

    def get(schema_name, example_name)
      path = example_path(schema_name, example_name)
      check_example_file_exists!(path)
      File.read(path)
    end

    def check_example_file_exists!(path)
      if !File.exists?(path)
        raise ImproperlyConfiguredError, "Example file not found: #{path}."
      end
    end

  private
    def example_path(schema_name, example_name)
      schema_type = GovukContentSchemaTestHelpers.configuration.schema_type
      File.join(Util.govuk_content_schemas_path, "/formats/#{schema_name}/#{schema_type}/examples/#{example_name}.json").to_s
    end
  end
end<commit_msg>Change variable name for clarity<commit_after>module GovukContentSchemaTestHelpers
  class Examples
    def initialize
      Util.check_govuk_content_schemas_path!
    end

    def get(format, example_name)
      path = example_path(format, example_name)
      check_example_file_exists!(path)
      File.read(path)
    end

    def check_example_file_exists!(path)
      if !File.exists?(path)
        raise ImproperlyConfiguredError, "Example file not found: #{path}."
      end
    end

  private
    def example_path(format, example_name)
      schema_type = GovukContentSchemaTestHelpers.configuration.schema_type
      File.join(Util.govuk_content_schemas_path, "/formats/#{format}/#{schema_type}/examples/#{example_name}.json").to_s
    end
  end
end
{'fraction_non_alphanumeric': 0.08316831683168317, 'fraction_numerical': 0.0, 'mean_word_length': 3.8434504792332267, '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': '2134486', 'n_tokens_mistral': 471, 'n_tokens_neox': 462, 'n_words': 85}