Skip to content

Instantly share code, notes, and snippets.

@alahijani
Last active December 22, 2015 16:19
Show Gist options
  • Save alahijani/6498498 to your computer and use it in GitHub Desktop.
Save alahijani/6498498 to your computer and use it in GitHub Desktop.
Transliterate Hebrew, Syriac --> Arabic
function transliterate(str, table) {
var result = '';
for (var i = 0; i < str.length; i++) {
var c = str.charAt(i);
result += table[c];
}
return result
}
var toArabic = {
// Hebrew:
'א': 'ﺍ',
'ב': 'ﺏ',
'ג': 'ﺝ',
'ד': 'د',
'ה': 'ھ',
'ו': 'ﻭ',
'ז': 'ﺯ, ذ',
'ח': 'ح, خ',
'ט': 'ط',
'י': 'ي',
'כך': 'ﻙ',
'ל': 'ﻝ',
'מם': 'ﻡ',
'נן': 'ﻥ',
'ס': 'س',
'ע': 'ع, غ',
'פף': 'ف',
'צץ': 'ص, ض, ظ',
'ק': 'ﻕ',
'ר': 'ﺭ',
'ש': 'ش',
'ת': 'ت, ث',
// Syriac:
'ܐ': 'ﺍ',
'ܒ': 'ﺏ',
'ܓ': 'ﺝ',
'ܕ': 'د',
'ܗ': 'ھ',
'ܘ': 'ﻭ',
'ܙ': 'ﺯ, ذ',
'ܚ': 'ح, خ',
'ܛ': 'ط',
'ܝ': 'ي',
'ܟ': 'ﻙ',
'ܠ': 'ﻝ',
'ܡ': 'ﻡ',
'ܢ': 'ﻥ',
'ܣ': 'س',
'ܤ': 'س',
'ܥ': 'ع, غ',
'ܦ': 'ف',
'ܨ': 'ص, ض, ظ',
'ܩ': 'ﻕ',
'ܪ': 'ﺭ',
'ܫ': 'ش',
'ܬ': 'ت, ث'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment