Documentation

LetterPairProfile

The letter pairs of a term, in both its raw and its phonetic spelling.

Built by SimilarityCalculator::profile(). Holding both sets together lets a term be profiled once and then compared many times, and lets a comparison subtract the parts of a term that have already been explained.

Tags
since
3.5.0

Table of Contents

Properties

$chars  : array<int, string>
Letter pairs of the term as written.
$phonetics  : array<int, string>
Letter pairs of the phonetically normalized term.

Methods

__construct()  : mixed
Constructor.
chars()  : array<int, string>
Letter pairs of the term as written.
isEmpty()  : bool
Whether the profile carries no pairs at all.
minus()  : self
The pairs of this profile that the other profile does not account for.
phonetics()  : array<int, string>
Letter pairs of the phonetically normalized term.

Properties

$chars

Letter pairs of the term as written.

private array<int, string> $chars

$phonetics

Letter pairs of the phonetically normalized term.

private array<int, string> $phonetics

Methods

__construct()

Constructor.

public __construct(array<int, string> $chars, array<int, string> $phonetics) : mixed
Parameters
$chars : array<int, string>

Letter pairs as written

$phonetics : array<int, string>

Letter pairs after phonetic normalization

chars()

Letter pairs of the term as written.

public chars() : array<int, string>
Return values
array<int, string>

isEmpty()

Whether the profile carries no pairs at all.

public isEmpty() : bool
Return values
bool

minus()

The pairs of this profile that the other profile does not account for.

public minus(self $other) : self

Used to shrink a term to the part no suggestion has explained yet.

Parameters
$other : self

Profile to subtract

Return values
self

phonetics()

Letter pairs of the phonetically normalized term.

public phonetics() : array<int, string>
Return values
array<int, string>
On this page

Search results