hyphenation-0.8.1: Configurable Knuth-Liang hyphenation
Copyright(C) 2012-2019 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Hyphenation.Pattern

Description

 
Synopsis

Pattern file support

data Patterns Source #

Hyphenation patterns

Instances

Instances details
Show Patterns Source # 
Instance details

Defined in Text.Hyphenation.Pattern

Semigroup Patterns Source # 
Instance details

Defined in Text.Hyphenation.Pattern

Monoid Patterns Source # 
Instance details

Defined in Text.Hyphenation.Pattern

insertPattern :: String -> Patterns -> Patterns Source #

Insert a Knuth-Liang hyphenation pattern into the trie

  1. . denotes the start or end of the input
  2. 0-9 are used to denote hyphenation or dehyphenation depending on whether or not they are even (no hyphen) or odd (hyphen allowed).

Patterns are overlaid and the maximum value at each location is used. this allows you to implement a finite number of precedences between hyphenation rules

(e.g. 3foo. indicates that the suffix '-foo' should be hyphenated with precedence 3.)

lookupPattern :: String -> Patterns -> [Int] Source #

Tallies the hyphenation scores for a word considering all tails.

scorePattern :: String -> [Int] Source #

Convert a Pattern string to a Score

parsePatterns :: String -> Patterns Source #

Parse one pattern per line from an input string

hyph-utf8 supplies these files UTF-8 encoded in the txt folder with a .pat.txt extension