(self)
process length four patterns and extract length three roots
process length four patterns and extract length three roots
process length four patterns and extract length three roots
def pro_w4(self):
        """process length four patterns and extract length three roots"""
        if self.stm[0] in self.pr4[0]:      #  مفعل
            self.stm = self.stm[1:]
            return self.stm
        elif self.stm[1] in self.pr4[1]:      #   فاعل
            self.stm = self.stm[0] + self.stm[2:]
            return self.stm
        elif self.stm[2] in self.pr4[2]:     #    فعال   -   فعول    - فعيل
            self.stm = self.stm[:2] + self.stm[3]
            return self.stm
        elif self.stm[3] in self.pr4[3]:      #     فعلة
            self.stm = self.stm[:-1]
            return self.stm
        else:
            self.suf1()   # do - normalize short sufix
            if len(self.stm) == 4:
                self.pre1()    # do - normalize short prefix
            return self.stm
def pro_w4 ( self ) : if self . stm [ 0 ] in self . pr4 [ 0 ] : #  مفعل self . stm = self . stm [ 1 : ] return self . stm elif self . stm [ 1 ] in self . pr4 [ 1 ] : #   فاعل self . stm = self . stm [ 0 ] + self . stm [ 2 : ] return self . stm elif self . stm [ 2 ] in self . pr4 [ 2 ] : #    فعال   -   فعول    - فعيل self . stm = self . stm [ : 2 ] + self . stm [ 3 ] return self . stm elif self . stm [ 3 ] in self . pr4 [ 3 ] : #     فعلة self . stm = self . stm [ : - 1 ] return self . stm else : self . suf1 ( ) # do - normalize short sufix if len ( self . stm ) == 4 : self . pre1 ( ) # do - normalize short prefix return self . stm