pspell_suggest

単語のスペルについて修正候補を示す

説明

arrayfalse pspell_suggest(PSpell\Dictionary $dictionary, string $word)

pspell_suggest は、 指定した単語について可能性のあるスペルの配列を返します。

パラメータ

dictionary

PSpell\Dictionary クラスのインスタンス。

word

調べたい単語。

戻り値

修正候補の配列を返します。

変更履歴

バージョン 説明
8.1.0 引数 dictionary は、PSpell\Dictionary クラスのインスタンスを期待するようになりました。 これより前のバージョンでは、リソース を期待していました。

例1 pspell_suggest の例

<?php
$pspell 
pspell_new("en");

if (!
pspell_check($pspell"testt")) {
    
$suggestions pspell_suggest($pspell"testt");

    foreach (
$suggestions as $suggestion) {
        echo 
"Possible spelling: $suggestion<br />";
    }
}
?>