CakeFest 2024: The Official CakePHP Conference

pspell_config_repl

(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)

pspell_config_repl置換候補を保持するファイルを設定する

説明

pspell_config_repl(PSpell\Config $config, string $filename): bool

置換候補を保持するファイルを設定します。

置換の組は、スペルチェッカの品質を改善します。 単語のスペルミスをした場合、そして、適当な修正候補がリストにあった場合、 pspell_store_replacement() を置換候補を保存するために使用し、置換候補を含む単語リストを保存するために pspell_save_wordlist()を使用することが可能です。

pspell_config_repl() は、 pspell_new_config() をコールする前に設定を行うために使用する必要があります。

パラメータ

config

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

filename

このファイルは PHP の実行ユーザー (たとえば nobody) が書き込み可能である必要があります。

戻り値

成功した場合に true を、失敗した場合に false を返します。

変更履歴

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

例1 pspell_config_repl()

<?php
$pspell_config
= pspell_config_create("en");
pspell_config_personal($pspell_config, "/var/dictionaries/custom.pws");
pspell_config_repl($pspell_config, "/var/dictionaries/custom.repl");
$pspell = pspell_new_config($pspell_config);
pspell_check($pspell, "thecat");
?>

注意

注意:

この関数は、pspell .11.2 および aspell .32.5 以降でない限り動作しないことに注意してください。

add a note

User Contributed Notes

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