<commit_before>module Reference
  def raw_xml(filename)
    data = File.new("test/reference/#{filename}.xml").read
    data.force_encoding('UTF-8') if data.respond_to?(:force_encoding)
  end
  
  def parsed_xml(filename)
    plist = CFPropertyList::List.new(:data => raw_xml(filename))
    CFPropertyList.native_types(plist.value)
  end
  
  def raw_binary(filename)
    data = File.new("test/reference/#{filename}.plist").read
    data.force_encoding('BINARY') if data.respond_to?(:force_encoding)
  end
  
  def parsed_binary(filename)
    plist = CFPropertyList::List.new(:data => raw_binary(filename))
    CFPropertyList.native_types(plist.value)
  end
end<commit_msg>Fix broken tests on Ruby 1.8.<commit_after>module Reference
  def raw_xml(filename)
    data = File.new("test/reference/#{filename}.xml").read
    data.force_encoding('UTF-8') if data.respond_to?(:force_encoding)
    data
  end
  
  def parsed_xml(filename)
    plist = CFPropertyList::List.new(:data => raw_xml(filename))
    CFPropertyList.native_types(plist.value)
  end
  
  def raw_binary(filename)
    data = File.new("test/reference/#{filename}.plist").read
    data.force_encoding('BINARY') if data.respond_to?(:force_encoding)
    data
  end
  
  def parsed_binary(filename)
    plist = CFPropertyList::List.new(:data => raw_binary(filename))
    CFPropertyList.native_types(plist.value)
  end
end
{'fraction_non_alphanumeric': 0.12917271407837447, 'fraction_numerical': 0.002902757619738752, 'mean_word_length': 4.516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '2834966', 'n_tokens_mistral': 459, 'n_tokens_neox': 447, 'n_words': 72}