PyHyphen

Hyphenation module for Python
Download

PyHyphen Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Dr. Leo
  • Publisher web site:
  • http://code.google.com/u/fhaxbox66/

PyHyphen Tags


PyHyphen Description

Hyphenation module for Python PyHyphen is a Python wrapper around the high quality hyphenation library hyphen-2.4 (May 2008) that ships with OpenOffice.org and Mozilla products. Hence, all dictionaries compatible with OpenOffice can be used.This source distribution runs with all Python versions from 2.4 to 3.0.The source distribution includes pre-compiled Win32 binary files of the extension module hnj for Python 2.4, 2.5 and 2.6. By default, the appropriate binary, if available, will be installed rather than compiling the C sources.PyHyphen also contains textwrap2, an enhanced though backwards-compatible version of the standard Python module textwrap. Not very surprisingly, textwrap2 can hyphenate words when wrapping them.Code example:>>> from hyphen import hyphenatorfrom hyphen.dictools import *# Download and install some dictionaries in the default directory using the default# repository, usually the OpenOffice websitefor lang in : if not is_installed(lang): install(lang)# Create some hyphenatorsh_de = hyphenator('de_DE')h_en = hyphenator(lmin = 3, rmin = 3) # the en_US dictionary is used by default!h_hu = hyphenator('hu_HU')# Now hyphenate some words. Note that under Python 3.0, words are of type string. print h_en.pairs(u'beautiful') , ] print h_en.wrap(u'beautiful', 6) print h_en.wrap(u'beautiful', 7) >>> from textwrap2 import fill print fill(u'very long text...', width = 40, use_hyphenator = h_en) Requirements: · Python What's New in This Release: · C extension compiles with Python 3.0.1 · added win32 binary of the C extension for Python 3.x


PyHyphen Related Software