Adding new dictionaries to aspell

Revision as of 01:54, 1 October 2006 by MergeSpamAccountsIntoMe (talk | contribs) (How to add a new dictionary to aspell)

How to add a new dictionary to aspell

  • Download the dictionary from
  • Extract it from the tar file in a work directory
  • Set Zimbra's aspell in the path with:
  • Configure and install the dictionary according to the README

make install

  • Edit the file /opt/zimbra/httpd/htdocs/aspell.php to reference the new dictionary. For example to add the french dictionary:

$dictionary = pspell_new("en_EN");
$dictionary = pspell_new("fr_FR");

NOTE: If you are using a non-english based language with special chars like tildes (spanish, for example), you have to modify aspell.php

This file is located at /opt/zimbra/httpd/htdocs/aspell.php. Replace this block (line 82 or so)

 $suggestions = implode(",", pspell_suggest($dictionary, $word));
 $misspelled .= "$word:$suggestions\n";

with this one:

 $suggestions = implode(",", pspell_suggest($dictionary, $word));
 $misspelled .= "$word:$suggestions\n";

There is also a problem when splitting words. Replace (line 48 or so)

$words = preg_split('/[^\w\'-]+/', $text);

with this one:

$words = preg_split('/[^\w\'-áéíóúäëïöüàèùìòñçâêîôû]+/', $text);

This regexp line should be enough for most western Europe languages (Spanish, French, German, Portuguese and Italian). Other languages with other special chars (nordic languages??) should modify to include extra characters.

Jump to: navigation, search