示例#1
0
 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);
 }
示例#2
0
 public function getIndex()
 {
     $indexer = new TNTIndexer();
     $indexer->inMemory = false;
     $indexer->setIndex($this->index);
     $indexer->setStemmer($this->stemmer);
     return $indexer;
 }