I am trying to use the pspell in combination with aspell for PHP.
I have installed it on this way:
sudo apt-get install libpspell-dev
sudo apt-get install php5-pspell
sudo apt-get install aspell-de
After that, here is an example code:
$pspell_link = pspell_new("de");
var_dump(pspell_check($pspell_link, "Verkäuferin"));
if (!pspell_check($pspell_link, "Verkäuferin")) {
$vorschlaege = pspell_suggest($pspell_link, "verkäuferin");
foreach ($vorschlaege as $vorschlag) {
echo "Mögliche Schreibweise:" . $vorschlag . "<br>";
}
}
There are two problems:
- This example don't understand german umlauts
- For the substantives they need to be Uppercase so that the pspell_check returns true. When I have the words all in Lowercase, how to become true as well? For example "Ball" would return true, but "ball" will return false. How to solve, that for "ball" the check will return true as well?