PHP Conference Japan 2024

pspell_config_repl

(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)

pspell_config_repl設定包含取代配對的檔案

說明

pspell_config_repl(PSpell\Config $config, string $filename): bool

設定包含取代配對的檔案。

取代配對可以提升拼寫檢查器的品質。當一個單字拼錯,且在列表中找不到合適的建議時,可以使用 pspell_store_replacement() 儲存取代配對,然後使用 pspell_save_wordlist() 儲存單字列表以及取代配對。

在呼叫 pspell_new_config() 之前,應該在配置上使用 pspell_config_repl()

參數

config

一個 PSpell\Config 實例。

filename

該檔案應可被 PHP 運行程式 (例如 nobody) 寫入。

返回值

成功時返回 true,失敗時返回 false

更新日誌

版本 說明
8.1.0 config 參數現在需要一個 PSpell\Config 實例;先前需要的是一個 資源

範例

範例 #1 pspell_config_repl()

<?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_config($pspell_config);
pspell_check($pspell, "thecat");
?>

備註

注意事項:

除非您擁有 pspell .11.2 和 aspell .32.5 或更高版本,否則此函數將無法運作。

新增備註

使用者貢獻的備註

此頁面沒有使用者貢獻的備註。
To Top