This shows you the differences between two versions of the page.
20220614 [2022/06/14 00:17] admin created |
20220614 [2022/06/14 00:18] (current) admin |
||
---|---|---|---|
Line 2: | Line 2: | ||
public function calculatePercentage(ScoreSet $scoreSet, $score_type = 'positive'): float | public function calculatePercentage(ScoreSet $scoreSet, $score_type = 'positive'): float | ||
{ | { | ||
- | $countAllScores = $scoreSet->getScores()->count(); | ||
$sentiment_to_type['positive'] = 1; | $sentiment_to_type['positive'] = 1; | ||
$sentiment_to_type['neutral'] = 0; | $sentiment_to_type['neutral'] = 0; | ||
$sentiment_to_type['negative'] = -1; | $sentiment_to_type['negative'] = -1; | ||
+ | | ||
+ | $countAllScores = $scoreSet->getScores()->count(); | ||
$result = $this->filterScoresBySentiment($scoreSet, $sentiment_to_type[$score_type]); | $result = $this->filterScoresBySentiment($scoreSet, $sentiment_to_type[$score_type]); | ||
if($result > 0) | if($result > 0) |