<commit_before>module OoxmlParser
  class Parser
    # Base method to parse document of any type
    # @param path_to_file [String] file
    # @return [CommonDocumentStructure] structure of doc
    def self.parse(path_to_file)
      return nil if OOXMLDocumentObject.encrypted_file?(path_to_file)
      path_to_zip_file = OOXMLDocumentObject.copy_file_and_rename_to_zip(path_to_file)
      OOXMLDocumentObject.unzip_file(path_to_zip_file, path_to_zip_file.sub(File.basename(path_to_zip_file), ''))
      OOXMLDocumentObject.path_to_folder = path_to_zip_file.sub(File.basename(path_to_zip_file), '')
      model = yield
      model.file_path = path_to_file
      FileUtils.remove_dir(OOXMLDocumentObject.path_to_folder)
      model
    end
  end
end<commit_msg>Remove duplicate calls of path_to_folder<commit_after>module OoxmlParser
  class Parser
    # Base method to parse document of any type
    # @param path_to_file [String] file
    # @return [CommonDocumentStructure] structure of doc
    def self.parse(path_to_file)
      return nil if OOXMLDocumentObject.encrypted_file?(path_to_file)
      path_to_zip_file = OOXMLDocumentObject.copy_file_and_rename_to_zip(path_to_file)
      OOXMLDocumentObject.path_to_folder = path_to_zip_file.sub(File.basename(path_to_zip_file), '')
      OOXMLDocumentObject.unzip_file(path_to_zip_file, OOXMLDocumentObject.path_to_folder)
      model = yield
      model.file_path = path_to_file
      FileUtils.remove_dir(OOXMLDocumentObject.path_to_folder)
      model
    end
  end
end
{'fraction_non_alphanumeric': 0.06561679790026247, 'fraction_numerical': 0.0, 'mean_word_length': 4.627306273062731, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5550716', 'n_tokens_mistral': 512, 'n_tokens_neox': 511, 'n_words': 87}