hyphenation
Standard Knuth-Liang hyphenation based on the TeX UTF-8 patterns.
[]
= "0.3.0"
Quickstart
use ;
use ;
// Set the location of the pattern repository,
// absolute or relative to your executable
set_pattern_folder;
// Load hyphenation data for American English from the pattern repository.
let english_us = load.unwrap;
// An iterator that breaks a word according to standard hyphenation practices.
let h: Standard = "hyphenation".hyphenate;
// hy-phen-ation
// Collect the lazy hyphenator `h` into substring slices over the original string.
let v: = h.collect;
assert_eq!;
// Hyphenators work with full text as well as individual words.
let h2: Standard = "Word hyphenation by computer.".hyphenate;
let v2: = h2.collect;
assert_eq!;
// Mark hyphenation opportunities with soft hyphens,
// and render the result to a new String.
let h2 = "anfractuous".hyphenate;
let s: String = h1.punctuate.collect;
assert_eq!;
License
hyphenation
© 2016 ndr-qef, dual-licensed under the terms of either:
- The Apache License, Version 2.0
- The MIT license
texhyphen
hyphenation patterns © their respective owners; see lic.txt
files for licensing information.