File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,9 @@ function annotation_to_string(Annotation $annotation)
35
35
36
36
if (isset ($ info ['documentSentiment ' ])) {
37
37
$ magnitude = $ info ['documentSentiment ' ]['magnitude ' ];
38
- $ polarity = $ info ['documentSentiment ' ]['polarity ' ];
39
- if ($ polarity < 0 ) {
40
- $ magnitude = -$ magnitude ;
41
- }
42
- $ ret .= sprintf ('sentiment: %s ' . PHP_EOL , $ magnitude );
38
+ $ score = $ info ['documentSentiment ' ]['score ' ];
39
+ $ ret .= sprintf ('sentiment magnitude: %s score: %s ' . PHP_EOL ,
40
+ $ magnitude , $ score );
43
41
}
44
42
45
43
if (isset ($ info ['sentences ' ])) {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testSentiment()
57
57
);
58
58
59
59
$ output = $ this ->commandTester ->getDisplay ();
60
- $ this ->assertRegExp ('/sentiment: / ' , $ output );
60
+ $ this ->assertRegExp ('/sentiment/ ' , $ output );
61
61
}
62
62
63
63
public function testSentimentFromStorageObject ()
You can’t perform that action at this time.
0 commit comments