【问题标题】:How can I test pspell?如何测试pspell?
【发布时间】:2016-09-19 18:49:52
【问题描述】:

这一切正常,然后我用 godaddy 切换到 cpanel。如果我用我的 php 信息运行测试,它会说 pspell 已启用。有谁知道测试错误的方法,甚至可能是修复方法?

$pspell_config = pspell_config_create("en");
pspell_config_personal($pspell_config, "/home/user/public_html/custom.pws");
pspell_config_repl($pspell_config, "/home/user/public_html/custom.repl");
$pspell_link = pspell_new_config($pspell_config);

我正在使用下面的代码测试我的代码。这让我知道它是否有效,但不会引发错误!

$pspell_link = pspell_new("en");
$word = "color";
if (pspell_check($pspell_link, $word)) {
echo "Found a fix.";
} else {
echo "Sorry we are working on our search engines, please bare with us!";
}

【问题讨论】:

    标签: php .htaccess aspell pspell


    【解决方案1】:

    我发现这段代码可以解决问题。

    error_reporting(E_ALL);
    @ini_set('display_errors', 1);
    
    // Call it once first because of a bug in Windows' Aspell.
    pspell_new('en');
    
    $test = pspell_new('en');
    
    echo '
       Testing pspell.... ', pspell_check($test, 'thisisnotawordandyouknowit') ? 'failure' : 'pass', '.<br />
       If no error messages were displayed, Aspell is installed and working properly.';
    

    这会显示 pspell 的错误,而无需通过 php.ini 运行错误检查

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多