src/Linguistics.php
public function isQuestion($string)
    {
        $probability = 0;

        if (strpos($string, '?')) {
            $probability += 1;
        }

        $words = $this->getWords($string);

        foreach ($this->inquiryWords as $queryWord) {
            if (!strncmp(strtolower($string), $queryWord, strlen($queryWord))) {
                $probability += 1;
            } elseif (stristr(strtolower($string), $queryWord)) {
                $probability += 0.5;
            }
        }

        if ($probability >= 2) {
            return true;
        }

        return false;
    }
public function isQuestion($string)
    {
        $probability = 0;

        if (strpos($string, '?')) {
            $probability += 1;
        }

        $words = $this->getWords($string);

        foreach ($this->inquiryWords as $queryWord) {
            if (!strncmp(strtolower($string), $queryWord, strlen($queryWord))) {
                $probability += 1;
            } elseif (stristr(strtolower($string), $queryWord)) {
                $probability += 0.5;
            }
        }

        if ($probability >= 2) {
            return true;
        }

        return false;
    }
public function isQuestion ( $ string ) { $ probability = 0 ; if ( strpos ( $ string , '?' ) ) { $ probability += 1 ; } $ words = $ this -> getWords ( $ string ) ; foreach ( $ this -> inquiryWords as $ queryWord ) { if ( ! strncmp ( strtolower ( $ string ) , $ queryWord , strlen ( $ queryWord ) ) ) { $ probability += 1 ; } elseif ( stristr ( strtolower ( $ string ) , $ queryWord ) ) { $ probability += 0.5 ; } } if ( $ probability >= 2 ) { return true ; } return false ; }
Check if string is question.

@param string $string

@return bool
Check if string is question .