isStopWord() public method

public isStopWord ( string $token ) : boolean
$token string
return boolean
Example #1
0
 public function testCustomStopWords()
 {
     $stopWords = new StopWords(['lorem', 'ipsum', 'dolor']);
     $this->assertTrue($stopWords->isStopWord('lorem'));
     $this->assertTrue($stopWords->isStopWord('ipsum'));
     $this->assertTrue($stopWords->isStopWord('dolor'));
     $this->assertFalse($stopWords->isStopWord('consectetur'));
     $this->assertFalse($stopWords->isStopWord('adipiscing'));
     $this->assertFalse($stopWords->isStopWord('amet'));
 }
Example #2
0
 /**
  * @param string $token
  *
  * @return bool
  */
 private function isStopWord(string $token) : bool
 {
     return $this->stopWords && $this->stopWords->isStopWord($token);
 }