示例#1
0
    def shakl_compare( self, other ):

        first = self.normalize_shaping( self )
        second = self.normalize_shaping( other )
        firstN = strip_tashkeel( first )
        secondN = strip_tashkeel( second )

        if firstN != secondN:
            return False
        else:
            l1 = self.list_harakat()
            l2 = other.list_harakat()
            return self.compare_harakat( l1, l2 )
示例#2
0
    def normalize_all( self, text ):
        if self._shaping:
                text = normalize_lamalef( text )
                text = unicode_.normalize_shaping( text )
                text = strip_tatweel( text )

        if self._tashkil:
                text = strip_tashkeel( text )

        if self._spellerrors:
                text = normalize_spellerrors( text )

        if self._hamza:
                text = normalize_hamza( text )
                
        if self._uthmani_symbols:
                text = normalize_uthmani_symbols( text )

        return text