Spell checking and Python

William Trenker wtrenker at shaw.ca
Thu Dec 18 08:29:10 EST 2003


Jarek Zgoda wrote:

> Maybe myspell-python?
> 
> http://www.zgoda.biz/dnld/myspell-python-1.0-minimal.tar.gz
> 
> This is repackaged original library by Karl W. MacMillan. I finally
> found a maitainer for this piece of code and I hope it will be actively
> developed.

Might want to apply the following patch to __init__.py so that the dictionary files are located relative to the installation directory.  When I first tried running myspell-python (Linux Python 2.3.2) I got a traceback -- the dictionary path was wrong compared with where setup.py actually installed the dictionaries.

After the fix, myspell-python worked very well.  The list of suggested spellings for a given word is quite good.

Bill

--- __init__.py-original        Wed Jun 11 13:41:23 2003
+++ __init__.py Thu Dec 18 13:18:24 2003
@@ -39,7 +39,7 @@
         # break on other platforms.
         self.dicts_path = sys.prefix + "/myspell-dicts/"
         if sys.platform != 'win32':
-            self.dicts_path = "/usr/share/myspell-dicts/"
+            self.dicts_path = sys.prefix + "/share/myspell-dicts/"
         core.MySpellBase.__init__(self, self.dicts_path + "en_US.aff",
                                   self.dicts_path + "en_US.dic")





More information about the Python-list mailing list