Skip to content

Commit f50d69e

Browse files
committed
sentiment language
1 parent bff9c53 commit f50d69e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NlpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public function readability_html( $html )
104104
/**
105105
* Sentiment Analysis by Polyglot
106106
*/
107-
public function sentiment( $text )
107+
public function sentiment( $text, $language = null )
108108
{
109-
$data = $this->post_call('/polyglot/sentiment', ['text' => $text ] );
109+
$data = $this->post_call('/polyglot/sentiment', ['text' => $text, 'lang' => $language ] );
110110

111111
return ( isset($data['sentiment']) ) ? $data['sentiment'] : null;
112112
}

0 commit comments

Comments
 (0)