You are here

protected function Tokenizer::prepare in Search API 8

Prepares the processor by setting the $spaces property.

2 calls to Tokenizer::prepare()
Tokenizer::process in src/Plugin/search_api/processor/Tokenizer.php
Processes a single string value.
Tokenizer::processFieldValue in src/Plugin/search_api/processor/Tokenizer.php
Processes a single text element in a field.

File

src/Plugin/search_api/processor/Tokenizer.php, line 342

Class

Tokenizer
Splits text into individual words for searching.

Namespace

Drupal\search_api\Plugin\search_api\processor

Code

protected function prepare() {
  if (!isset($this->spaces)) {
    if ($this->configuration['spaces'] !== '') {
      $this->spaces = str_replace('/', '\\/', $this->configuration['spaces']);
    }
    else {
      $this->spaces = Unicode::PREG_CLASS_WORD_BOUNDARY;
    }
  }
  if (!isset($this->ignored)) {
    if ($this->configuration['ignored'] !== '') {
      $this->ignored = str_replace('/', '\\/', $this->configuration['ignored']);
    }
    else {
      $this->ignored = '._-';
    }
  }
}