Sha256: c0f58967018dc8b3726db4bcf6ebc12f9f1c8d81ef0fc3cb4cc64211090d3f12
Contents?: true
Size: 379 Bytes
Versions: 19
Compression:
Stored size: 379 Bytes
Contents
module Krikri::Enrichments ## # Strip punctuation # # StripPunctuation.new.enrich_value("\tmo!ominpa)(pa \n .$%^ moominmama ") # # => "\tmoominpapa \n moominmama " class StripPunctuation include Krikri::FieldEnrichment def enrich_value(value) return value unless value.is_a? String value.gsub(/[^\p{Alnum}\'\"\s]/, '') end end end
Version data entries
19 entries across 19 versions & 1 rubygems