Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hyphenator ¶
type Hyphenator struct {
// contains filtered or unexported fields
}
Hyphenator holds the loaded patterns and the min-affix limits.
func New ¶
func New() *Hyphenator
func (*Hyphenator) AddPattern ¶
func (h *Hyphenator) AddPattern(p string)
addPattern parses one Liang pattern (e.g. "a1bc3d" or ".ach4") into its letter key and inter-letter value array (length = letters+1).
func (*Hyphenator) Mins ¶
func (h *Hyphenator) Mins() (left, right int)
Mins reports the current \lefthyphenmin and \righthyphenmin.
func (*Hyphenator) Points ¶
func (h *Hyphenator) Points(word string) []int
points returns the break positions in word: each value t means a hyphen is allowed after the first t letters (so between word[t-1] and word[t]).
func (*Hyphenator) SetMins ¶
func (h *Hyphenator) SetMins(left, right int)
SetMins sets \lefthyphenmin and \righthyphenmin: the number of letters that must remain before the first hyphen and after the last. TeX's defaults are 2 and 3, which is why it never hyphenates a five-letter word; a document (or a language's conventions) may want otherwise.