public function leastCheck(float $valence, array $tokens, int $index) : float
    {
        if($index === 0) {
            return $valence;
        }
        
        $inLexicon = isset($this->getLexicon()[strtolower($tokens[$index-1])]);
        
        if($inLexicon) {
            return $valence;                       
        }
        
        $leastIndex = array_searchi('least', $tokens);
        $atIndex = array_searchi('at', $tokens);
        $veryIndex = array_searchi('very', $tokens);
        
        if($leastIndex == $index-1 && $atIndex != $index-2 && $veryIndex != $index-2) {
            $valence *= self::N_SCALAR;
        } elseif( $leastIndex == $index-1) {
            $valence *= self::N_SCALAR;
        }
        
        return $valence;  
    }
public function leastCheck(float $valence, array $tokens, int $index) : float
    {
        if($index === 0) {
            return $valence;
        }
        
        $inLexicon = isset($this->getLexicon()[strtolower($tokens[$index-1])]);
        
        if($inLexicon) {
            return $valence;                       
        }
        
        $leastIndex = array_searchi('least', $tokens);
        $atIndex = array_searchi('at', $tokens);
        $veryIndex = array_searchi('very', $tokens);
        
        if($leastIndex == $index-1 && $atIndex != $index-2 && $veryIndex != $index-2) {
            $valence *= self::N_SCALAR;
        } elseif( $leastIndex == $index-1) {
            $valence *= self::N_SCALAR;
        }
        
        return $valence;  
    }
public function leastCheck ( float $ valence , array $ tokens , int $ index ) : float { if ( $ index === 0 ) { return $ valence ; } $ inLexicon = isset ( $ this -> getLexicon ( ) [ strtolower ( $ tokens [ $ index - 1 ] ) ] ) ; if ( $ inLexicon ) { return $ valence ; } $ leastIndex = array_searchi ( 'least' , $ tokens ) ; $ atIndex = array_searchi ( 'at' , $ tokens ) ; $ veryIndex = array_searchi ( 'very' , $ tokens ) ; if ( $ leastIndex == $ index - 1 && $ atIndex != $ index - 2 && $ veryIndex != $ index - 2 ) { $ valence *= self :: N_SCALAR ; } elseif ( $ leastIndex == $ index - 1 ) { $ valence *= self :: N_SCALAR ; } return $ valence ; }
check for negation case using "least"
@param float $valence
@param array $tokens
@param int $index
@return float
check for negation case using least