###Having trouble passing through words not in the dictionary. Can anyone help?
dictionary = \
[['r', 'are'],
['txt', 'text'],
['k', 'okay'],
['2moro', 'tomorrow'],
['4', 'for'],
['b', 'be'],
['ne', 'any'],
['nite', 'night'],
['b4', 'before']] #Plus lots more words in the compete dictionary
import string
import re
item = """c u r 2 wk y hello evry1 sed pix r gd""" #the word hello doesn't make it through because it's not in the dictionary but I need it to come through.
##Convert sms to english starts here...
def sms_to_english(item):
sms=[]
item_split = item.split()
for word in item_split:
for j in range(len(dictionary)):
if word == dictionary[j][0]:
sms.append(dictionary[j][1])
return " ".join(sms)