Skip to content

Instantly share code, notes, and snippets.

@andrewheiss
Created November 23, 2010 04:35
Show Gist options
  • Save andrewheiss/711260 to your computer and use it in GitHub Desktop.
Save andrewheiss/711260 to your computer and use it in GitHub Desktop.
private static $arRegPatterns = array('/^ال/','/^إِي/','/^عِي/','/^عُو/','/ْع$/',
'/ِي$/','/َو$/','/َي$/','/^ع/','/^أ/','/^آ/' );
private static $arRegReplacements = array('Al-', 'ei', 'ei', 'ou', 'a',
'i', 'aw', 'ay', 'a', 'a', 'aa');
private static $arPatterns = array('ّ', 'تة', 'ته', 'كة', 'كه', 'ده', 'دة', 'ضه', 'ضة', 'سه', 'سة', 'صه', 'صة',
'َا', 'َي', 'ُو', 'ِي', 'ً', 'ٌ', 'ٍ', 'َ', 'ِ', 'ُ',
'ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر',
'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف',
'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'ة', 'و', 'ي', 'ى',
'أ', 'إ', 'ء', 'ؤ', 'ئ', 'آ', 'ْ');
// TODO: Fix transliteration replacements
private static $arReplacements = array('#', "t'h", "t'h", "k'h", "k'h", "d'h", "d'h", "d'h", "d'h", "s'h", "s'h", "s'h", "s'h",
'a', 'a', 'ou', 'ei', 'an', 'an', 'an', 'a', 'i', 'u',
'aa', 'b', 't', 'th', 'j', 'h', 'kh', 'd', 'dh', 'r',
'z', 's', 'sh', 's', 'd', 't', 'z', "'", 'gh', 'f',
'q', 'k', 'l', 'm', 'n', 'h', 'h', 'w', 'ii', 'aa',
"'a", 'i', "'a", "u'", "'i", "'aa", '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment