class StringUtil

String-related helper functions

Public Class Methods

tts_file_name(text, target, service) click to toggle source
# File lib/string_util.rb, line 6
def self.tts_file_name(text, target, service)
  hash = StringUtil.tts_hash(text, target, service)
  "#{Application.app_dir}/pronunciations/#{hash}.mp3"
end
tts_hash(text, target, service) click to toggle source
# File lib/string_util.rb, line 11
def self.tts_hash(text, target, service)
  Digest::SHA1.hexdigest("#{text}_#{target}_#{service}")
end