https://wiki.zimbra.com/api.php?action=feedcontributions&user=Dwspek&feedformat=atomZimbra :: Tech Center - User contributions [en]2024-03-28T13:13:01ZUser contributionsMediaWiki 1.39.0https://wiki.zimbra.com/index.php?title=Adding_new_dictionaries_to_aspell&diff=6756Adding new dictionaries to aspell2007-10-02T16:12:22Z<p>Dwspek: /* How to add a new dictionary to aspell */</p>
<hr />
<div>== How to add a new dictionary to aspell ==<br />
<br />
<br />
* Download the dictionary from [ftp://ftp.gnu.org/gnu/aspell/dict gnu.org]<br />
* Extract it from the tar file in a work directory<br />
* Set Zimbra's aspell in the path with:<br />
::<tt>PATH=/opt/zimbra/aspell-0.60.3/bin:$PATH</tt><br />
* Configure and install the dictionary according to the README<br />
<tt><br />
::./configure<br />
::make<br />
::make install<br />
</tt><br />
<br />
* Edit the file /opt/zimbra/httpd/htdocs/aspell.php to reference the new dictionary. For example to add the french dictionary:<br />
<br />
<tt><br />
::$dictionary = pspell_new("en_EN");<br />
::TO<br />
::$dictionary = pspell_new("fr_FR");<br />
</tt><br />
<br />
<br />
<b>NOTE:</b> I think is better to change the value of the variable <b>$locale</b> at the start of the file.<br />
<b>NOTE:</b> If you are using a non-english based language with special chars like tildes (spanish, for example), you have to modify aspell.php<br />
<br />
This file is located at /opt/zimbra/httpd/htdocs/aspell.php. Replace this block (line 82 or so)<br />
<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$suggestions=iconv("iso-8859-1","UTF-8",$suggestions);<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
<b>NOTE:</b> After changing the aspell language restart the spellchecker as the user zimbra with the following command:<br />
<br />
<pre><nowiki><br />
zmspellctl stop; zmspellctl start<br />
</nowiki></pre><br />
<br />
There is also a problem when splitting words. Replace (line 48 or so)<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'-] /', $text);<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'\xc0-\xfd-]+/', $text);<br />
</nowiki></pre><br />
<br />
This regexp line should be enough for most western Europe languages (Spanish, French, German, Portuguese and Italian). It includes all ISO8859 europeean letters in the range 192-253 of the table below.<br />
<br />
http://www.pemberley.com/janeinfo/latin1.gif<br />
<br />
<br />
* To add a set of custom words see this [http://aspell.sourceforge.net/man-html/Creating-an-Individual-Word-List.html How-To]</div>Dwspekhttps://wiki.zimbra.com/index.php?title=Adding_new_dictionaries_to_aspell&diff=6755Adding new dictionaries to aspell2007-10-02T16:09:32Z<p>Dwspek: /* How to add a new dictionary to aspell */</p>
<hr />
<div>== How to add a new dictionary to aspell ==<br />
<br />
<br />
* Download the dictionary from [ftp://ftp.gnu.org/gnu/aspell/dict gnu.org]<br />
* Extract it from the tar file in a work directory<br />
* Set Zimbra's aspell in the path with:<br />
::<tt>PATH=/opt/zimbra/aspell-0.60.3/bin:$PATH</tt><br />
* Configure and install the dictionary according to the README<br />
<tt><br />
::./configure<br />
::make<br />
::make install<br />
</tt><br />
<br />
* Edit the file /opt/zimbra/httpd/htdocs/aspell.php to reference the new dictionary. For example to add the french dictionary:<br />
<br />
<tt><br />
::$dictionary = pspell_new("en_EN");<br />
::TO<br />
::$dictionary = pspell_new("fr_FR");<br />
</tt><br />
<br />
<br />
<b>NOTE:</b> I think is better to change the value of the variable <b>$locale</b> at the start of the file. For instance en_US for US English and nl for Dutch.<br />
<br />
<b>NOTE:</b> If you are using a non-english based language with special chars like tildes (spanish, for example), you have to modify aspell.php<br />
<br />
This file is located at /opt/zimbra/httpd/htdocs/aspell.php. Replace this block (line 82 or so)<br />
<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$suggestions=iconv("iso-8859-1","UTF-8",$suggestions);<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
<b>NOTE:</b> After changing the aspell language restart the spellchecker as the user zimbra with the following command:<br />
<br />
<pre><nowiki><br />
zmspellctl stop; zmspellctl start<br />
</nowiki></pre><br />
<br />
There is also a problem when splitting words. Replace (line 48 or so)<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'-] /', $text);<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'\xc0-\xfd-]+/', $text);<br />
</nowiki></pre><br />
<br />
This regexp line should be enough for most western Europe languages (Spanish, French, German, Portuguese and Italian). It includes all ISO8859 europeean letters in the range 192-253 of the table below.<br />
<br />
http://www.pemberley.com/janeinfo/latin1.gif<br />
<br />
<br />
* To add a set of custom words see this [http://aspell.sourceforge.net/man-html/Creating-an-Individual-Word-List.html How-To]</div>Dwspekhttps://wiki.zimbra.com/index.php?title=Adding_new_dictionaries_to_aspell&diff=6754Adding new dictionaries to aspell2007-10-02T16:07:45Z<p>Dwspek: /* How to add a new dictionary to aspell */</p>
<hr />
<div>== How to add a new dictionary to aspell ==<br />
<br />
<br />
* Download the dictionary from [ftp://ftp.gnu.org/gnu/aspell/dict gnu.org]<br />
* Extract it from the tar file in a work directory<br />
* Set Zimbra's aspell in the path with:<br />
::<tt>PATH=/opt/zimbra/aspell-0.60.3/bin:$PATH</tt><br />
* Configure and install the dictionary according to the README<br />
<tt><br />
::./configure<br />
::make<br />
::make install<br />
</tt><br />
<br />
* Edit the file /opt/zimbra/httpd/htdocs/aspell.php to reference the new dictionary. For example to add the french dictionary:<br />
<br />
<tt><br />
::$dictionary = pspell_new("en_EN");<br />
::TO<br />
::$dictionary = pspell_new("fr_FR");<br />
</tt><br />
<br />
<br />
<b>NOTE:</b> I think is better to change the value of the variable <b>$locale</b> at the start of the file.<br />
<br />
<b>NOTE:</b> If you are using a non-english based language with special chars like tildes (spanish, for example), you have to modify aspell.php<br />
<br />
This file is located at /opt/zimbra/httpd/htdocs/aspell.php. Replace this block (line 82 or so)<br />
<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$suggestions=iconv("iso-8859-1","UTF-8",$suggestions);<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
<b>NOTE:</b> After Changing the aspell language restart the spellchecker as the user zimbra with:<br />
<br />
<pre><nowiki><br />
zmspellctl stop; zmspellctl start<br />
</nowiki></pre><br />
<br />
There is also a problem when splitting words. Replace (line 48 or so)<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'-] /', $text);<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'\xc0-\xfd-]+/', $text);<br />
</nowiki></pre><br />
<br />
This regexp line should be enough for most western Europe languages (Spanish, French, German, Portuguese and Italian). It includes all ISO8859 europeean letters in the range 192-253 of the table below.<br />
<br />
http://www.pemberley.com/janeinfo/latin1.gif<br />
<br />
<br />
* To add a set of custom words see this [http://aspell.sourceforge.net/man-html/Creating-an-Individual-Word-List.html How-To]</div>Dwspekhttps://wiki.zimbra.com/index.php?title=Adding_new_dictionaries_to_aspell&diff=6753Adding new dictionaries to aspell2007-10-02T16:06:24Z<p>Dwspek: /* How to add a new dictionary to aspell */</p>
<hr />
<div>== How to add a new dictionary to aspell ==<br />
<br />
<br />
* Download the dictionary from [ftp://ftp.gnu.org/gnu/aspell/dict gnu.org]<br />
* Extract it from the tar file in a work directory<br />
* Set Zimbra's aspell in the path with:<br />
::<tt>PATH=/opt/zimbra/aspell-0.60.3/bin:$PATH</tt><br />
* Configure and install the dictionary according to the README<br />
<tt><br />
::./configure<br />
::make<br />
::make install<br />
</tt><br />
<br />
* Edit the file /opt/zimbra/httpd/htdocs/aspell.php to reference the new dictionary. For example to add the french dictionary:<br />
<br />
<tt><br />
::$dictionary = pspell_new("en_EN");<br />
::TO<br />
::$dictionary = pspell_new("fr_FR");<br />
</tt><br />
<br />
<br />
<b>NOTE:</b> I think is better to change the value of the variable <b>$locale</b> at the start of the file.<br />
<br />
<b>NOTE:</b> If you are using a non-english based language with special chars like tildes (spanish, for example), you have to modify aspell.php<br />
<br />
This file is located at /opt/zimbra/httpd/htdocs/aspell.php. Replace this block (line 82 or so)<br />
<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$suggestions = implode(",", pspell_suggest($dictionary, $word));<br />
$suggestions=iconv("iso-8859-1","UTF-8",$suggestions);<br />
$misspelled .= "$word:$suggestions\n";<br />
</nowiki></pre><br />
<br />
<b>NOTE:</b> After Changing the aspell language restart the spellchecker as the user zimbra with: 'zmspellctl stop; zmspellctl start'<br />
<br />
There is also a problem when splitting words. Replace (line 48 or so)<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'-] /', $text);<br />
</nowiki></pre><br />
<br />
with this one:<br />
<pre><nowiki><br />
$words = preg_split('/[^\w\'\xc0-\xfd-]+/', $text);<br />
</nowiki></pre><br />
<br />
This regexp line should be enough for most western Europe languages (Spanish, French, German, Portuguese and Italian). It includes all ISO8859 europeean letters in the range 192-253 of the table below.<br />
<br />
http://www.pemberley.com/janeinfo/latin1.gif<br />
<br />
<br />
* To add a set of custom words see this [http://aspell.sourceforge.net/man-html/Creating-an-Individual-Word-List.html How-To]</div>Dwspek