pspell_add_to_personal
ユーザーの単語リストに単語を追加する
説明
bool pspell_add_to_personal(PSpell\Dictionary $dictionary, string $word)
pspell_add_to_personal はユーザーの単語リスト
に単語を追加します。ディレクトリをオープンするために
pspell_new_config を
pspell_config_personal とともに使用した場合、
pspell_save_wordlist で単語リストを保存することが可能です。
パラメータ
-
dictionary
-
PSpell\Dictionary クラスのインスタンス。
-
word
-
追加する単語。
戻り値
成功した場合に true を、失敗した場合に false を返します。
例
例1 pspell_add_to_personal
<?php
$pspell_config = pspell_config_create("en");
pspell_config_personal($pspell_config, "/var/dictionaries/custom.pws");
$pspell = pspell_new_config($pspell_config);
pspell_add_to_personal($pspell, "Vlad");
pspell_save_wordlist($pspell);
?>
注意
注意:
この関数は、pspell .11.2 と aspell .32.5
以降でない限り動作しないことに注意してください。