def extract_middle(name)
      return unless name && name.size >= 1

      (name.size - 1).downto(0) do |n|
        next unless name[n]

        if name[n] =~ Nameable::Latin::Patterns::LAST_NAME_PRE_DANGLERS
          @last = "#{name[n].downcase.capitalize} #{@last}"
        elsif name[n] =~ Nameable::Latin::Patterns::O_LAST_NAME_PRE_CONCATS
          @last = "O'#{@last}"
        elsif name[n] =~ /\-/ && n > 0 && name[n - 1]
          @last = "#{name[n - 1].delete('-')}-#{@last}"
          name[n - 1] = nil
        else
          @middle = @middle ? "#{name[n]} #{@middle}" : name[n]
        end

        name.delete_at(n)
      end

      @middle.capitalize! if @middle && !(@middle =~ /[a-z]/ && @middle =~ /[A-Z]/)
      @middle = "#{@middle}." if @middle && @middle.size == 1
    end
def extract_middle(name)
      return unless name && name.size >= 1

      (name.size - 1).downto(0) do |n|
        next unless name[n]

        if name[n] =~ Nameable::Latin::Patterns::LAST_NAME_PRE_DANGLERS
          @last = "#{name[n].downcase.capitalize} #{@last}"
        elsif name[n] =~ Nameable::Latin::Patterns::O_LAST_NAME_PRE_CONCATS
          @last = "O'#{@last}"
        elsif name[n] =~ /\-/ && n > 0 && name[n - 1]
          @last = "#{name[n - 1].delete('-')}-#{@last}"
          name[n - 1] = nil
        else
          @middle = @middle ? "#{name[n]} #{@middle}" : name[n]
        end

        name.delete_at(n)
      end

      @middle.capitalize! if @middle && !(@middle =~ /[a-z]/ && @middle =~ /[A-Z]/)
      @middle = "#{@middle}." if @middle && @middle.size == 1
    end
name is an Array