Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/TermExtractor/TermExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,24 @@ class TermExtractor {
const SEARCH = 0;
const NOUN = 1;

public $tagger;
public $filter;
protected $tagger;
protected $filter;

public function __construct(Tagger $tagger = null, FilterInterface $filter = null) {
$this->setTagger($tagger);
$this->setFilter($filter);
}

public function setTagger(Tagger $tagger = null) {
if ($tagger === null) {
$this->tagger = new Tagger();
$this->tagger->initialize();
} else {
$this->tagger = $tagger;
}
}

public function setFilter(FilterInterface $filter = null) {
if ($filter === null) {
$this->filter = new DefaultFilter();
} else {
Expand Down