Since google spell checker API is closed I tried this: https://github.com/AlphawolfWMP/google-spell-pspell
and got this:
Warning: pspell_new_config() [function.pspell-new-config]: PSPELL couldn’t open the dictionary. reason: No word lists can be found for the language “en”.
How can I use that class?
Did you try to add this at the beginning?
$pspell_config = pspell_config_create("en");
$pspell_link = pspell_new_config($pspell_config);
How this should be? like below?
require_once('spell-check-library.php');
$content = "";
$options = array(
"lang" => 'en',
"maxSuggestions" => 10,
"customDict" => 0,
"charset" => 'utf-8'
);
$pspell_config = pspell_config_create("en");
$pspell_link = pspell_new_config($pspell_config);
$factory = new SpellChecker($options);
$spell = $factory->create(trim($_GET['message']));
header('Content-Type: text/xml; charset=UTF-8');
echo $spell->toXML();
I found the exact error in http://www.php.net/manual/en/ref.pspell.php
It says:
Add following lines prior to calling pspell_check:
$pspell_config = pspell_config_create(“en”);
$pspell_link = pspell_new_config($pspell_config);
The code you gave is for when we want to use pspell extensions directly but the code i gave is for a particular class file with different structure so that code in php doc is irrelevant for my problem. Pleade look further and help.