Sha256: 6b6a5955b2f8ababd176d5f9222238fe7ac9b650ea7e4c986fab765a9c1f8f17

Contents?: true

Size: 452 Bytes

Versions: 9

Compression:

Stored size: 452 Bytes

Contents

module Amakanize
  module Filters
    class TrailingVolumeNumberDeletionFilter < BaseFilter
      # @note Override
      # @param string [String] e.g. `"やはり俺の青春ラブコメはまちがっている。4"`
      # @return [String] e.g. `"やはり俺の青春ラブコメはまちがっている。"`
      def call(string)
        string.gsub(/\s*第?[\diIvVxX1-9①②③④⑤⑥⑦⑧⑨⑩]+巻?\z/, "")
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
amakanize-0.1.9 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.8 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.7 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.6 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.5 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.4 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.3 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.2 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb
amakanize-0.1.1 lib/amakanize/filters/trailing_volume_number_deletion_filter.rb