Mercurial > hg > config
view python/accentuate.py @ 158:c1390e43b437
point pastebin at pastebin.mozilla
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 28 Jul 2011 09:18:15 -0700 |
parents | e5c0188c5001 |
children | 2de4b1d92c1c |
line wrap: on
line source
#!/usr/bin/env python # -*- coding: utf-8 -*- import random mapping = {'a': ['Ȁ', 'ȁ', 'à', 'Ѧ'], 'b': ['Б'], 'c': ['ç'], 'e': ['ȅ', 'Ё', 'Є'], 'n': ['И', 'Й'], 'o': ['ổ', 'ȍ', 'Ѳ'], 's': ['∫'], 't': ['Ṱ'], 'v': ['Ѵ'], 'w': ['Ѡ', 'Щ'] } if __name__ == '__main__': import sys arg = ' '.join(sys.argv[1:]) retval = [] for letter in arg: if letter.lower() in mapping: retval.append(random.sample(mapping[letter.lower()], 1)[0]) else: retval.append(letter) print ''.join(retval)