Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import sys
- from optparse import OptionParser
- def translate(sentence):
- sent_l = list(sentence)
- for c in sent_l:
- if 224 <= ord(c) <= 250:
- sys.stdout.write(unichr(ord(u'א')+ord(c)-ord(u'à')).encode('utf-8'))
- else:
- sys.stdout.write(c.encode('utf-8'))
- print
- sentence="à áï éäåãä"
- translate(sentence.decode('utf-8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement