<commit_before>module Helpers
  # @param file_path [String]
  # @returns [RDF::Graph]
  #
  def load_file(file_path)
    RDF::Graph.load(file_path, format: :ttl)
  end
end<commit_msg>Load fixture helper method<commit_after>module Helpers
  # Loads fixture from `file_name` in /spec/fixtures directory
  #
  # @param file_name [String]
  # @returns [RDF::Graph, String] `RDF::Graph` for Turtle input, `String` for other file formats
  # @raise [ArgumentError]        Error for non-existent `file_name`
  #
  def load_fixture(file_name)
    file_path = File.join(Rails.root, "spec", "fixtures", file_name)
    raise ArgumentError, "File #{file_path} doesn't exist" unless File.exist? file_path

    if File.extname(file_path) == ".ttl"
      RDF::Graph.load(file_path, format: :ttl)
    else
      File.read file_path
    end
  end
end
{'fraction_non_alphanumeric': 0.11884753901560624, 'fraction_numerical': 0.0, 'mean_word_length': 4.024096385542169, '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': '2706335', 'n_tokens_mistral': 295, 'n_tokens_neox': 290, 'n_words': 74}