Sha256: 34cbf2a3804d2ae32846657515904d820e725090b19ce98dd781b6c8eac1da60

Contents?: true

Size: 521 Bytes

Versions: 5

Compression:

Stored size: 521 Bytes

Contents

require "active_support"
require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class NormalizationFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @param output [String] e.g. `"ぽんかん(8)"`, `"ぽんかん⑧"`
      # @return [Hash] e.g. `"ぽんかん(8)"`, `"ぽんかん8"`
      def call(context:, output:)
        {
          context: context,
          output: ::ActiveSupport::Multibyte::Unicode.normalize(output),
        }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
amakanize-0.6.5 lib/amakanize/filters/normalization_filter.rb
amakanize-0.6.4 lib/amakanize/filters/normalization_filter.rb
amakanize-0.6.3 lib/amakanize/filters/normalization_filter.rb
amakanize-0.6.2 lib/amakanize/filters/normalization_filter.rb
amakanize-0.6.1 lib/amakanize/filters/normalization_filter.rb