Module: TsVectorTags::Standardizer
- Defined in:
- lib/ts_vector_tags.rb
Class Method Summary collapse
Class Method Details
.normalize(tag) ⇒ Object
16 17 18 |
# File 'lib/ts_vector_tags.rb', line 16 def normalize(tag) tag.downcase.gsub(/[^[:alnum:]_]/, "") end |
.tagify(tags) ⇒ Object
11 12 13 14 |
# File 'lib/ts_vector_tags.rb', line 11 def tagify() = .split(/\s*,\s*/) if .is_a?(String) .map{ |tag| self.normalize(tag) }.reject(&:empty?) end |