Copyright | (C) 2012-2015 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Hyphenation based on the Knuth-Liang algorithm as used by TeX.
- data Hyphenator = Hyphenator {}
- hyphenate :: Hyphenator -> String -> [String]
- defaultLeftMin :: Int
- defaultRightMin :: Int
Documentation
data Hyphenator Source
A Hyphenator
is combination of an alphabet normalization scheme, a set of Patterns
, a set of Exceptions
to those patterns
and a number of characters at each end to skip hyphenating.
Hyphenator | |
|
Hyphenate with a given set of patterns
hyphenate :: Hyphenator -> String -> [String] Source
hyphenate a single word using the specified Hyphenator. Returns a set of candidate breakpoints by decomposing the input into substrings.
>>>
import Text.Hyphenation
>>>
hyphenate english_US "supercalifragilisticexpialadocious"
["su","per","cal","ifrag","ilis","tic","ex","pi","al","ado","cious"]
>>>
hyphenate english_US "hyphenation"
["hy","phen","ation"]
By default, do not insert hyphens in the first two characters
>>>
defaultLeftMin
2
By default, do not insert hyphens in the last three characters.
>>>
defaultRightMin
3