Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Hyphenation module PyHyphen-0.3 released (http://www.velocityreviews.com/forums/t593707-hyphenation-module-pyhyphen-0-3-released.html)

Dr. leo 02-23-2008 07:35 PM

Hyphenation module PyHyphen-0.3 released
 
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
(fhaxbox66@googlemail.com) , this would be terrific.

Bests

Leo



thebjorn 02-24-2008 12:53 AM

Re: Hyphenation module PyHyphen-0.3 released
 
On Feb 23, 8:35 pm, "Dr. leo" <fhaxbo...@googlemail.com> wrote:
> 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
> (fhaxbo...@googlemail.com) , 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

Max Erickson 02-24-2008 02:55 AM

Re: Hyphenation module PyHyphen-0.3 released
 
thebjorn <BjornSteinarFjeldPettersen@gmail.com> wrote:
> 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


Ryan Ginstrom 02-24-2008 03:32 AM

RE: Hyphenation module PyHyphen-0.3 released
 
> 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


Ivan Illarionov 02-25-2008 02:56 AM

Re: Hyphenation module PyHyphen-0.3 released
 
> 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.

thebjorn 02-25-2008 11:59 PM

Re: Hyphenation module PyHyphen-0.3 released
 
On Feb 25, 3:56 am, Ivan Illarionov <ivan.illario...@gmail.com> wrote:
> > 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.


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


All times are GMT. The time now is 12:30 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.