I have installed pspell for en, es and pt_BR. ES and EN work just fine but pt_BR does not work.
PHPcode is:
$pspell = pspell_new("pt_BR", PSPELL_FAST);
$sentence = "Oi, como voce llama-se";
$words = explode(" ", $sentence);
$output = "";
foreach($words as $word) {
if (pspell_check($pspell, $word)) {
// this word is fine; print as-is
$output .= $word . " ";
} else {
// this word is bad; look for suggestions
$suggestions = pspell_suggest($pspell, $word);
if (count($suggestions)) {
$output .= current($suggestions). " ";
} else {
// no suggestions; just print the word
$output .= '-'.$word;
}
}
}
echo $sentence . '<br/>'.$output;
The error message is:
Warning: pspell_new(): PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "pt_BR". in /var/www/vhosts/httpdocs/_test.php on line 17 Warning: pspell_check(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 23 Warning: pspell_suggest(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 28 Warning: current() expects parameter 1 to be array, boolean given in /var/www/vhosts/httpdocs/_test.php on line 31 Warning: pspell_check(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 23 Warning: pspell_suggest(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 28 Warning: current() expects parameter 1 to be array, boolean given in /var/www/vhosts/httpdocs/_test.php on line 31 Warning: pspell_check(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 23 Warning: pspell_suggest(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 28 Warning: current() expects parameter 1 to be array, boolean given in /var/www/vhosts/httpdocs/_test.php on line 31 Warning: pspell_check(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 23 Warning: pspell_suggest(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 28 Warning: current() expects parameter 1 to be array, boolean given in /var/www/vhosts/httpdocs/_test.php on line 31 Warning: pspell_check(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 23 Warning: pspell_suggest(): 0 is not a PSPELL result index in /var/www/vhosts/httpdocs/_test.php on line 28 Warning: current() expects parameter 1 to be array, boolean given in /var/www/vhosts/httpdocs/_test.php on line 31 Oi, como voce llama-se
I checked that pt_BR is actually installed and working with the following command:
$ aspell -l pt_BR -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.7-20110707)
casa
+ casar
This is on Ubuntu 12.04.