Contao Utils Bundle

NormalizerInterface

Unifies different spellings of the same word before stemming, e.g. "Muenchen" and "München".

Implementations are registered automatically when autoconfigured and can be selected per table with SearchVectorFieldConfiguration::setNormalizer(). The service id is usually the class name.

Table of Contents

Constants

TAG  = 'huh_utils.search_vector.normalizer'

Methods

normalize()  : string

Constants

Methods

normalize()

public normalize(string $word, string $locale) : string
Parameters
$word : string

Lowercased and trimmed, accents are kept (they are stripped after stemming)

$locale : string

The language of the word as locale ID or language tag, e.g. "de", "de_CH" or "de-CH". Return the word unchanged for languages the normalizer does not support.

Return values
string

        
On this page

Search results