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

xano’s picture

Project: Automated Text Review » Spell Check
xano’s picture

Status: Needs work » Fixed

Fixed and committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xano’s picture

Assigned: xano » Unassigned