Oihana PHP Arango

NormAnalyzer implements AnalyzerOptions

Read onlyYes

Locale-aware normaliser. Lower-cases / upper-cases the input and optionally strips diacritics.

Does NOT tokenise — use TextAnalyzer when word-boundary tokenisation is needed.

Example:

$db->createAnalyzer
(
    'norm_en' ,
    new NormAnalyzer( locale : 'en' , accent : false ) ,
) ;
Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Interfaces

AnalyzerOptions
Common contract for every analyzer definition consumable by {@see \oihana\arango\clients\Database::createAnalyzer()} and {@see Analyzer::create()}.

Properties

$accent  : bool|null
$case  : string|null
$locale  : string

Methods

__construct()  : mixed
toArray()  : array<string, mixed>
Returns the `{ type, properties }` fragment of a `POST /_api/analyzer` body corresponding to this analyzer definition.

Properties

Methods

__construct()

public __construct(string $locale[, string|null $case = null ][, bool|null $accent = null ]) : mixed
Parameters
$locale : string

BCP 47 / ICU locale tag (e.g. "en", "fr.utf-8").

$case : string|null = null

Case folding strategy ("lower", "upper", "none"). Defaults to server's "lower".

$accent : bool|null = null

Whether to keep diacritics. Defaults to server's false (accents removed).

toArray()

Returns the `{ type, properties }` fragment of a `POST /_api/analyzer` body corresponding to this analyzer definition.

public toArray() : array<string, mixed>
Tags
inheritDoc
Return values
array<string, mixed>
On this page

Search results