f=open('comments.txt','r')
text=f.read()
f.close()
text=text.decode('utf-8','ignore').encode("utf-8")
text=text.lower()
text = text.replace("n\a\r\n", "")
#text = text.replace("n't", "nt")
#text = text.replace("i'l", "il")
#text = text.replace("i'm", "im")
#text = text.replace("'s", "")
text = text.replace(".", " [dot] ")
text = text.replace("!", " [xcm] ")
text = text.replace("?", " [q] ")
text = text.replace(",", " [comma] ")
text = text.replace("$", " [dlr] ")
text = text.replace(":", " [cln] ")
text = text.replace(";", " [scln] ")
text = text.replace("%", " [pcnt] ")
text = text.replace("-", " [dash] ")
text = text.replace("(", " [oparen] ")
text = text.replace(")", " [cparen] ")
text = text.replace("/", " [fslash] ")
text = text.replace(">", " [arw] ")
text = text.replace("\"", " [dqte] ")
text = text.replace("\'", " [sqte] ")
#text = text.replace("370z", " z ")
#text = text.replace("1", " one ")
#text = text.replace("2", " two ")
#text = text.replace("3", " three ")
#text = text.replace("4", " four ")
#text = text.replace("5", " five ")
#text = text.replace("6", " six ")
#text = text.replace("7", " seven ")
#text = text.replace("8", " eight ")
#text = text.replace("9", " nine ")
#text = text.replace("0", " zero ")
text = text.replace("   ", " ")
text = text.replace("  ", " ")
g=open("p_comments.txt",'w')
g.write(text)
g.close()
