public function butCheck(array $tokens, array $sentiments)
    {
        $index = array_searchi('but', $tokens);
        // no modification required
        if($index === false) {
            return $sentiments;
        }
        
        for($i = 0; $i < count($sentiments); $i++)
        {
            if( $index < $i) {
                $sentiments[$i] *= 0.5;
            } elseif($index > $i) {
                $sentiments[$i] *= 1.5;
            }
        }
        return $sentiments;
    }
public function butCheck(array $tokens, array $sentiments)
    {
        $index = array_searchi('but', $tokens);
        // no modification required
        if($index === false) {
            return $sentiments;
        }
        
        for($i = 0; $i < count($sentiments); $i++)
        {
            if( $index < $i) {
                $sentiments[$i] *= 0.5;
            } elseif($index > $i) {
                $sentiments[$i] *= 1.5;
            }
        }
        return $sentiments;
    }
public function butCheck ( array $ tokens , array $ sentiments ) { $ index = array_searchi ( 'but' , $ tokens ) ; // no modification required if ( $ index === false ) { return $ sentiments ; } for ( $ i = 0 ; $ i < count ( $ sentiments ) ; $ i ++ ) { if ( $ index < $ i ) { $ sentiments [ $ i ] *= 0.5 ; } elseif ( $ index > $ i ) { $ sentiments [ $ i ] *= 1.5 ; } } return $ sentiments ; }
check for modification in sentiment due to contrastive conjunction 'but'
@param array $tokens
@param array $sentiments
@return array|real
check for modification in sentiment due to contrastive conjunction but