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