Sha256: 2f825a5e34ac8af790bc4cb52b5d80dbdae9f3712f3bde0a97ecc7380f1fdf58

Contents?: true

Size: 486 Bytes

Versions: 6

Compression:

Stored size: 486 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class HyphenMinusNormalizationFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @note Replace U+2010 (hyphen) with U+002D (hyphen/minus)
      # @param output [String] e.g. `"D.Gray‐man"`
      # @return [Hash] e.g. `"D.Gray-man"`
      def call(context:, output:)
        {
          context: context,
          output: output.tr("‐", "-"),
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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