<div>You need a deterministic algorithm for conversion.  It&#39;s impossible (without analyzing the context of the word) to translate &quot;|_|#&quot; (it&#39;s either &quot;lf&quot; or &quot;uh&quot;, 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">&lt;<a href="mailto:ctcast@gmail.com">ctcast@gmail.com</a>&gt;</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&#39;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(&quot;encrypted.txt&quot;, &quot;r&quot;).read()<br><br>def eng2leet(astring):    <br>    astring = astring.replace(&quot;4&quot;,&quot;a&quot;)<br>
    astring = astring.replace(&quot;8&quot;,&quot;b&quot;)<br>    astring = astring.replace(&quot;[&quot;,&quot;c&quot;)<br>    astring = astring.replace(&quot;|)&quot;,&quot;d&quot;)<br>    astring = astring.replace(&quot;3&quot;,&quot;e&quot;)<br>
    astring = astring.replace(&quot;|#&quot;,&quot;f&quot;)<br>    astring = astring.replace(&quot;6&quot;,&quot;g&quot;)<br>    astring = astring.replace(&quot;#&quot;,&quot;h&quot;)<br>    astring = astring.replace(&quot;1&quot;,&quot;i&quot;)<br>
    astring = astring.replace(&quot;]&quot;,&quot;j&quot;)<br>    astring = astring.replace(&quot;|\\&quot;,&quot;k&quot;)<br>    astring = astring.replace(&quot;|_&quot;,&quot;l&quot;)<br>    astring = astring.replace(&quot;|-|&quot;,&quot;m&quot;)<br>
    astring = astring.replace(&quot;|\\&quot;,&quot;n&quot;)<br>    astring = astring.replace(&quot;0&quot;,&quot;o&quot;)<br>    astring = astring.replace(&quot;|*&quot;,&quot;p&quot;)<br>    astring = astring.replace(&quot;0\\&quot;,&quot;q&quot;)<br>
    astring = astring.replace(&quot;2&quot;,&quot;r&quot;)<br>    astring = astring.replace(&quot;5&quot;,&quot;s&quot;)<br>    astring = astring.replace(&quot;+&quot;,&quot;t&quot;)<br>    astring = astring.replace(&quot;|_|&quot;,&quot;u&quot;)<br>
    astring = astring.replace(&quot;\/&quot;,&quot;v&quot;)<br>    astring = astring.replace(&quot;\/\/&quot;,&quot;w&quot;)<br>    astring = astring.replace(&quot;&gt;&lt;&quot;,&quot;x&quot;)<br>    astring = astring.replace(&quot;7&quot;,&quot;y&quot;)<br>
    astring = astring.replace(&quot;7_&quot;,&quot;z&quot;)<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&#39;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>