-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Tests\Unit; | ||
|
||
use Tests\TestCase; | ||
|
||
class AfinnTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function get_neighbours() | ||
{ | ||
$nlp = new \Web64\Nlp\NlpClient( $this->nlpserver_config['hosts'], $this->nlpserver_config['debug'] ); | ||
|
||
$text = "This is great fantastic stuff!"; | ||
$score = $nlp->afinn_sentiment( $text, 'en'); | ||
|
||
$this->msg( "{$text}\nSCORE: {$score}" ); | ||
$this->assertGreaterThan(0, $score, "Positive text not greater than zero"); | ||
|
||
|
||
|
||
$text = "This is horrible and aweful disgusting bad crap!"; | ||
$score = $nlp->afinn_sentiment( $text, 'en'); | ||
|
||
$this->msg( "{$text}\nSCORE: {$score}" ); | ||
$this->assertLessThan(0, $score, "Negative text not less than zero"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters