Sha256: 71d0d0c079b804cfbb5d0a1d33ec796ccd6bb2423363493a21e5eddbd60ffc09

Contents?: true

Size: 443 Bytes

Versions: 4

Compression:

Stored size: 443 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class DashBetweenAlhabetsNormalizationFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @param output [String] e.g. `"D.Grayーman"`
      # @return [Hash] e.g. `"D.Gray-man"`
      def call(context:, output:)
        {
          context: context,
          output: output.gsub(/(\w)ー(\w)/, '\1-\2'),
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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