array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.pspell-config-create.php', 1 => 'pspell_config_create', ), 'up' => array ( 0 => 'ref.pspell.php', 1 => 'Pspell 関数', ), 'prev' => array ( 0 => 'function.pspell-clear-session.php', 1 => 'pspell_clear_session', ), 'next' => array ( 0 => 'function.pspell-config-data-dir.php', 1 => 'pspell_config_data_dir', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/pspell/functions/pspell-config-create.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)
pspell_config_create — 辞書をオープンする際に使用する設定を作成する
$language
,$spelling
= "",$jargon
= "",$encoding
= ""辞書をオープンする際に使用する設定を作成します。
pspell_config_create() は、 pspell_new() の構文に非常によく似ています。実際、 pspell_new_config() の直後に pspell_config_create() を使用した場合、全く同じ 結果となります。しかし、新しい設定を作成した後、 pspell_new_config() をコールする前に関数 pspell_config_*() を使用することで いくつかの進んだ機能が使用できます。
より詳細な情報と例については、pspell Web サイト » http://aspell.net/ のオンラインマニュアルを参照ください。
language
パラメータ language は、2 文字の ISO 639 言語コードと オプションでダッシュまたはアンダースコアの後に 2 文字の ISO 3166 国コードからなる言語コードです。
spelling
パラメータ spelling は、英語のように複数のスペルがある言語に関して スペルの指定を行うものです。指定可能な値は、 'american', 'british', 'canadian'です。
jargon
パラメータ jargon は、同じ language および spelling パラメータを有する 2 つの異なる単語リストを区別するための 追加情報を有しています。
encoding
パラメータ encoding は、単語のエンコーディングとして 予想されるものです。有効な値は、'utf-8', 'iso8859-*', 'koi8-r', 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned 32' です。このパラメータはよくテストされていないため、 使用する際には注意してください。
PSpell\Config クラスのインスタンスを返します。
バージョン | 説明 |
---|---|
8.1.0 | PSpell\Config クラスのインスタンスを返すようになりました。 これより前のバージョンでは、リソース を返していました。 |
例1 pspell_config_create()
<?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_personal($pspell_config, "en");
?>