view python/accentuate.py @ 126:6d2e986c0dae

add another
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 08 Mar 2011 13:55:33 -0800
parents a51df2382390
children a612a16f11a7
line wrap: on
line source

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

import random

mapping = {'a': ['Ȁ', 'ȁ', 'à'],
           'c': ['ç'],
           'e': ['ȅ'],
           'n': ['И'], 
           'o': ['ổ', 'ȍ'],
           't': ['Ṱ'],
           }

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)