<commit_before>require 'active_support/inflector'
require 'yaml'
require 'mp3info'

# Utility module with shared functions across the project.
module Helper
	CONFIG_FILE = "config.yaml"

	# Return the path to the config file
	def master_config
		@master_config ||= YAML.load_file(CONFIG_FILE)
	end

	# Search and require the jar files required by the underlying music player.
	#
	# @return [List<String>] A list with the names of the required jar files.
	def require_jars
		jars_path = "#{project_path}/jars"
		Dir.entries(jars_path).select{|jar| 
			require "#{jars_path}/#{jar}" if jar =~ /.jar\Z/
		}
	end

	# Extract the ID3 tag information from a mp3 file.
	#
	# @param file_path [String] The full path to a mp3 file.
	# @return [Hash] With the keys: :name, :artist, :album, :track, :duration, :year and :genre. nil if something is wrong.
	def extract_mp3_information(file_path)<commit_msg>Fixed problem with resources resolution<commit_after>require 'active_support/inflector'
require 'yaml'
require 'mp3info'

# Utility module with shared functions across the project.
module Helper
	CONFIG_FILE = "config.yaml"

	# Return the path to the config file
	def master_config
		@master_config ||= YAML.load_file(File.join(project_path, CONFIG_FILE))
	end

	# Search and require the jar files required by the underlying music player.
	#
	# @return [List<String>] A list with the names of the required jar files.
	def require_jars
		jars_path = "#{project_path}/jars"
		Dir.entries(jars_path).select{|jar| 
			require "#{jars_path}/#{jar}" if jar =~ /.jar\Z/
		}
	end

	# Extract the ID3 tag information from a mp3 file.
	#
	# @param file_path [String] The full path to a mp3 file.
	# @return [Hash] With the keys: :name, :artist, :album, :track, :duration, :year and :genre. nil if something is wrong.
	def extract_mp3_information(file_path)
{'fraction_non_alphanumeric': 0.10320478001086367, 'fraction_numerical': 0.005431830526887561, 'mean_word_length': 4.465875370919881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3475061', 'n_tokens_mistral': 631, 'n_tokens_neox': 605, 'n_words': 212}