Forum und email

enchant_dict_suggest

(PECL enchant:0.1-1.0.1)

enchant_dict_suggest — 修正候補となる値の一覧を返す

説明

array enchant_dict_suggest ( resource $dict , string $word )

パラメータ

dict

辞書リソース。

word

修正候補を調べる単語。

返り値

単語のスペルが間違っている場合に、修正候補の配列を返します。

Example#1 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);

    
$spellerrors enchant_dict_check($d"soong");
    echo 
"found $spellerrors spell errors\n";
    if (
$spellerrors) {
        
$suggs enchant_dict_suggest($d"soong");
        echo 
"'soong' の修正候補:";
        
print_r($suggs);
    }
    
enchant_broker_free_dict($d);
}
enchant_broker_free($r);
?>