Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ANN: Pyrex wrapper for the Aspell API

Reply
Thread Tools

ANN: Pyrex wrapper for the Aspell API

 
 
Gary Bishop
Guest
Posts: n/a
 
      05-24-2004
http://prdownloads.sourceforge.net/u...0.zip?download

"""A Pyrex wrapper for the aspell api.

Pyrex is ****SO**** great! I wrote this in about 1 hour from the
Aspell doc. I spent most of that hour figuring out that I needed to
set the Aspell prefix to get it to work!

Intended usage is:

1) create a spell_checker object for each document.

2) check a word by calling the check method

3) if you get 0 back indicating a misspelling, use the suggest method
to get a list of possible correct spellings.

4) tell aspell about the correct choice so it can learn from your
errors using the store_replacement method

5) add words to either the session dictionary or to your personal
dictionary using the add_to_session or add_to_personal methods.

import aspell
sc = aspell.spell_checker()
word = 'flarg'
if not sc.check(word):
print word, 'is incorrect'
print 'suggestions include:', sc.suggest(word)

To get this to build and work on Windows I downloaded the Windows
version of aspell from http://aspell.net/win32/. I got the Full
Installer, a dictionary, and the libraries for MS VisualC++ as
separate downloads. I let the first two go to their default locations
and I unpacked the zip file for the last into the C:\Program
Files\Aspell top directory. Then I copied the aspell-15.dll from
C:\Program Files\Aspell\bin to a folder on my path.

You will also, of course, need Pyrex from
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/.

With the above completed the standard 'python setup.py install' should
build and install the extension.

23 May 2004
Gary Bishop

"""

 
Reply With Quote
 
 
 
 
Doug Holton
Guest
Posts: n/a
 
      05-24-2004
Gary Bishop wrote:
> To get this to build and work on Windows I downloaded the Windows
> version of aspell from http://aspell.net/win32/. I got the Full
> Installer, a dictionary, and the libraries for MS VisualC++ as
> separate downloads. I let the first two go to their default locations
> and I unpacked the zip file for the last into the C:\Program
> Files\Aspell top directory. Then I copied the aspell-15.dll from
> C:\Program Files\Aspell\bin to a folder on my path.
>
> You will also, of course, need Pyrex from
> http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/.
>
> With the above completed the standard 'python setup.py install' should
> build and install the extension.



If you use distutils with pyrex then others won't have to download,
install and setup Aspell, MS Visual C++, or Pyrex to use your module.
http://ldots.org/pyrex-guide/2-compiling.html#distutils
http://www.python.org/doc/current/dist/
 
Reply With Quote
 
 
 
 
John J. Lee
Guest
Posts: n/a
 
      05-24-2004
"Gary Bishop" <> writes:

> http://prdownloads.sourceforge.net/u...0.zip?download
>
> """A Pyrex wrapper for the aspell api.
>
> Pyrex is ****SO**** great! I wrote this in about 1 hour from the
> Aspell doc. I spent most of that hour figuring out that I needed to
> set the Aspell prefix to get it to work!

[...]

Be sure to let the aspell author, Kevin Atkinson, know about it.
IIRC, he likes to know about these things.


John
 
Reply With Quote
 
Gary Bishop
Guest
Posts: n/a
 
      05-24-2004
Doug Holton <> wrote:
> If you use distutils with pyrex then others won't have to download,
> install and setup Aspell, MS Visual C++, or Pyrex to use your module.
> http://ldots.org/pyrex-guide/2-compiling.html#distutils
> http://www.python.org/doc/current/dist/


Done. You can now download a windows installer for the module. You'll
need the source to see how to use it.

The Windows installer is for Python2.3.

gb
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method Greg Ewing Python 2 06-29-2006 05:25 PM
Jazzy and Aspell dictionaries jch.helary@free.fr Java 1 01-09-2006 05:28 PM
Re: [Pyrex] Allocating an array.array of a specific length in pyrex Chris Lambacher Python 0 06-08-2005 06:56 PM
URGENT --- Aspell Scores Sum Perl Misc 1 01-11-2005 02:46 PM
Re: Pyrex without Python (was Re: calling Pyrex results from C) =?iso-8859-1?Q?Fran=E7ois?= Pinard Python 3 01-21-2004 01:53 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57