Python l33t Translator

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 2060 Views - Last Post: 28 October 2012 - 03:00 AM Rate Topic: -----

#16 cladus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 11-June 12

Re: Python l33t Translator

Posted 17 June 2012 - 04:58 AM

YAY. I've just posted the project on Google Code.
If you want to check it out please vist http://code.google.c...l33t-translator
Was This Post Helpful? 0
  • +
  • -

#17 cladus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 11-June 12

Re: Python l33t Translator

Posted 17 June 2012 - 05:42 AM

I have just created a new version of my module you can download it at the site or view it here it doesn't matter.
Here's the new version:
#Leet Translator
#This will translate
#Normal english into
#l33t.
#Credit to: baavgai
#Cladus - 15/06/2012
version = 4
def toLeet(text):
	leet = (
                (('are', 'Are'), 'r'),
                (('ate', 'Ate'), '8'),
                (('that', 'That'), 'tht'),
		(('you', 'You'), 'j00'),
		(('o', 'O'), '0'),
		(('i', 'I'), '1'),
		(('e', 'E'), '3'),
		(('s', 'S'), '5'),
		(('a', 'A'), '4'),
		(('t', 'T'), '7'),
		)
	for symbols, replaceStr in leet:
		for symbol in symbols:
			text = text.replace(symbol, replaceStr)
	return text
def toEnglish(leet):
	enga = {
		'0':'o',
		'1':'i',
		'3':'e',
		'5':'s',
		'4': 'a',
		't': '7',
                'r': 'are',
                '8': 'ate',
                'tht': 'that',
		'joo': 'you',
		}
	eng = (
		('0','o'),
		('1','i'),
		('3','e'),
		('5','s'),
		('4', 'a'),
		('7', 't'),
                (' r ', 'are'),
                ('8', 'ate'),
                ('tht', 'that'),
		('joo', 'you'),
		)
	for symbols, replaceStr in eng:
		leet = leet.replace(symbols, replaceStr)
	return leet


I added a new function called toEnglish(msg) witch will convert l33t to english!!!
Tell me what you think and if there are any bugs!
Was This Post Helpful? 0
  • +
  • -

#18 cladus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 11-June 12

Re: Python l33t Translator

Posted 17 June 2012 - 05:48 AM

I realized a mistake here's the new code:
#Leet Translator
#This will translate
#Normal english into
#l33t.
#Credit to: baavgai
#Cladus - 15/06/2012
version = 4
def toLeet(text):
	leet = (
                (('are', 'Are'), 'r'),
                (('ate', 'Ate'), '8'),
                (('that', 'That'), 'tht'),
		(('you', 'You'), 'j00'),
		(('o', 'O'), '0'),
		(('i', 'I'), '1'),
		(('e', 'E'), '3'),
		(('s', 'S'), '5'),
		(('a', 'A'), '4'),
		(('t', 'T'), '7'),
		)
	for symbols, replaceStr in leet:
		for symbol in symbols:
			text = text.replace(symbol, replaceStr)
	return text
def toEnglish(leet):
	eng = (
		('0','o'),
		('1','i'),
		('3','e'),
		('5','s'),
		('4', 'a'),
		('7', 't'),
                (' r ', 'are'),
                ('8', 'ate'),
                ('tht', 'that'),
		('joo', 'you'),
		)
	for symbols, replaceStr in eng:
		leet = leet.replace(symbols, replaceStr)
	return leet


Was This Post Helpful? 0
  • +
  • -

#19 cladus  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 11-June 12

Re: Python l33t Translator

Posted 28 October 2012 - 03:00 AM

Hello,
This project is completed on its FINAL Version 4.0.
If any one would like to continue the project, the code is here: http://code.google.c...33t-translator/
Bye :)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2