CakeFest 2024: The Official CakePHP Conference

enchant_dict_add

(PHP 8)

enchant_dict_add単語リストに単語を追加する

説明

enchant_dict_add(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 辞書リストに単語を追加する

<?php

$filename
= './my_word_list.pwl';
$word = 'Supercalifragilisticexpialidocious';

$broker = enchant_broker_init();
$dict = enchant_broker_request_pwl_dict($broker, $filename);

enchant_dict_add($dict, $word);

enchant_broker_free($broker);

?>

参考

add a note

User Contributed Notes

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