src/SentimentAnalysis.php
/**
     * Get the sentiment of a phrase.
     *
     * @param string $string The given sentence
     *
     * @return string Possible values: negative|neutral|positive
     */
Get the sentiment of a phrase.
@param string $string The given sentence

@return string Possible values: negative|neutral|positive
Get the sentiment of a phrase . @param string $string The given sentence @return string Possible values : negative|neutral|positive
public function decision($string)
    {
        $dominantClass = $this->sentiment->categorise($string);
        switch ($dominantClass) {
            case 'neg':
                return self::NEGATIVE;
            case 'neu':
                return self::NEUTRAL;
            case 'pos':
                return self::POSITIVE;
        }
    }
public function decision ( $ string ) { $ dominantClass = $ this -> sentiment -> categorise ( $ string ) ; switch ( $ dominantClass ) { case 'neg' : return self :: NEGATIVE ; case 'neu' : return self :: NEUTRAL ; case 'pos' : return self :: POSITIVE ; } }
Get the sentiment of a phrase.
Get the sentiment of a phrase .
// Do not call functions so that we'll compute only one time