Sha256: ed85f424449260843716904e5e1bf5f776f5e4c8ab786ceba98adfcece03c9a0

Contents?: true

Size: 465 Bytes

Versions: 6

Compression:

Stored size: 465 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class ContinuousSpacesNormalizationFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @param output [String] e.g. `"ウメハラ  FIGHTING GAMERS!"`
      # @return [Hash] e.g. `"ウメハラ FIGHTING GAMERS!"`
      def call(context:, output:)
        {
          context: context,
          output: output.gsub(/\s+/, " "),
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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