Beispiel #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)
Beispiel #2
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 )
Beispiel #3
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 )
        return text
Beispiel #4
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)
        return text