module Votd::Helper::Text
This module contains helper methods that support the VotD text parsing.
Public Instance Methods
clean_verse_end(text)
click to toggle source
Appends '…' if verse ends abruptly @param [String] text the text to process @return [String]
# File lib/votd/helper/text.rb, line 24 def clean_verse_end(text) case text when /[a-zA-Z]$/ # no ending "." text << '...' when /[,;]$/ text.sub!(/[,;]$/, '...') # ends with "," or ";" else text end text end
clean_verse_start(text)
click to toggle source
Prepends '…' if first letter is not a capital letter @param [String] text the text to process @return [String]
# File lib/votd/helper/text.rb, line 17 def clean_verse_start(text) text.sub(/^([a-z])/, '...\1') end