Hyphenator
Knuth-Liang hyphenation (the TeX algorithm). Given a set of language patterns, finds the valid hyphenation points inside a word so a justified line-breaker can split long words. The pattern data is the language-specific part; the bundled sets (see forLanguage) are the full TeX hyph-* pattern files for German, French, Spanish, Italian, Portuguese and Dutch, plus a small built-in English set for common words.
Patterns are compiled into a trie so lookup is O(word length x max pattern length) regardless of pattern-set size. The German set alone has ~37k patterns, which the previous scan-every-pattern approach would re-walk per word.