PyHyphen-0.2.1a - OpenOffice-like hyphenation

Discussion in 'Python' started by Dr. leo, Feb 13, 2008.

  1. Dr. leo

    Dr. leo Guest

    Hi,

    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

    http://pypi.python.org/pypi/PyHyphen/0.2.1a

    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
    http://wiki.services.openoffice.org/wiki/Dictionaries

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

    The 10 line 'example.py' 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 () is
    highly welcome. I won't read the postings here regularly.

    Have fun!

    Stefan
     
    Dr. leo, Feb 13, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dr. leo
    Replies:
    5
    Views:
    310
    thebjorn
    Feb 25, 2008
  2. Dr. leo
    Replies:
    0
    Views:
    248
    Dr. leo
    Feb 27, 2008
  3. Dr. leo
    Replies:
    0
    Views:
    260
    Dr. leo
    Mar 2, 2008
  4. Replies:
    0
    Views:
    252
  5. Dr. leo

    Hyphenation: PyHyphen-0.7 released

    Dr. leo, Apr 2, 2008, in forum: Python
    Replies:
    0
    Views:
    281
    Dr. leo
    Apr 2, 2008
Loading...

Share This Page