Skip to content

Commit

Permalink
upgrade to php-nlp v0.40
Browse files Browse the repository at this point in the history
  • Loading branch information
web64 committed Aug 2, 2018
1 parent 5e7672d commit 2551dd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Laravel package for accessing NLP tools",
"type": "library",
"require": {
"web64/php-nlp-client": "^0.30",
"web64/php-nlp-client": "^0.40",
"lsmonki/php-open-calais": "^2.1",
"stichoza/google-translate-php": "~3.2"
},
Expand Down
15 changes: 8 additions & 7 deletions src/LaravelNlp/LaravelNlp.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ public function translate($text, $source_lang = null, $target_lang = null)
return $translator->translate( $text );
}

public function sentiment( $text, $language = 'en' )
{
$response = $this->polyglot($text, $language);
// public function sentiment( $text, $language = 'en' )
// {
// $response = $this->sentiment($text, $language);

if ( $response )
return $response->getSentiment();
// if ( $response )
// return $response->getSentiment();

}
// }

public function entities( $text, $language = 'en' )
{
$response = $this->polyglot($text, $language);
$response = $this->polyglot_entities($text, $language);

if ( $response )
return $response->getEntities();
Expand Down

0 comments on commit 2551dd3

Please sign in to comment.