Sha256: 1eea80c86dd76c4f49e7805648173b531c9c6c5f20ebf3d7c57a2fc76dbc7051

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class ParenthesesDeletionFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @param output [String] e.g. `"ぽんかん(8)"`
      # @return [Hash] e.g. `"ぽんかん8"`
      def call(context:, output:)
        {
          context: context,
          output: output.gsub(/\((\d+)\)/, '\1'),
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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