Вы находитесь на странице: 1из 2

https://en.wikipedia.

org/wiki/Hyphenation_alg
orithm

Hyphenation algorithm
From Wikipedia, the free encyclopedia
Jump to navigationJump to search
A hyphenation algorithm is a set of rules, especially one codified for implementation in a computer
program, that decides at which points a word can be broken over two lines with a hyphen. For
example, a hyphenation algorithm might decide that impeachment can be broken as impeach-
ment or im-peachment but not impe-achment.
One of the reasons for the complexity of the rules of word-breaking is that different "dialects" of
English tend to differ on hyphenation[citation needed]: American English tends to work on sound, but British
English tends to look to the origins of the word and then to sound. There are also a large number of
exceptions, which further complicates matters.
Some rules of thumb can be found in "On Hyphenation – Anarchy of Pedantry." Among
the algorithmic approaches to hyphenation, the one implemented in the TeX typesetting system is
widely used. It is thoroughly documented in the first two volumes of Computers and Typesetting and
in Francis Mark Liang's dissertation.[1] The aim of Liang's work was to get the algorithm as accurate
as he practically could and to keep any exception dictionary small.
In TeX's original hyphenation patterns for American English, the exception list contains only 14
words.[2]

In TeX[edit]
Ports of the TeX hyphenation algorithm are available as libraries for several programming
languages, including Haskell, JavaScript, Perl, PostScript, Python, Ruby, C#, and TeX can be made
to show hyphens in the log by the command \showhyphens .
In LaTeX, hyphenation correction can be added by users by using:

\hyphenation{words}

The \hyphenation command declares allowed hyphenation points in which words is a list of words,
separated by spaces, in which each hyphenation point is indicated by a - character. For example,

\hyphenation{fortran er-go-no-mic}

declares that in the current job "fortran" should not be hyphenated and that if "ergonomic" must be
hyphenated, it will be at one of the indicated points.[3]
However, there are several limits. For example, the stock \hyphenation command accepts
only ASCII letters by default and so it cannot be used to correct hyphenation for words with non-
ASCII characters (like ä, é, ç), which are very common in almost all languages except English.
Simple workarounds exist, however.[4]
References[edit]
1. Jump up^ Liang, Franklin Mark. "Word Hy-phen-a-tion by Com-pu-ter". PhD dissertation, Stanford
University Department of Computer Science. Report number STAN-CS-83-977, August 1983.
2. Jump up^ "The Plain TeX hyphenation tables". Retrieved June 23, 2009.
3. Jump up^ \hyphenation on Hypertext Help with LaTeX
4. Jump up^ TeX FAQ: Accented words aren't hyphenated, ibid How does hyphenation work in
TeX? and references therein

 "On Hyphenation - Anarchy of Pedantry". PC Update, the magazine of Melbourne PC User


Group, Australia. Archived from the original on March 10, 2005. Retrieved October 6, 2005.
 "TeX hyphenation patterns". TeX Users Group (TUG).
 "TeX-Hyphen". Comprehensive Perl Archive Network. Retrieved October 18, 2005.
 "text-hyphen". RubyForge. Retrieved October 18, 2005.
 "Knuth-Liang hyphenation for the PostScript language". anastigmatix.net. Retrieved October
6, 2005.
 "TeXHyphenator-J: TeX Hyphenator in Java". Retrieved September 14, 2006.
 "Hyphenation in Python, using Frank Liang's algorithm". Retrieved July 10, 2007.
 "Hyphenator.js-Hyphenation in JavaScript, using Frank Liang's algorithm". Retrieved July
28, 2015.
 "Tex::Hyphen - Perl implementation of TeX82 Hyphenation rules".
 "phpSyllable - PHP implementation of Frank Liang's algorithm".
 "Hyphenator - JavaScript implementation of Frank Liang's algorithm".
 "NHyphenator - C# version of Knuth-Liang hyphenation algorithm".

External links[edit]
 Test TeX/OpenOffice hyphenation algorithm online
 Text & Information Processing (TIP), On-line Hyphenator (hyphenates Spanish)