Skip to main content

Determine hyphenation breaks in English words

Project description

Hyphenate, using Frank Liang’s algorithm.

This module provides a single function to hyphenate words. The hyphenate_word function takes a string (the word to hyphenate), and returns a list of parts that can be separated by hyphens. For example:

>>> from hyphenate import hyphenate_word
>>> hyphenate_word('hyphenation')
['hy', 'phen', 'ation']
>>> hyphenate_word('supercalifragilistic')
['su', 'per', 'cal', 'ifrag', 'ilis', 'tic']
>>> hyphenate_word('project')

This code, originally written by Ned Batchelder in July 2007, is in the public domain.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Hyphenate-1.1.0.tar.gz (21.8 kB view hashes)

Uploaded source

Built Distribution

Hyphenate-1.1.0-py3-none-any.whl (22.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page