view python/accentuate.py @ 185:952ba8de70d8

more characters
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 15 Dec 2011 09:47:09 -0800
parents 01fb9051faf8
children d22c6079a806
line wrap: on
line source

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import random

mapping = {'a': ['Ȁ', 'ȁ', 'à', 'Ѧ', 'ª', 'Å', 'Ą'],
           'b': ['Б', 'ß'],
           'c': ['ç'],
           'd': ['Ð', 'đ'],
           'e': ['ȅ', 'Ё', 'Є', 'Ę'],
           'i': ['ו', 'ḯ', 'í'],
           'l': ['£', '₤'],
           'n': ['И', 'Й', 'א'],
           'o': ['ổ', 'ȍ', 'Ѳ'],
           's': ['∫', '§'],
           't': ['Ṱ', 'ל'],
           'u': ['ṹ'],
           'v': ['Ѵ'],
           'w': ['Ѡ', 'Щ', 'ש'],
           'z': ['ź'],
           }

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)