Updated 2008-02-02 18:41:56 by andy

What: Hunspelltcl
   Where: http://www.esperantilo.org/xotclhunspell1.0.tar.gz
   Author: [Artur Trzewik]
   Licence: LGPL (compatible with Hunspell)
   Description: It is XOTcl binary extension to hunspell spellchecker (http://hunspell.sourceforge.net/)
   Binaries: You can extract them for Linux (intel) and Windows with [SDX] tool from http://www.esperantilo.org/esperantilo.kit

Hunspelltcl is XOTcl binary extension. So it requires XOTcl. The interface to it is normall XOTcl class. I decided to use XOTcl-API because it allows very compact wrapping of Hunspell C++ Classes. XOTcl offers also handling for so called object handles, which is quite complex task with Tcl C-API.

Hunspelltcl was implemented to support the needs of the program Esperantilo.

Hunspell is currently used by OpenOffice.org project and is also compatible to older MySpell. There are plenty of dictionaries in http://wiki.services.openoffice.org/wiki/Dictionaries. Currently also Thunderbird and Firefox uses this directories.

Short Example:
    package require XOTcl
    package require xotcl::hunspell
    namespace import xotcl::*

    set checker [Hunspell new]
    # place with your dictioneries
    set dic {/home/artur/dictionaries}
    # setting dictionaries
    $checker open [file join $dic eo-EO.aff] [file join $dic eo-EO.dic]
    # obtaining dic encoding
    puts "dic encoding [$checker getDicEncoding]"
    # setting api encoding translation (default is [encoding system])
    $checker encoding iso8859-3
    # alternative
    $checker encoding [string tolower [$checker getDicEncoding]]

    # Spell checking of esperanto word faras (english: "do")
    puts "faras [$checker spell faras]"
    # Mispelled word
    puts "farras [$checker spell farras]"
    # Obtaning suggestions
    puts [join [$checker suggest farras] ,]

    # Adding words
    $checker putWord "artur"
    puts "artur after putWord [$checker spell artur]"

    # cleaning up
    $checker destroy

Author: Artur Trzewik