A spell check using GNU Aspell is on its way. Here's some code to make it work with Pspell too. It is still untested, because I haven't yet got Pspell running.
/**
* Execute the spell check using PHP's Pspell extension.
*/
function atraspell_review_pspell($profile, $strings) {
$sug_modes = array(
'fast' => PSPELL_FAST,
'normal' => PSPELL_NORMAL,
'bad-spellers' => PSPELL_BAD_SPELLERS,
);
$sug_mode = $sug_modes[variable_get('atraspell_profile_' . $profile->pid . '_sug_mode', 'normal')];
$dictionary = pspell_new($profile->language, '', '', '', $sug_mode);
$suggestions = array();
foreach ($strings as $string) {
$words = preg_split('#\s#', $string);
foreach ($words as $word) {
if($word_suggestions = pspell_suggest($word)) {
$suggestions[$sid][$word] = $word_suggestions;
}
}
}
return $suggestions;
}
Comments
Comment #1
xanoComment #2
xanoFixed and committed.
Comment #4
xano