Skip to content

Instantly share code, notes, and snippets.

@nournia
Created March 17, 2016 11:23
Show Gist options
  • Save nournia/86da7055259b6a0fb2a6 to your computer and use it in GitHub Desktop.
Save nournia/86da7055259b6a0fb2a6 to your computer and use it in GitHub Desktop.
# coding: utf8
from __future__ import unicode_literals
maketrans = lambda A, B: dict((ord(a), b) for a, b in zip(A, B))
buckwalter_transliteration = maketrans('\'>&<}AbptvjHxd*rzs$SDTZEg_fqklmnhwYyFNKaui~o^#`{:@"[;,.!-+%]', 'ءأؤإئابةتثجحخدذرزسشصضطظعغـفقكلمنهوىيًٌٍَُِّْٓٔٱۣۜ۟۠ۢۥۦ۪ۭۨ۫۬')
# usage
print 'r~aHoma`ni'.translate(buckwalter_transliteration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment