private function loadSpellingType(RequestInterface $request)
    {
        $spellingType = self::SPELLING_TYPE_FUZZY;

        try {
            $cutoffFrequencyLimit = $this->getCutoffrequencyLimit($request);
            $termVectors          = $this->getTermVectors($request);
            $queryTermStats       = $this->parseTermVectors($termVectors, $cutoffFrequencyLimit);

            if ($queryTermStats['total'] == $queryTermStats['stop']) {
                $spellingType = self::SPELLING_TYPE_PURE_STOPWORDS;
            } elseif ($queryTermStats['total'] == $queryTermStats['stop'] + $queryTermStats['exact']) {
                $spellingType = self::SPELLING_TYPE_EXACT;
            } elseif ($queryTermStats['missing'] == 0) {
                $spellingType = self::SPELLING_TYPE_MOST_EXACT;
            } elseif ($queryTermStats['total'] - $queryTermStats['missing'] > 0) {
                $spellingType = self::SPELLING_TYPE_MOST_FUZZY;
            }
        } catch (\Exception $e) {
            $spellingType = self::SPELLING_TYPE_EXACT;
        }

        return $spellingType;
    }
private function loadSpellingType(RequestInterface $request)
    {
        $spellingType = self::SPELLING_TYPE_FUZZY;

        try {
            $cutoffFrequencyLimit = $this->getCutoffrequencyLimit($request);
            $termVectors          = $this->getTermVectors($request);
            $queryTermStats       = $this->parseTermVectors($termVectors, $cutoffFrequencyLimit);

            if ($queryTermStats['total'] == $queryTermStats['stop']) {
                $spellingType = self::SPELLING_TYPE_PURE_STOPWORDS;
            } elseif ($queryTermStats['total'] == $queryTermStats['stop'] + $queryTermStats['exact']) {
                $spellingType = self::SPELLING_TYPE_EXACT;
            } elseif ($queryTermStats['missing'] == 0) {
                $spellingType = self::SPELLING_TYPE_MOST_EXACT;
            } elseif ($queryTermStats['total'] - $queryTermStats['missing'] > 0) {
                $spellingType = self::SPELLING_TYPE_MOST_FUZZY;
            }
        } catch (\Exception $e) {
            $spellingType = self::SPELLING_TYPE_EXACT;
        }

        return $spellingType;
    }
private function loadSpellingType ( RequestInterface $ request ) { $ spellingType = self :: SPELLING_TYPE_FUZZY ; try { $ cutoffFrequencyLimit = $ this -> getCutoffrequencyLimit ( $ request ) ; $ termVectors = $ this -> getTermVectors ( $ request ) ; $ queryTermStats = $ this -> parseTermVectors ( $ termVectors , $ cutoffFrequencyLimit ) ; if ( $ queryTermStats [ 'total' ] == $ queryTermStats [ 'stop' ] ) { $ spellingType = self :: SPELLING_TYPE_PURE_STOPWORDS ; } elseif ( $ queryTermStats [ 'total' ] == $ queryTermStats [ 'stop' ] + $ queryTermStats [ 'exact' ] ) { $ spellingType = self :: SPELLING_TYPE_EXACT ; } elseif ( $ queryTermStats [ 'missing' ] == 0 ) { $ spellingType = self :: SPELLING_TYPE_MOST_EXACT ; } elseif ( $ queryTermStats [ 'total' ] - $ queryTermStats [ 'missing' ] > 0 ) { $ spellingType = self :: SPELLING_TYPE_MOST_FUZZY ; } } catch ( \ Exception $ e ) { $ spellingType = self :: SPELLING_TYPE_EXACT ; } return $ spellingType ; }
Compute the spelling time using the engine.

@param RequestInterface $request Spellchecking request.

@return integer
Compute the spelling time using the engine .