public function testsimpleAnalyze() { //TODO benchmark for ($i = 0; $i < 1000; $i++) { Analyzer::analyze($this->getPseudoRandomWord(), true); $it = ++static::$iterations; echo "iterated {$it} times...\n"; } }
private function doNextCase() { $case = $this->testCases[static::$nextCase++]; $num = static::$nextCase; $label = Analyzer::analyze($case['txt'], true)->label; $expected = $case['expected']; echo "\n{$num}. got {$label}; expected {$expected}\n"; $this->assertTrue($label == $case['expected']); }
private static function analyzePayload($payload) { $analyzedPosts = array(); $decodedPayload = json_decode($payload); $posts = $decodedPayload->posts; foreach ($posts as $post) { $feeling = Analyzer::analyze($post->text); $analyzed = (object) array('id' => $post->id, 'feeling' => $feeling, 'tags' => $post->tags); $analyzedPosts[] = $analyzed; } return $analyzedPosts; }
public function testAnalyzer() { $result = Analyzer::analyze("Guns are awesome"); dd($result); return "Testing functions"; }