« enchant_broker_set_ordering
enchant_dict_add_to_personal »

enchant_dict_add

(PHP 8)

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

説明

function 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 クラスのインスタンスを期待するようになりました。 これより前のバージョンでは、resource が期待されていました。

例

例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   dict   単語   broker   辞書   request   dictionary   Enchant   EnchantDictionary   期待   filename   ordering   personal   成功   履歴   インスタンス   resource   list   Supercalifragilisticexpialidocious   init   参考   タグ
関連する関数・ページ:
function.enchant-broker-request-pwl-dict   function.enchant-dict-is-added   function.enchant-dict-add-to-session   ref.enchant   function.enchant-dict-remove-from-session   function.enchant-dict-check