<commit_before># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'rexml/document'
require 'i18n'

##
# The Hatemile module contains the interfaces with the acessibility solutions.
module Hatemile
  ##
  # The Hatemile::Util module contains the utilities of library.
  module Util
    ##
    # The Configure class contains the configuration of HaTeMiLe.
    class Configure
      ##
      # Initializes a new object that contains the configuration of HaTeMiLe.
      #
      # @param files_name [Array<String>] The path of files.
      # @param locales [Array<Symbol>] The locales.
      def initialize(files_name = nil, locales = [:'en-US'])
        if files_name.nil?
          pattern = File.join(
            File.dirname(File.dirname(File.dirname(__FILE__))),
            'locale',
            '*.yml'
          )
          files_name = Dir.glob(pattern)
        end
        I18n.load_path = files_name
        @options = []
        locales.each do |locale|
          option = {}
          option[:locale] = locale
          option[:scope] = :hatemile
          @options.push(option)
        end
      end

      ##
      # Returns the parameters of configuration.
      #
      # @return [Hash] The parameters of configuration.
      def get_parameters
        symbol_parameters = {}
        @options.each do |option|
          option_root_scope = {}
          option_root_scope[:locale] = option[:locale]<commit_msg>:bug: Not replace configurations of others<commit_after># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'rexml/document'
require 'i18n'

##
# The Hatemile module contains the interfaces with the acessibility solutions.
module Hatemile
  ##
  # The Hatemile::Util module contains the utilities of library.
  module Util
    ##
    # The Configure class contains the configuration of HaTeMiLe.
    class Configure
      ##
      # Initializes a new object that contains the configuration of HaTeMiLe.
      #
      # @param files_name [Array<String>] The path of files.
      # @param locales [Array<Symbol>] The locales.
      def initialize(files_name = nil, locales = [:'en-US'])
        if files_name.nil?
          pattern = File.join(
            File.dirname(File.dirname(File.dirname(__FILE__))),
            'locale',
            '*.yml'
          )
          files_name = Dir.glob(pattern)
        end
        files_name.each do |filename|
          I18n.load_path.push(filename) unless I18n.load_path.include?(filename)
        end
        @options = []
        locales.each do |locale|
          option = {}
          option[:locale] = locale
          option[:scope] = :hatemile
          @options.push(option)
        end
      end

      ##
      # Returns the parameters of configuration.
      #
      # @return [Hash] The parameters of configuration.
      def get_parameters
        symbol_parameters = {}
        @options.each do |option|
          option_root_scope = {}
          option_root_scope[:locale] = option[:locale]
{'fraction_non_alphanumeric': 0.0866062437059416, 'fraction_numerical': 0.004531722054380665, 'mean_word_length': 2.534697508896797, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '99951', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1052, 'n_words': 381}