PHP Class Bravo3\Orm\Services\ScoreNormaliser

Afficher le fichier Open project: bravo3/orm

Méthodes publiques

Méthode Description
score ( mixed $item ) : float Return the score using the best scoring match for the given item
scoreArray ( array $item ) : float Return the score of an array, by counting its elements
scoreDateTime ( DateTime $item ) : float Return the score of a DateTime object
scoreNumber ( integer | float $item ) : float Return the score of a number
scoreObject ( object | Bravo3\Orm\Traits\ScorableInterface $item ) : float Return the score of an object
scoreString ( string $item ) : float Return the score of a string as a numeric representation

Méthodes protégées

Méthode Description
getCharacterScore ( string $c ) : string | null Get the score of a character as a 2-char string

Method Details

getCharacterScore() protected méthode

Returns null if the character is not a non-printable ASCII char
protected getCharacterScore ( string $c ) : string | null
$c string
Résultat string | null

score() public méthode

Return the score using the best scoring match for the given item
public score ( mixed $item ) : float
$item mixed
Résultat float

scoreArray() public méthode

Return the score of an array, by counting its elements
public scoreArray ( array $item ) : float
$item array
Résultat float

scoreDateTime() public méthode

Return the score of a DateTime object
public scoreDateTime ( DateTime $item ) : float
$item DateTime
Résultat float

scoreNumber() public méthode

Return the score of a number
public scoreNumber ( integer | float $item ) : float
$item integer | float
Résultat float

scoreObject() public méthode

Return the score of an object
public scoreObject ( object | Bravo3\Orm\Traits\ScorableInterface $item ) : float
$item object | Bravo3\Orm\Traits\ScorableInterface
Résultat float

scoreString() public méthode

Return the score of a string as a numeric representation
public scoreString ( string $item ) : float
$item string
Résultat float