public function testSetTokenizer() { $someTokenizer = new SomeTokenizer(); $indexer = new TNTIndexer(); $indexer->setTokenizer($someTokenizer); $this->assertInstanceOf(TokenizerInterface::class, $indexer->tokenizer); $res = $indexer->breakIntoTokens('Canon 70-200'); $this->assertContains("canon", $res); $this->assertContains("70-200", $res); }
public function getIndex() { $indexer = new TNTIndexer(); $indexer->inMemory = false; $indexer->setIndex($this->index); $indexer->setStemmer($this->stemmer); return $indexer; }