private function hasValidSEnding($word)
    {
        $lastLetter = Utf8::substr($word, -1, 1);
        if (in_array($lastLetter, array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'v', 'y', 'z'))) {
            return true;
        }
        if ($lastLetter == 'k') {
            $beforeLetter = Utf8::substr($word, -2, 1);
            if (!in_array($beforeLetter, self::$vowels)) {
                return true;
            }
        }
        return false;
    }
private function hasValidSEnding($word)
    {
        $lastLetter = Utf8::substr($word, -1, 1);
        if (in_array($lastLetter, array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'v', 'y', 'z'))) {
            return true;
        }
        if ($lastLetter == 'k') {
            $beforeLetter = Utf8::substr($word, -2, 1);
            if (!in_array($beforeLetter, self::$vowels)) {
                return true;
            }
        }
        return false;
    }
private function hasValidSEnding ( $ word ) { $ lastLetter = Utf8 :: substr ( $ word , - 1 , 1 ) ; if ( in_array ( $ lastLetter , array ( 'b' , 'c' , 'd' , 'f' , 'g' , 'h' , 'j' , 'l' , 'm' , 'n' , 'o' , 'p' , 'r' , 't' , 'v' , 'y' , 'z' ) ) ) { return true ; } if ( $ lastLetter == 'k' ) { $ beforeLetter = Utf8 :: substr ( $ word , - 2 , 1 ) ; if ( ! in_array ( $ beforeLetter , self :: $ vowels ) ) { return true ; } } return false ; }
Define a valid s-ending as one of
b   c   d   f   g   h   j   l   m   n   o   p   r   t   v   y   z,
or k not preceded by a vowel

@param string $ending
@return boolean
Define a valid s - ending as one of b c d f g h j l m n o p r t v y z or k not preceded by a vowel