for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* AnalyzerText package.
*
* @author Peter Gribanov <[email protected]>
*/
namespace AnalyzerText\Analyzer;
use AnalyzerText\Text;
use AnalyzerText\Filter\Factory;
* Базовый класс для анализаторов текста.
abstract class Analyzer
{
* @var Text
protected $text;
* Устанавливает аналезируемый текст
* @param Text $text
* @return Analyzer
public function setText(Text $text)
$this->clear();
$this->text = $text;
return $this;
}
* Возвращает список слов.
* @return Text
public function getText()
return $this->text;
* Очищает анализатор
public function clear()
$this->text = null;
* Возвращает фабрику фильтров для применения их.
* @return Factory
public function applyFilters()
return new Factory($this);