Php/docs/function.enchant-dict-add-to-personal

提供:Dev Guides
< Php
移動先:案内検索

enchant_dict_add_to_personal

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

enchant_dict_add_to_personalパーソナル単語リストに単語を追加する


説明

enchant_dict_add_to_personal ( EnchantDictionary $dictionary , string $word ) : void

指定した辞書のパーソナル単語リストに、単語を追加します。


パラメータ

dictionary
enchant_broker_request_dict() または enchant_broker_request_pwl_dict() によって返される Enchant 辞書。
word
追加する単語。


返り値

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


変更履歴

バージョン 説明
8.0.0 dictionary は、EnchantDictionary クラスのインスタンスを期待するようになりました。

これより前のバージョンでは、リソース が期待されていました。


例1 PWL への単語の追加

<?php$filename = './my_word_list.pwl';$word = 'Supercalifragilisticexpialidocious';$broker = enchant_broker_init();$dict = enchant_broker_request_pwl_dict($broker, $filename);enchant_dict_add_to_personal($dict, $word);enchant_broker_free($broker);?>

参考