M
Muralidharan Regupathy
I am trying to create a routine which will convert text to SMS lingo
format. For example a sentence might contain "This should be done as
soon as possible". I have created a HASH which stores "ASAP" => "as soon
as possible".
My routine should parse the message and subsitute with "ASAP" and return
a string "This should be done ASAP".
def SMSdeflater(message)
@smsdictionary.each_pair do
|key, value|
tmpvalue = value.chomp.downcase
msg=message.chomp.downcase
puts "looking for <#{tmpvalue}> in <#{msg}>"
newmsg=msg.gsub(tmpvalue,key)
puts newmsg
end
the above mentioned code is not working, any help is appreciated
thanks,
murali
format. For example a sentence might contain "This should be done as
soon as possible". I have created a HASH which stores "ASAP" => "as soon
as possible".
My routine should parse the message and subsitute with "ASAP" and return
a string "This should be done ASAP".
def SMSdeflater(message)
@smsdictionary.each_pair do
|key, value|
tmpvalue = value.chomp.downcase
msg=message.chomp.downcase
puts "looking for <#{tmpvalue}> in <#{msg}>"
newmsg=msg.gsub(tmpvalue,key)
puts newmsg
end
the above mentioned code is not working, any help is appreciated
thanks,
murali