Error opening dictionary with php pspell function pspell_new

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to get up and running using the pspell functions on Windows. It seems everything is installed OK. I can use aspell from the Windows command prompt fine. PHP thinks the pspell module is loaded OK.

However, when I try to execute the pspell_new function I get the following: -
"Warning: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en". in ..."


I have installed both an english and welsh dictionary and they both work find using aspell from the Windows command prompt.

The strange thing is that if I call pspell_new twice then it seems to succeed 2nd time. See code sample and correctsponding output below: -
CODE
/* Set up test data */
$cWords[0] = "good";
$cWords[1] = "badd";
$numWords = count($cWords);


                /* Load the dictionary */
                $pDict = pspell_new("en");
                echo("pDict is $pDict<br>\n");
                $pDict = pspell_new("en");
                echo("pDict is $pDict<br>\n");

                /* Check the words */
                for($i=0; $i<$numWords; $i++)
                {
                    if(pspell_check($pDict, $cWords[$i]))
                        echo("$cWords[$i] is spelled OK<br>\n");
                    else
                        echo("$cWords[$i] is misspelled<br>\n");
                }

OUTPUT
Warning: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en". in C:\Program Files\Apache Group\Apache2\htdocs\php\RemoteAdstract\preview.php on line 22
pDict is
pDict is 2
good is spelled OK
badd is misspelled


ENVIRONMENT
	Windows XP service pack 1
	PHP 4.3.8
	Aspell 0.50.3
	Apache 2.0.47

Any advice or suggestion appreciated.

	- Glyn

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux