pyHnj --- a Python extension wrapper for the libhnj hyphenation library
Copyright (C) 2000 Danny Yoo


This is a wrap-per around Raph Levien's lib-h-nj Hy-phen-ation
li-brary.  I thought it would be fun-ny to write a wrap-per around it,
and by do-ing so give all Python users supreme pow-er to
gra-tu-itous-ly hy-phen-ate whole para-graphs.

Using pyHnj is easy.  Here is a sample session:

###
>>> import pyHnj
>>> h = pyHnj.Hyphen()
>>> h.hyphenate("hyphenation")
'hy-phen-ation'
###

That's pretty much it.  pyHnj contains one class, Hyphen.  Hyphen's
constructor can optionally take in the name of a hyphen dictionary.
By default, it will look for it in:

    /usr/local/share/pyHnj/hyphen.mashed

After a Hyphen instance is constructed, you can call the following
member functions:

    getCodes(word): return the hyphenation codes found by pyHnj
    hyphenate(word): return a hyphenation of the word.

I believe that pyHnj should be able to work with other languages
besides American English --- the only language dependent part of the
system is the hyphen dictionary, which is easily swappable.  I shall
have to dive into www.tug.org and see how well it works in German.

This is based almost entirely on Raph Levien's code, libhnj.  I just
wrote a thin wrapper around it to get some experience with the Python
C API and the Python Distutils.

Thanks to Raph Levien for some pretty easy-to-use code.  Also, a wave
to the people at python-help@python.org and tutor@python.org. --- it's
the people there who make Python fun to play with.  Finally, it's
somewhat humbling to finally write something that's indirectly related
to Donald Knuth... *grin*

Happy hyphenation!
