Sha256: d113256db49499020b7c664deed61afcb21490418e0ae8cbb3f9d753efda1fe2
Contents?: true
Size: 656 Bytes
Versions: 5
Compression:
Stored size: 656 Bytes
Contents
module Amakanize module Filters class TrailingDashDeletionFilter < 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
5 entries across 5 versions & 1 rubygems