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')
['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.

Files for hyphenate, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size Hyphenate-1.1.0.tar.gz (21.8 kB) File type Source Python version None Upload date Hashes View
Filename, size Hyphenate-1.1.0-py3-none-any.whl (22.3 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page