def appender(idx, key, mode)
      case mode
      when :prefix
        ->(pos, record) { append_prefixes(idx, pos, record[key]) }
      when :infix
        ->(pos, record) { append_infixes(idx, pos, record[key]) }
      when :word
        ->(pos, record) { append_words(idx, pos, record[key]) }
      when :word_prefix
        ->(pos, record) { append_word_prefixes(idx, pos, record[key]) }
      else
        ->(pos, record) { append_match(idx, pos, record[key]) }
      end
    end
def appender(idx, key, mode)
      case mode
      when :prefix
        ->(pos, record) { append_prefixes(idx, pos, record[key]) }
      when :infix
        ->(pos, record) { append_infixes(idx, pos, record[key]) }
      when :word
        ->(pos, record) { append_words(idx, pos, record[key]) }
      when :word_prefix
        ->(pos, record) { append_word_prefixes(idx, pos, record[key]) }
      else
        ->(pos, record) { append_match(idx, pos, record[key]) }
      end
    end
TODO: create an appender registry
 rubocop:disable Metrics/AbcSize
 rubocop:disable Metrics/MethodLength