/**
  * @dataProvider textByLanguageProvider
  */
 public function testByLanguage($languageCode, $text, $expected)
 {
     $stopwordAnalyzer = new StopwordAnalyzer();
     $stopwordAnalyzer->loadListByLanguage($languageCode);
     $sanitizer = new Sanitizer($text);
     $sanitizer->toLowercase();
     $string = $sanitizer->sanitizeBy($stopwordAnalyzer);
     $this->assertEquals($expected, $string);
 }
Exemple #2
0
 public function testTrySanitizeByStopwordsForNoAvailableToken()
 {
     $instance = new Sanitizer('');
     $stopwordAnalyzer = new StopwordAnalyzer();
     $this->assertEquals('', $instance->sanitizeBy($stopwordAnalyzer));
 }