日期:2014-05-17  浏览次数:20890 次

关于aspell+pspell的安装测试方法综述
GNU Aspell的是一个自由和开放源码拼写检查程序,它是Ispell替代产品。它可以被用来作为一个库或作为一个独立的拼写检查器。
它的不同于ispell,无需使用特殊的字典在UTF-8文件,可以很容易地检查拼写错误的单词。 Aspell的也会尽力尊重目前的区域设置。

步骤:
1).Install pspell on Windows
Windows中配置PHP的pspell项。

2).Download and Install Aspell Win32
虽然有些老,但是应该可以满足需要。安装aspell是必须的,因为pspell是基于aspell的。(链接如下:)
ftp.gnu.org
http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe

3).Install a Dictionary / Dictionaries
http://aspell.net/win32/
可以到这里去下载你该需要的语言包,当然测试期间还是首选英文的一份。

4).Enable the pspell extension

extension=php_pspell.dll


这个工作基于第一步的正确性,包括版本(如果有可能需要自己编译)。

5).Test the installation
测试code:
<?php
echo "Check Spelling Installation";
$pspell_link = pspell_new("en");
print_r($pspell_link);
if (pspell_check($pspell_link, "colour"))
{ echo "This is a valid spelling"; }
else
{ echo "Sorry, wrong spelling"; }
?>


6).PHP Functions
http://uk.php.net/pspell