Documentation ¶
Overview ¶
Package hyphenation hyphenates words with TeXs algorithm.
The algorithm is used in TeX and originally from Franklin Liang, his thesis can be downloaded from https://www.tug.org/docs/liang%20/liang-thesis.pdf
You need pattern files which can be downloaded from http://ctan.math.utah.edu/ctan/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lang ¶
type Lang struct { Leftmin int // The minimum number of non hyphenated runes at the beginning of a word. Defaults to 0. Rightmin int // The minimum number of non hyphenated runes at the end of a word. Defaults to 0. // contains filtered or unexported fields }
Lang is a language object for hyphenation. Use it by calling New(), otherwise the object is not initialized properly.
func New ¶
New loads patterns from the reader. Patterns are word substrings with a hyphenation priority between each letter, 0s omitted. Example patterns are “.ach4 at3est 4if.” where a dot denotes a word boundary. An odd number means “don't hyphenate here”, everything else allows hyphenation at this point. The final priority for each position is the maximum of each priority given in each applied pattern.
func (*Lang) DebugHyphenate ¶ added in v1.0.1
DebugHyphenate returns a multi-line string with information about the patterns used and the priorities.