Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PyHyphen-0.2.1a - OpenOffice-like hyphenation

Thread Tools

PyHyphen-0.2.1a - OpenOffice-like hyphenation

Dr. leo
Posts: n/a

a couple of weeks ago I uploaded PyHyphen-0.1 on the PyPI. It is a wrapper
around the C library "hnj_hyphen 2.3" that ships with OpenOffice and Mozilla
products. You can have a look at PyHyphen at

I've tested it on Linux, but it should also run on Windows (for which I have
no C compiler and I think I won't get one as I am using W2K).

What PyHyphen can do is shown in the code example on the module's cover page
on PyPI. Unlike a wrapper module called 'pyhnj' written by someone from
Berkeley, PyHyphen supports non-standard hyphenation with replacements. It
is therefore suitable for all languages. It also accepts unicode objects.

There are no inherent limitations, let alone the max. length of words = 100.

Just download a hyphenation dictionary for your favorite language at

or use the included English one, ... and enjoy!

The 10 line '' included in the tarball shows how it works.

There are no doc strings yet (but a README), and the C source of the wrapper
module 'hyphenmodule.c' is lenthier than desirable. I will work on this as
soon as I can. For now I am not aware of any major bugs though.

My next plans are as follows:
- shorten and polish the C code
- add short doc strings
- add search paths for the dictionaries
- add a 'wrap' method to the convenience interface that selects the best
hyphenation (among a tuple of pairs) to fit in the current line
- modify the 'textwrap' module from the Standard Library to use hyphenation
instead of just pushing entire words into the next line

Any feedback or help, preferrably by e-mail ((E-Mail Removed)) is
highly welcome. I won't read the postings here regularly.

Have fun!


Reply With Quote

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
Hyphenation module PyHyphen-0.4 released - good news for Windows users Dr. leo Python 0 02-27-2008 07:05 AM
Hyphenation module PyHyphen-0.3 released Dr. leo Python 5 02-25-2008 11:59 PM
line break and hyphenation XML 2 12-22-2006 10:47 AM
Hyphenation in string causes newline =?Utf-8?B?QmFobWFu?= ASP .Net 0 08-30-2006 10:03 PM
About hyphenation, Please do help HTML 16 04-15-2006 09:43 PM