Sha256: ba2ab869a9f3e5cdbf1ac99dd84ca9c1b38fd6ea7d1feb8056bb72287619ead5
Contents?: true
Size: 719 Bytes
Versions: 6
Compression:
Stored size: 719 Bytes
Contents
require "amakanize/filters/base_filter" module Amakanize module Filters class TrailingDashDeletionFilter < ::Amakanize::Filters::BaseFilter TOKENS = %w( ̃ ̰ ̴ ‒ – — ― ⁓ 〜 〰 ˜ ˷ ~ ~ ∼ ─ ) # @note Override # @param output [String] e.g. `"アド・アストラ 1 ─スキピオとハンニバル─"` # @return [Hash] e.g. `"アド・アストラ 1"` def call(context:, output:) { context: context, output: output.gsub(/\s*#{::Regexp.union(TOKENS)}.*/, ""), } end end end end
Version data entries
6 entries across 6 versions & 1 rubygems