CakeFest 2024: The Official CakePHP Conference

enchant_dict_suggest

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL enchant >= 0.1.0 )

enchant_dict_suggestRetourne une liste de valeurs si aucunes des conditions ne sont réunies

Description

enchant_dict_suggest(EnchantDictionary $dictionary, string $word): array

Liste de paramètres

dictionary

Un dictionnaire Enchant retourné par enchant_broker_request_dict() ou enchant_broker_request_pwl_dict().

word

Mot à utiliser pour les suggestions

Valeurs de retour

Retourne un tableau de suggestions si le mot est mal orthographié.

Historique

Version Description
8.0.0 dictionary attend désormais une instance de EnchantDictionary ; auparavant, une ressource était attendu.

Exemples

Exemple #1 Exemple avec enchant_dict_suggest()

<?php
$tag
= 'en_US';
$r = enchant_broker_init();
if (
enchant_broker_dict_exists($r,$tag)) {
$d = enchant_broker_request_dict($r, $tag);

$wordcorrect = enchant_dict_check($d, "soong");
if (!
$wordcorrect) {
$suggs = enchant_dict_suggest($d, "soong");
echo
"Suggestions pour 'soong' : ";
print_r($suggs);
}
enchant_broker_free_dict($d);
}
enchant_broker_free($r);
?>

Voir aussi

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top