Sha256: c355ef9848f02e85f0f1b1e38ad25fd64cca77a21a287da751e8d5421ebcff5d

Contents?: true

Size: 368 Bytes

Versions: 5

Compression:

Stored size: 368 Bytes

Contents

module Amakanize
  module Filters
    class ParenthesesDeletionFilter < 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

5 entries across 5 versions & 1 rubygems

Version Path
amakanize-0.6.0 lib/amakanize/filters/parentheses_deletion_filter.rb
amakanize-0.5.3 lib/amakanize/filters/parentheses_deletion_filter.rb
amakanize-0.5.2 lib/amakanize/filters/parentheses_deletion_filter.rb
amakanize-0.5.1 lib/amakanize/filters/parentheses_deletion_filter.rb
amakanize-0.5.0 lib/amakanize/filters/parentheses_deletion_filter.rb