2024 年 PHP Conference Japan

pspell_config_runtogether

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

pspell_config_runtogether將連寫詞視為有效的複合詞

說明

pspell_config_runtogether(PSpell\Config $config, bool $allow): bool

這個函數決定是否將連在一起的單詞視為合法的複合詞。也就是說,「thecat」將會是一個合法的複合詞,即使這兩個單詞之間應該要有一個空格。更改此設定只會影響 pspell_check() 返回的結果;pspell_suggest() 仍然會返回建議。

在呼叫 pspell_new_config() 之前,應該在設定上使用 pspell_config_runtogether()

參數

config

一個 PSpell\Config 實例。

allow

如果連在一起的單詞應該被視為合法的複合詞,則為 true,否則為 false

返回值

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

更新日誌

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

範例

範例 #1 pspell_config_runtogether()

<?php
$pspell_config
= pspell_config_create("en");
pspell_config_runtogether($pspell_config, true);
$pspell = pspell_new_config($pspell_config);
pspell_check($pspell, "thecat");
?>

新增筆記

使用者貢獻的筆記

此頁面沒有使用者貢獻的筆記。
To Top