Hyphenation module PyHyphen-0.3 released

D

Dr. leo

I am pleased to share with you the great features of the latest version.
Large parts of the sources were completely rewritten. Also, they are now
reasonably documented.

Just go to
http://pypi.python.org/pypi/PyHyphen/0.3

I was tempted to classify it as Beta. Indeed I am not aware of any bugs, but
I haven't spent very much time for testing, just ran some word lists...

Any feedback is greatly appreciated. Especially I would be interested in
experiences under Windows. I can only test it under Linux.

If there were a good soul to send me a DLL for Windows
([email protected]) , this would be terrific.

Bests

Leo
 
T

thebjorn

I am pleased to share with you the great features of the latest version.
Large parts of the sources were completely rewritten. Also, they are now
reasonably documented.

Just go tohttp://pypi.python.org/pypi/PyHyphen/0.3

I was tempted to classify it as Beta. Indeed I am not aware of any bugs, but
I haven't spent very much time for testing, just ran some word lists...

Any feedback is greatly appreciated. Especially I would be interested in
experiences under Windows. I can only test it under Linux.

If there were a good soul to send me a DLL for Windows
([email protected]) , this would be terrific.

Bests

Leo

Looks interesting, and I'd love to provide a .pyd file, however I'm
running into some problems :-( I've got VS 2005 on this machine and
setup-tools is complaining about my Python being built with VS 2003.
(I know what the problem is with intermingling runtime libraries, yet
I can't downgrade my VS version...) I got a message that I could try
using mingw32, so a quick download and the build step seemed to finish
without any problems:

C:\work\PyHyphen-0.3>python setup.py build -c mingw32
running build
running build_py
running build_ext
running build_scripts
creating build\scripts-2.5
copying example.py -> build\scripts-2.5

(I ran build_ext first, which is why there's so little output.) I
copied the dictionary into build\lib.win32-2.5\dict and was able to
import the library without getting any errors and run the example from
http://pypi.python.org/pypi/PyHyphen/0.3 (from the build directory).
I'm stuck at trying to install the package though...:

C:\work\PyHyphen-0.3>python setup.py install
running install
running build
running build_py
running build_ext
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate
compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin
installed,
you can try compiling with MingW32, by passing "-c mingw32" to
setup.py.

C:\work\PyHyphen-0.3>python setup.py install -c mingw32
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2
[cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'mingw32'

I don't know if I'm just doing it wrong, or if I can't use extensions
compiled with mingw32 with the standard distribution Python
executable?

-- bjorn
 
M

Max Erickson

thebjorn said:
Visual Studio 2003 was not found on this system. If you have
Cygwin
installed,
you can try compiling with MingW32, by passing "-c mingw32" to
setup.py.
-- bjorn

You need to convince MingW to use the correct VS runtime. Cribbing
from:

http://www.develer.com/oss/GccWinBinaries

the easy way to do this might be to find(in your mingw /lib directory)
and copy or rename libmsvcr71.a and libmsvcr71d.a into libmsvcrt.a and
libmsvcrtd.a (backing up the originals if desired). If the MingW you
have installed doesn't provide the appropriate runtime, you would have
to track that down.

The MingW/GCC package from the linked page provides a utility to do
this, but it is a tossup/up to you if the version of GCC provided is
suitable for 'production' use.


max
 
R

Ryan Ginstrom

On Behalf Of Max Erickson
the easy way to do this might be to find(in your mingw /lib
directory) and copy or rename libmsvcr71.a and libmsvcr71d.a
into libmsvcrt.a and libmsvcrtd.a (backing up the originals
if desired). If the MingW you have installed doesn't provide
the appropriate runtime, you would have to track that down.

Here's another way. Go to /MinGW/lib/gcc/mingw32/3.4.2/spec, and modify the
libgcc directive as follows:

*libgcc:
%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcr71

Regards,
Ryan Ginstrom
 
I

Ivan Illarionov

I don't know if I'm just doing it wrong, or if I can't use extensions
compiled with mingw32 with the standard distribution Python
executable?

I was able to install on Windows XP with mingw:

setup.py build -c mingw32
setup.py install --skip-build

It works fine with English dictionary, but hangs with Russian
dictionary from Mozilla.
 
T

thebjorn

I was able to install on Windows XP with mingw:

setup.py build -c mingw32
setup.py install --skip-build

It works fine with English dictionary, but hangs with Russian
dictionary from Mozilla.

This is unfortunately deceptive :-( The C-runtime mismatch problem
happens when memory malloc'd in an extension module is free'd by the
interpreter (or vice versa). Things might work for a while with this
mismatch, but will (almost) always crash/hang/etc. in hard to track
down ways later.

Using the link that max provided above, I managed to build and install
without passing any switches and getting no error messages.

-- bjorn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top