Camspiers\StatisticalClassifier\Classifier\ComplementNaiveBayes::__construct PHP Méthode

__construct() public méthode

Create the Naive Bayes Classifier
public __construct ( Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $dataSource, Camspiers\StatisticalClassifier\Model\ModelInterface $model = null, Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface $documentNormalizer = null, Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface $tokenizer = null, Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface $tokenNormalizer = null )
$dataSource Camspiers\StatisticalClassifier\DataSource\DataSourceInterface
$model Camspiers\StatisticalClassifier\Model\ModelInterface An model to store data in
$documentNormalizer Camspiers\StatisticalClassifier\Normalizer\Document\NormalizerInterface The normalizer to make document consistent
$tokenizer Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface The tokenizer to break up the documents
$tokenNormalizer Camspiers\StatisticalClassifier\Normalizer\Token\NormalizerInterface The normaizer to make tokens consistent
    public function __construct(DataSourceInterface $dataSource, ModelInterface $model = null, Document\NormalizerInterface $documentNormalizer = null, TokenizerInterface $tokenizer = null, Token\NormalizerInterface $tokenNormalizer = null)
    {
        $this->dataSource = $dataSource;
        $this->model = $model ?: new Model();
        $this->documentNormalizer = $documentNormalizer ?: new Document\Lowercase();
        $this->tokenizer = $tokenizer ?: new Word();
        $this->tokenNormalizer = $tokenNormalizer;
    }