src/Stemmer/ArabicStemmer.php
public static function stem($word)
    {
        $nounStem = self::roughStem(
            $word, self::$_nounMay, self::$_nounPre, self::$_nounPost, 
            self::$_nounMaxPre, self::$_nounMaxPost, self::$_nounMinStem
        );
        $verbStem = self::roughStem(
            $word, self::$_verbMay, self::$_verbPre, self::$_verbPost, 
            self::$_verbMaxPre, self::$_verbMaxPost, self::$_verbMinStem
        );
        
        if (mb_strlen($nounStem, 'UTF-8') < mb_strlen($verbStem, 'UTF-8')) {
            $stem = $nounStem;
        } else {
            $stem = $verbStem;
        }
        
        return $stem;
    }
public static function stem($word)
    {
        $nounStem = self::roughStem(
            $word, self::$_nounMay, self::$_nounPre, self::$_nounPost, 
            self::$_nounMaxPre, self::$_nounMaxPost, self::$_nounMinStem
        );
        $verbStem = self::roughStem(
            $word, self::$_verbMay, self::$_verbPre, self::$_verbPost, 
            self::$_verbMaxPre, self::$_verbMaxPost, self::$_verbMinStem
        );
        
        if (mb_strlen($nounStem, 'UTF-8') < mb_strlen($verbStem, 'UTF-8')) {
            $stem = $nounStem;
        } else {
            $stem = $verbStem;
        }
        
        return $stem;
    }
public static function stem ( $ word ) { $ nounStem = self :: roughStem ( $ word , self :: $ _nounMay , self :: $ _nounPre , self :: $ _nounPost , self :: $ _nounMaxPre , self :: $ _nounMaxPost , self :: $ _nounMinStem ) ; $ verbStem = self :: roughStem ( $ word , self :: $ _verbMay , self :: $ _verbPre , self :: $ _verbPost , self :: $ _verbMaxPre , self :: $ _verbMaxPost , self :: $ _verbMinStem ) ; if ( mb_strlen ( $ nounStem , 'UTF-8' ) < mb_strlen ( $ verbStem , 'UTF-8' ) ) { $ stem = $ nounStem ; } else { $ stem = $ verbStem ; } return $ stem ; }
Get rough stem of the given Arabic word

@param string $word Arabic word you would like to get its stem

@return string Arabic stem of the word
@author Khaled Al-Sham'aa <khaled@ar-php.org>
Get rough stem of the given Arabic word