public function __construct(DataSourceInterface $dataSource, SVMModel $model = null, Document\NormalizerInterface $documentNormalizer = null, TokenizerInterface $tokenizer = null, Token\NormalizerInterface $tokenNormalizer = null, \SVM $svm = null, $threshold = null)
{
$this->dataSource = $dataSource;
$this->model = $model ?: new SVMModel();
$this->documentNormalizer = $documentNormalizer ?: new Document\Lowercase();
$this->tokenizer = $tokenizer ?: new Word();
$this->tokenNormalizer = $tokenNormalizer;
if (!$svm) {
$svm = new \SVM();
$svm->setOptions(array(\SVM::OPT_KERNEL_TYPE => \SVM::KERNEL_LINEAR));
}
$this->svm = $svm;
if ($threshold) {
$this->setThreshold($threshold);
}
}