def load_gender_rules!(rules)
      [:lastname, :firstname, :middlename].each do |name_part|
        Petrovich::GENDERS.each do |section|
          entries = rules['gender'][name_part.to_s]['suffixes'][section.to_s]
          Array(entries).each do |entry|
            load_gender_entry(name_part, section, entry)
          end

          exceptions = rules['gender'][name_part.to_s]['exceptions']
          @gender_exceptions[name_part] ||= {}
          next if exceptions.nil?
          Array(exceptions[section.to_s]).each do |exception|
            @gender_exceptions[name_part][exception] = Gender::Rule.new(as: name_part, gender: section, suffix: exception)
          end
        end
      end
      @gender_rules.each do |_, gender_rules|
        gender_rules.sort_by!{ |rule| -rule.accuracy }
      end
    end
def load_gender_rules!(rules)
      [:lastname, :firstname, :middlename].each do |name_part|
        Petrovich::GENDERS.each do |section|
          entries = rules['gender'][name_part.to_s]['suffixes'][section.to_s]
          Array(entries).each do |entry|
            load_gender_entry(name_part, section, entry)
          end

          exceptions = rules['gender'][name_part.to_s]['exceptions']
          @gender_exceptions[name_part] ||= {}
          next if exceptions.nil?
          Array(exceptions[section.to_s]).each do |exception|
            @gender_exceptions[name_part][exception] = Gender::Rule.new(as: name_part, gender: section, suffix: exception)
          end
        end
      end
      @gender_rules.each do |_, gender_rules|
        gender_rules.sort_by!{ |rule| -rule.accuracy }
      end
    end
Load rules for genders