src/Sentiment/Vader.php
/**
     * 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'
@param array $tokens
@param array $sentiments
@return array|real
check for modification in sentiment due to contrastive conjunction ' but ' @param array $tokens @param array $sentiments @return array|real
public function butCheck(array $tokens, array $sentiments)
    {
        $index = array_searchi('but', $tokens);
        if($index === false) {
            return $sentiments;
        }
        for($i = 0, $iMax = count($sentiments); $i < $iMax; $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 ) ; if ( $ index === false ) { return $ sentiments ; } for ( $ i = 0 , $ iMax = count ( $ sentiments ) ; $ i < $ iMax ; $ 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 ' @param array $tokens @param array $sentiments @return array|real
// no modification required