<div>You need a deterministic algorithm for conversion. It's impossible (without analyzing the context of the word) to translate "|_|#" (it's either "lf" or "uh", but which?).</div>
<div> </div>
<div><br><br> </div>
<div class="gmail_quote">On Mon, Jul 27, 2009 at 1:13 PM, Chris Castillo <span dir="ltr"><<a href="mailto:ctcast@gmail.com">ctcast@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">so I have a string:<br><br>1 4|-| 50 |_33+. I love [#ick3n 4nd ch3353. Don't you love +|_|2|\e7 \/\/1+# the |#a|-|i|_7?<br>
<br><br>and I am trying to turn it into english with the following code:<br><br>fileIn = open("encrypted.txt", "r").read()<br><br>def eng2leet(astring): <br> astring = astring.replace("4","a")<br>
astring = astring.replace("8","b")<br> astring = astring.replace("[","c")<br> astring = astring.replace("|)","d")<br> astring = astring.replace("3","e")<br>
astring = astring.replace("|#","f")<br> astring = astring.replace("6","g")<br> astring = astring.replace("#","h")<br> astring = astring.replace("1","i")<br>
astring = astring.replace("]","j")<br> astring = astring.replace("|\\","k")<br> astring = astring.replace("|_","l")<br> astring = astring.replace("|-|","m")<br>
astring = astring.replace("|\\","n")<br> astring = astring.replace("0","o")<br> astring = astring.replace("|*","p")<br> astring = astring.replace("0\\","q")<br>
astring = astring.replace("2","r")<br> astring = astring.replace("5","s")<br> astring = astring.replace("+","t")<br> astring = astring.replace("|_|","u")<br>
astring = astring.replace("\/","v")<br> astring = astring.replace("\/\/","w")<br> astring = astring.replace("><","x")<br> astring = astring.replace("7","y")<br>
astring = astring.replace("7_","z")<br> return astring<br> <br>print eng2leet(fileIn)<br><br>Only problem is that when it needs to translate a U or a W it prints an L or 2 V's. Need some help please. Thanks<br>
<br>_______________________________________________<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br><br clear="all">
<div></div><br>-- <br>Computers are like air conditioners...<br>They quit working when you open Windows.<br>