enchant_dict_suggest

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

enchant_dict_suggestSuggère des orthographes pour un mot

Description

function 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 resource é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);
    }
}
?>

Voir aussi

add a note

User Contributed Notes

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