private static function _getPrefix($word)
    {
        $questionMarkPosition = strpos($word, '?');
        $astrericPosition     = strpos($word, '*');

        if ($questionMarkPosition !== false) {
            if ($astrericPosition !== false) {
                return substr($word, 0, min($questionMarkPosition, $astrericPosition));
            }

            return substr($word, 0, $questionMarkPosition);
        } else if ($astrericPosition !== false) {
            return substr($word, 0, $astrericPosition);
        }

        return $word;
    }
private static function _getPrefix($word)
    {
        $questionMarkPosition = strpos($word, '?');
        $astrericPosition     = strpos($word, '*');

        if ($questionMarkPosition !== false) {
            if ($astrericPosition !== false) {
                return substr($word, 0, min($questionMarkPosition, $astrericPosition));
            }

            return substr($word, 0, $questionMarkPosition);
        } else if ($astrericPosition !== false) {
            return substr($word, 0, $astrericPosition);
        }

        return $word;
    }
private static function _getPrefix ( $ word ) { $ questionMarkPosition = strpos ( $ word , '?' ) ; $ astrericPosition = strpos ( $ word , '*' ) ; if ( $ questionMarkPosition !== false ) { if ( $ astrericPosition !== false ) { return substr ( $ word , 0 , min ( $ questionMarkPosition , $ astrericPosition ) ) ; } return substr ( $ word , 0 , $ questionMarkPosition ) ; } else if ( $ astrericPosition !== false ) { return substr ( $ word , 0 , $ astrericPosition ) ; } return $ word ; }
Get terms prefix

@param  string $word
@return string
Get terms prefix