~wklew/hyphenate

Portable Scheme library providing Knuth-Liang hyphenation
Simplify test module
Update hyphenator test for new hyphenator API
pattern-trie: Fix typo in graph

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~wklew/hyphenate
read/write
git@git.sr.ht:~wklew/hyphenate

You can also use your local clone with git send-email.

#Hyphenate

R7RS Scheme library providing Knuth-Liang hyphenation, as used in TeX. Ported from the Haskell library by Edward Kmett.

#Demo (Chibi)

(import (scheme base)
        (srfi 1)
        (hyphenate pattern-trie)
        (hyphenate hyphenator))

(define patterns
  (with-input-from-file "data/hyph-en-us.pat.txt"
    pattern-trie-parse))

(define hyphenate (hyphenator patterns 2 3))

(append-map hyphenate '("word" "hyphenation" "by" "computer"))

; => ("word" "hy" "phen" "ation" "by" "com" "puter")

#Requirements

To run the tests you currently need Guile or Chibi Scheme.

#Documentation

WIP

#Graph

The pattern-trie-graph procedure from (hyphenate pattern-trie) is useful to see what a pattern trie looks like, conceptually. These graphs can be compared with those from Liang's thesis.

The graph below shows a small trie of patterns which match on the word "hyphenation", with boxed sequences of numbers representing a hyphenation score up to that point.

graph of a pattern trie comprised of patterns matching the word "hyphenation"

Do not follow this link