GitHub PullRequestReviewCommentEvent at 2014-01-31 23:34:55
Repository: alfanous
Actor: mdebbar
Payload: {"comment":{"url":"https://api.github.com/repos/Alfanous-team/alfanous/pulls/comments/9361664","id":9361664,"diff_hunk":"@@ -22,660 +22,387 @@\n \n \"\"\"\n import re\n-class araby:\n+from araby_constants import *\n+\n+################################################\n+#{ is letter functions\n+################################################\n+def isSukun( archar ):\n+    \"\"\"Checks for Arabic Sukun Mark.\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n     \"\"\"\n-    the arabic chars contains all arabic letters, a sub class of unicode,\n+    if archar == SUKUN:\n+        return True;\n+    else: return False;\n+\n+def isShadda( archar ):\n+    \"\"\"Checks for Arabic Shadda Mark.\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n     \"\"\"\n-\n-    COMMA = u'\\u060C'\n-    SEMICOLON = u'\\u061B'\n-    QUESTION = u'\\u061F'\n-    HAMZA = u'\\u0621'\n-    ALEF_MADDA = u'\\u0622'\n-    ALEF_HAMZA_ABOVE = u'\\u0623'\n-    WAW_HAMZA = u'\\u0624'\n-    ALEF_HAMZA_BELOW = u'\\u0625'\n-    YEH_HAMZA = u'\\u0626'\n-    ALEF = u'\\u0627'\n-    BEH = u'\\u0628'\n-    TEH_MARBUTA = u'\\u0629'\n-    TEH = u'\\u062a'\n-    THEH = u'\\u062b'\n-    JEEM = u'\\u062c'\n-    HAH = u'\\u062d'\n-    KHAH = u'\\u062e'\n-    DAL = u'\\u062f'\n-    THAL = u'\\u0630'\n-    REH = u'\\u0631'\n-    ZAIN = u'\\u0632'\n-    SEEN = u'\\u0633'\n-    SHEEN = u'\\u0634'\n-    SAD = u'\\u0635'\n-    DAD = u'\\u0636'\n-    TAH = u'\\u0637'\n-    ZAH = u'\\u0638'\n-    AIN = u'\\u0639'\n-    GHAIN = u'\\u063a'\n-    TATWEEL = u'\\u0640'\n-    FEH = u'\\u0641'\n-    QAF = u'\\u0642'\n-    KAF = u'\\u0643'\n-    LAM = u'\\u0644'\n-    MEEM = u'\\u0645'\n-    NOON = u'\\u0646'\n-    HEH = u'\\u0647'\n-    WAW = u'\\u0648'\n-    ALEF_MAKSURA = u'\\u0649'\n-    YEH = u'\\u064a'\n-    MADDA_ABOVE = u'\\u0653'\n-    HAMZA_ABOVE = u'\\u0654'\n-    HAMZA_BELOW = u'\\u0655'\n-    ZERO = u'\\u0660'\n-    ONE = u'\\u0661'\n-    TWO = u'\\u0662'\n-    THREE = u'\\u0663'\n-    FOUR = u'\\u0664'\n-    FIVE = u'\\u0665'\n-    SIX = u'\\u0666'\n-    SEVEN = u'\\u0667'\n-    EIGHT = u'\\u0668'\n-    NINE = u'\\u0669'\n-    PERCENT = u'\\u066a'\n-    DECIMAL = u'\\u066b'\n-    THOUSANDS = u'\\u066c'\n-    STAR = u'\\u066d'\n-    MINI_ALEF = u'\\u0670'\n-    ALEF_WASLA = u'\\u0671'\n-    FULL_STOP = u'\\u06d4'\n-    BYTE_ORDER_MARK = u'\\ufeff'\n-\n-    # Diacritics\n-    FATHATAN = u'\\u064b'\n-    DAMMATAN = u'\\u064c'\n-    KASRATAN = u'\\u064d'\n-    FATHA = u'\\u064e'\n-    DAMMA = u'\\u064f'\n-    KASRA = u'\\u0650'\n-    SHADDA = u'\\u0651'\n-    SUKUN = u'\\u0652'\n-\n-    # Small Letters\n-    SMALL_ALEF = u\"\\u0670\"\n-    SMALL_WAW = u\"\\u06E5\"\n-    SMALL_YEH = u\"\\u06E6\"\n-    #Ligatures\n-    LAM_ALEF = u'\\ufefb'\n-    LAM_ALEF_HAMZA_ABOVE = u'\\ufef7'\n-    LAM_ALEF_HAMZA_BELOW = u'\\ufef9'\n-    LAM_ALEF_MADDA_ABOVE = u'\\ufef5'\n-    simple_LAM_ALEF = u'\\u0644\\u0627'\n-    simple_LAM_ALEF_HAMZA_ABOVE = u'\\u0644\\u0623'\n-    simple_LAM_ALEF_HAMZA_BELOW = u'\\u0644\\u0625'\n-    simple_LAM_ALEF_MADDA_ABOVE = u'\\u0644\\u0622'\n-    # groups\n-    LETTERS = u''.join( [\n-            ALEF , BEH , TEH  , TEH_MARBUTA  , THEH  , JEEM  , HAH , KHAH ,\n-            DAL   , THAL  , REH   , ZAIN  , SEEN   , SHEEN  , SAD , DAD , TAH   , ZAH   ,\n-            AIN   , GHAIN   , FEH  , QAF , KAF , LAM , MEEM , NOON, HEH , WAW, YEH  ,\n-            HAMZA  , ALEF_MADDA , ALEF_HAMZA_ABOVE , WAW_HAMZA   , ALEF_HAMZA_BELOW  , YEH_HAMZA  ,\n-            ] )\n-\n-    TASHKEEL = ( FATHATAN, DAMMATAN, KASRATAN,\n-                FATHA, DAMMA, KASRA,\n-                SUKUN,\n-                SHADDA );\n-    HARAKAT = ( FATHATAN, DAMMATAN, KASRATAN,\n-                FATHA, DAMMA, KASRA,\n-                SUKUN\n-                );\n-    SHORTHARAKAT = ( FATHA, DAMMA, KASRA, SUKUN );\n-\n-    TANWIN = ( FATHATAN, DAMMATAN, KASRATAN );\n-\n-\n-    LIGUATURES = ( \n-                LAM_ALEF,\n-                LAM_ALEF_HAMZA_ABOVE,\n-                LAM_ALEF_HAMZA_BELOW,\n-                LAM_ALEF_MADDA_ABOVE,\n-                );\n-    HAMZAT = ( \n-                HAMZA,\n-                WAW_HAMZA,\n-                YEH_HAMZA,\n-                HAMZA_ABOVE,\n-                HAMZA_BELOW,\n-                ALEF_HAMZA_BELOW,\n-                ALEF_HAMZA_ABOVE,\n-                );\n-    ALEFAT = ( \n-                ALEF,\n-                ALEF_MADDA,\n-                ALEF_HAMZA_ABOVE,\n-                ALEF_HAMZA_BELOW,\n-                ALEF_WASLA,\n-                ALEF_MAKSURA,\n-                SMALL_ALEF,\n-\n-            );\n-    WEAK = ( ALEF, WAW, YEH, ALEF_MAKSURA );\n-    YEHLIKE = ( YEH, YEH_HAMZA, ALEF_MAKSURA, SMALL_YEH );\n-\n-    WAWLIKE = ( WAW, WAW_HAMZA, SMALL_WAW );\n-    TEHLIKE = ( TEH, TEH_MARBUTA );\n-\n-    SMALL = ( SMALL_ALEF, SMALL_WAW, SMALL_YEH )\n-    MOON = ( HAMZA            ,\n-            ALEF_MADDA       ,\n-            ALEF_HAMZA_ABOVE ,\n-            ALEF_HAMZA_BELOW ,\n-            ALEF             ,\n-            BEH              ,\n-            JEEM             ,\n-            HAH              ,\n-            KHAH             ,\n-            AIN              ,\n-            GHAIN            ,\n-            FEH              ,\n-            QAF              ,\n-            KAF              ,\n-            MEEM             ,\n-            HEH              ,\n-            WAW              ,\n-            YEH\n-        );\n-    SUN = ( \n-            TEH              ,\n-            THEH             ,\n-            DAL              ,\n-            THAL             ,\n-            REH              ,\n-            ZAIN             ,\n-            SEEN             ,\n-            SHEEN            ,\n-            SAD              ,\n-            DAD              ,\n-            TAH              ,\n-            ZAH              ,\n-            LAM              ,\n-            NOON             ,\n-        );\n-    AlphabeticOrder = {\n-                    ALEF             : 1,\n-                    BEH              : 2,\n-                    TEH              : 3,\n-                    TEH_MARBUTA      : 3,\n-                    THEH             : 4,\n-                    JEEM             : 5,\n-                    HAH              : 6,\n-                    KHAH             : 7,\n-                    DAL              : 8,\n-                    THAL             : 9,\n-                    REH              : 10,\n-                    ZAIN             : 11,\n-                    SEEN             : 12,\n-                    SHEEN            : 13,\n-                    SAD              : 14,\n-                    DAD              : 15,\n-                    TAH              : 16,\n-                    ZAH              : 17,\n-                    AIN              : 18,\n-                    GHAIN            : 19,\n-                    FEH              : 20,\n-                    QAF              : 21,\n-                    KAF              : 22,\n-                    LAM              : 23,\n-                    MEEM             : 24,\n-                    NOON             : 25,\n-                    HEH              : 26,\n-                    WAW              : 27,\n-                    YEH              : 28,\n-                    HAMZA            : 29,\n-\n-                    ALEF_MADDA       : 29,\n-                    ALEF_HAMZA_ABOVE : 29,\n-                    WAW_HAMZA        : 29,\n-                    ALEF_HAMZA_BELOW : 29,\n-                    YEH_HAMZA        : 29,\n-                    }\n-    NAMES = {\n-                    ALEF             :  u\"ألف\",\n-                    BEH              : u\"باء\",\n-                    TEH              : u'تاء' ,\n-                    TEH_MARBUTA      : u'تاء مربوطة' ,\n-                    THEH             : u'ثاء' ,\n-                    JEEM             : u'جيم' ,\n-                    HAH              : u'حاء' ,\n-                    KHAH             : u'خاء' ,\n-                    DAL              : u'دال' ,\n-                    THAL             : u'ذال' ,\n-                    REH              : u'راء' ,\n-                    ZAIN             : u'زاي' ,\n-                    SEEN             : u'سين' ,\n-                    SHEEN            : u'شين' ,\n-                    SAD              : u'صاد' ,\n-                    DAD              : u'ضاد' ,\n-                    TAH              : u'طاء' ,\n-                    ZAH              : u'ظاء' ,\n-                    AIN              : u'عين' ,\n-                    GHAIN            : u'غين' ,\n-                    FEH              : u'فاء' ,\n-                    QAF              : u'قاف' ,\n-                    KAF              : u'كاف' ,\n-                    LAM              : u'لام' ,\n-                    MEEM             : u'ميم' ,\n-                    NOON             : u'نون' ,\n-                    HEH              : u'هاء' ,\n-                    WAW              : u'واو' ,\n-                    YEH              : u'ياء' ,\n-                    HAMZA            : u'همزة' ,\n-\n-                    TATWEEL          : u'تطويل' ,\n-                    ALEF_MADDA       : u'ألف ممدودة' ,\n-                    ALEF_MAKSURA      : u'ألف مقصورة' ,\n-                    ALEF_HAMZA_ABOVE : u'همزة على الألف' ,\n-                    WAW_HAMZA        : u'همزة على الواو' ,\n-                    ALEF_HAMZA_BELOW : u'همزة تحت الألف' ,\n-                    YEH_HAMZA        : u'همزة على الياء' ,\n-                    FATHATAN         : u'فتحتان',\n-                    DAMMATAN         : u'ضمتان',\n-                    KASRATAN         : u'كسرتان',\n-                    FATHA            : u'فتحة',\n-                    DAMMA            : u'ضمة',\n-                    KASRA            : u'كسرة',\n-                    SHADDA           : u'شدة',\n-                    SUKUN            : u'سكون',\n-                    }\n-\n-    # regular expretion\n-    HARAKAT_pattern = re.compile( ur\"[\" + u\"\".join( HARAKAT ) + u\"]\" )\n-    TASHKEEL_pattern = re.compile( ur\"[\" + u\"\".join( TASHKEEL ) + u\"]\" )\n-    HAMZAT_pattern = re.compile( ur\"[\" + u\"\".join( HAMZAT ) + u\"]\" );\n-    ALEFAT_pattern = re.compile( ur\"[\" + u\"\".join( ALEFAT ) + u\"]\" );\n-    LIGUATURES_pattern = re.compile( ur\"[\" + u\"\".join( LIGUATURES ) + u\"]\" );\n-\n-    def __init__( self, ):\n-        pass;\n-\n-    ################################################\n-    #{ is letter functions\n-    ################################################\n-    def isSukun( self, archar ):\n-        \"\"\"Checks for Arabic Sukun Mark.\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar == self.SUKUN:\n-            return True;\n-        else: return False;\n-\n-    def isShadda( self, archar ):\n-        \"\"\"Checks for Arabic Shadda Mark.\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar == self.SHADDA:\n-            return True;\n-        else: return False;\n-\n-    def isTatweel( self, archar ):\n-        \"\"\"Checks for Arabic Tatweel letter modifier.\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar == self.TATWEEL:\n-            return True;\n-        else: return False;\n-    def isTanwin( self, archar ):\n-        \"\"\"Checks for Arabic Tanwin Marks (FATHATAN, DAMMATAN, KASRATAN).\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.TANWIN:\n-            return True;\n-        else: return False;\n-\n-    def isTashkeel( self, archar ):\n-        \"\"\"Checks for Arabic Tashkeel Marks (FATHA,DAMMA,KASRA, SUKUN, SHADDA, FATHATAN,DAMMATAN, KASRATAn).\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-##        if re.search(self.TASHKEEL,word):\n-        if  archar in  self.TASHKEEL:\n-            return True;\n-        else: return False;\n-\n-    def isHaraka( self, archar ):\n-        \"\"\"Checks for Arabic Harakat Marks (FATHA,DAMMA,KASRA,SUKUN,TANWIN).\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.HARAKAT:\n-            return True;\n-        else: return False;\n-\n-    def isShortharaka( self, archar ):\n-        \"\"\"Checks for Arabic  short Harakat Marks (FATHA,DAMMA,KASRA,SUKUN).\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.SHORTHARAKAT:\n-            return True;\n-        else: return False;\n-\n-    def isLigature( self, archar ):\n-        \"\"\"Checks for Arabic  Ligatures like LamAlef.\n-        (LAM_ALEF, LAM_ALEF_HAMZA_ABOVE, LAM_ALEF_HAMZA_BELOW, LAM_ALEF_MADDA_ABOVE)\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.LIGUATURES:\n-            return True;\n-        else: return False;\n-\n-    def isHamza( self, archar ):\n-        \"\"\"Checks for Arabic  Hamza forms.\n-        HAMZAT are (HAMZA, WAW_HAMZA, YEH_HAMZA, HAMZA_ABOVE, HAMZA_BELOW,ALEF_HAMZA_BELOW, ALEF_HAMZA_ABOVE )\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.HAMZAT:\n-            return True;\n-        else: return False;\n-\n-    def isAlef( self, archar ):\n-        \"\"\"Checks for Arabic Alef forms.\n-        ALEFAT=(ALEF, ALEF_MADDA, ALEF_HAMZA_ABOVE, ALEF_HAMZA_BELOW,ALEF_WASLA, ALEF_MAKSURA );\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.ALEFAT:\n-            return True;\n-        else: return False;\n-\n-    def isYehlike( self, archar ):\n-        \"\"\"Checks for Arabic Yeh forms.\n-        Yeh forms : YEH, YEH_HAMZA, SMALL_YEH, ALEF_MAKSURA\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.YEHLIKE:\n-            return True;\n-        else: return False;\n-\n-    def isWawlike( self, archar ):\n-        \"\"\"Checks for Arabic Waw like forms.\n-        Waw forms : WAW, WAW_HAMZA, SMALL_WAW\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.WAWLIKE:\n-            return True;\n-        else: return False;\n-\n-    def isTeh( self, archar ):\n-        \"\"\"Checks for Arabic Teh forms.\n-        Teh forms : TEH, TEH_MARBUTA\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.TEHLIKE:\n-            return True;\n-        else: return False;\n-    def isSmall( self, archar ):\n-        \"\"\"Checks for Arabic Small letters.\n-        SMALL Letters : SMALL ALEF, SMALL WAW, SMALL YEH\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.SMALL:\n-            return True;\n-        else: return False;\n-\n-    def isWeak( self, archar ):\n-        \"\"\"Checks for Arabic Weak letters.\n-        Weak Letters : ALEF, WAW, YEH, ALEF_MAKSURA\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.WEAK:\n+    if archar == SHADDA:\n+        return True;\n+    else: return False;\n+\n+def isTatweel( archar ):\n+    \"\"\"Checks for Arabic Tatweel letter modifier.\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar == TATWEEL:\n+        return True;\n+    else: return False;\n+def isTanwin( archar ):\n+    \"\"\"Checks for Arabic Tanwin Marks (FATHATAN, DAMMATAN, KASRATAN).\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in TANWIN:\n+        return True;\n+    else: return False;\n+\n+def isTashkeel( archar ):\n+    \"\"\"Checks for Arabic Tashkeel Marks (FATHA,DAMMA,KASRA, SUKUN, SHADDA, FATHATAN,DAMMATAN, KASRATAn).\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if re.search(TASHKEEL,word):\n+        if  archar in  TASHKEEL:\n             return True;\n-        else: return False;\n+    else: return False;\n+\n+def isHaraka( archar ):\n+    \"\"\"Checks for Arabic Harakat Marks (FATHA,DAMMA,KASRA,SUKUN,TANWIN).\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in HARAKAT:\n+        return True;\n+    else: return False;\n+\n+def isShortharaka( archar ):\n+    \"\"\"Checks for Arabic  short Harakat Marks (FATHA,DAMMA,KASRA,SUKUN).\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in SHORTHARAKAT:\n+        return True;\n+    else: return False;\n+\n+def isLigature( archar ):\n+    \"\"\"Checks for Arabic  Ligatures like LamAlef.\n+    (LAM_ALEF, LAM_ALEF_HAMZA_ABOVE, LAM_ALEF_HAMZA_BELOW, LAM_ALEF_MADDA_ABOVE)\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in LIGUATURES:\n+        return True;\n+    else: return False;\n+\n+def isHamza( archar ):\n+    \"\"\"Checks for Arabic  Hamza forms.\n+    HAMZAT are (HAMZA, WAW_HAMZA, YEH_HAMZA, HAMZA_ABOVE, HAMZA_BELOW,ALEF_HAMZA_BELOW, ALEF_HAMZA_ABOVE )\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in HAMZAT:\n+        return True;\n+    else: return False;\n+\n+def isAlef( archar ):\n+    \"\"\"Checks for Arabic Alef forms.\n+    ALEFAT=(ALEF, ALEF_MADDA, ALEF_HAMZA_ABOVE, ALEF_HAMZA_BELOW,ALEF_WASLA, ALEF_MAKSURA );\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in ALEFAT:\n+        return True;\n+    else: return False;\n+\n+def isYehlike( archar ):\n+    \"\"\"Checks for Arabic Yeh forms.\n+    Yeh forms : YEH, YEH_HAMZA, SMALL_YEH, ALEF_MAKSURA\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in YEHLIKE:\n+        return True;\n+    else: return False;\n+\n+def isWawlike( archar ):\n+    \"\"\"Checks for Arabic Waw like forms.\n+    Waw forms : WAW, WAW_HAMZA, SMALL_WAW\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in WAWLIKE:\n+        return True;\n+    else: return False;\n+\n+def isTeh( archar ):\n+    \"\"\"Checks for Arabic Teh forms.\n+    Teh forms : TEH, TEH_MARBUTA\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in TEHLIKE:\n+        return True;\n+    else: return False;\n+def isSmall( archar ):\n+    \"\"\"Checks for Arabic Small letters.\n+    SMALL Letters : SMALL ALEF, SMALL WAW, SMALL YEH\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in SMALL:\n+        return True;\n+    else: return False;\n+\n+def isWeak( archar ):\n+    \"\"\"Checks for Arabic Weak letters.\n+    Weak Letters : ALEF, WAW, YEH, ALEF_MAKSURA\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in WEAK:\n+        return True;\n+    else: return False;\n+\n+def isMoon( archar ):\n+    \"\"\"Checks for Arabic Moon letters.\n+    Moon Letters :\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n \n-    def isMoon( self, archar ):\n-        \"\"\"Checks for Arabic Moon letters.\n-        Moon Letters :\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n+    if archar in MOON:\n+        return True;\n+    else: return False;\n \n-        if archar in self.MOON:\n-            return True;\n-        else: return False;\n-\n-    def isSun( self, archar ):\n-        \"\"\"Checks for Arabic Sun letters.\n-        Moon Letters :\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        \"\"\"\n-        if archar in self.SUN:\n-            return True;\n-        else: return False;\n-    #####################################\n-    #{ general  letter functions\n-    #####################################\n-    def order( self, archar ):\n-        \"\"\"return Arabic letter order between 1 and 29.\n-        Alef order is 1, Yeh is 28, Hamza is 29.\n-        Teh Marbuta has the same ordre with Teh, 3.\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        @return: arabic order.\n-        @rtype: integer;\n-        \"\"\"\n-        if self.AlphabeticOrder.has_key( archar ):\n-            return self.AlphabeticOrder[archar];\n-        else: return 0;\n-\n-    def name( self, archar ):\n-        \"\"\"return Arabic letter name in arabic.\n-        Alef order is 1, Yeh is 28, Hamza is 29.\n-        Teh Marbuta has the same ordre with Teh, 3.\n-        @param archar: arabic unicode char\n-        @type archar: unicode\n-        @return: arabic name.\n-        @rtype: unicode;\n-        \"\"\"\n-        if self.NAMES.has_key( archar ):\n-            return self.NAMES[archar];\n-        else:\n-            return u'';\n-\n-    def arabicrange( self ):\n-        \"\"\"return a list of arabic characteres .\n-        Return a list of characteres between \\u060c to \\u0652\n-        @return: list of arabic characteres.\n-        @rtype: unicode;\n-        \"\"\"\n-        mylist = [];\n-        for i in range( 0x0600, 0x00653 ):\n-            try :\n-                mylist.append( unichr( i ) );\n-            except ValueError:\n-                pass;\n-        return mylist;\n-\n-\n-    #####################################\n-    #{ Has letter functions\n-    #####################################\n-    def hasShadda( self, word ):\n-        \"\"\"Checks if the arabic word  contains shadda.\n-        @param word: arabic unicode char\n-        @type word: unicode\n-        \"\"\"\n-        if re.search( self.SHADDA, word ):\n+def isSun( archar ):\n+    \"\"\"Checks for Arabic Sun letters.\n+    Moon Letters :\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    \"\"\"\n+    if archar in SUN:\n+        return True;\n+    else: return False;\n+#####################################\n+#{ general  letter functions\n+#####################################\n+def order( archar ):\n+    \"\"\"return Arabic letter order between 1 and 29.\n+    Alef order is 1, Yeh is 28, Hamza is 29.\n+    Teh Marbuta has the same ordre with Teh, 3.\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    @return: arabic order.\n+    @rtype: integer;\n+    \"\"\"\n+    if AlphabeticOrder.has_key( archar ):\n+        return AlphabeticOrder[archar];\n+    else: return 0;\n+\n+def name( archar ):\n+    \"\"\"return Arabic letter name in arabic.\n+    Alef order is 1, Yeh is 28, Hamza is 29.\n+    Teh Marbuta has the same ordre with Teh, 3.\n+    @param archar: arabic unicode char\n+    @type archar: unicode\n+    @return: arabic name.\n+    @rtype: unicode;\n+    \"\"\"\n+    if NAMES.has_key( archar ):\n+        return NAMES[archar];\n+    else:\n+        return u'';\n+\n+def arabicrange( self ):\n+    \"\"\"return a list of arabic characteres .\n+    Return a list of characteres between \\u060c to \\u0652\n+    @return: list of arabic characteres.\n+    @rtype: unicode;\n+    \"\"\"\n+    mylist = [];\n+    for i in range( 0x0600, 0x00653 ):\n+        try :\n+            mylist.append( unichr( i ) );\n+        except ValueError:\n+            pass;\n+    return mylist;\n+\n+\n+#####################################\n+#{ Has letter functions\n+#####################################\n+def hasShadda( word ):\n+    \"\"\"Checks if the arabic word  contains shadda.\n+    @param word: arabic unicode char\n+    @type word: unicode\n+    \"\"\"\n+    if re.search( SHADDA, word ):","path":"src/alfanous-labs/PyArabic/araby.py","position":713,"original_position":713,"commit_id":"54b0b4bc2a9bbb7c20d0229b92bc29a05b4f8063","original_commit_id":"54b0b4bc2a9bbb7c20d0229b92bc29a05b4f8063","user":{"login":"mdebbar","id":1278212,"avatar_url":"https://gravatar.com/avatar/de0bb211ab33d570f1bae4bced2cdb80?d=https%3A%2F%2Fidenticons.github.com%2F051f5b228a8fc385105322f7461544b2.png&r=x","gravatar_id":"de0bb211ab33d570f1bae4bced2cdb80","url":"https://api.github.com/users/mdebbar","html_url":"https://github.com/mdebbar","followers_url":"https://api.github.com/users/mdebbar/followers","following_url":"https://api.github.com/users/mdebbar/following{/other_user}","gists_url":"https://api.github.com/users/mdebbar/gists{/gist_id}","starred_url":"https://api.github.com/users/mdebbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdebbar/subscriptions","organizations_url":"https://api.github.com/users/mdebbar/orgs","repos_url":"https://api.github.com/users/mdebbar/repos","events_url":"https://api.github.com/users/mdebbar/events{/privacy}","received_events_url":"https://api.github.com/users/mdebbar/received_events","type":"User","site_admin":false},"body":"Instead of using Regex matching, you can do simple string operation: `return SHADDA in word`","created_at":"2014-01-31T23:34:55Z","updated_at":"2014-01-31T23:34:55Z","html_url":"https://github.com/Alfanous-team/alfanous/pull/378#discussion_r9361664","pull_request_url":"https://api.github.com/repos/Alfanous-team/alfanous/pulls/378","_links":{"self":{"href":"https://api.github.com/repos/Alfanous-team/alfanous/pulls/comments/9361664"},"html":{"href":"https://github.com/Alfanous-team/alfanous/pull/378#discussion_r9361664"},"pull_request":{"href":"https://api.github.com/repos/Alfanous-team/alfanous/pulls/378"}}}}