1*Concise guide to test-patterns.tex* 2 3test-patterns.tex is an attempt to provide routines to test visually 4hyphenation patterns. It uses LuaTeX callbacks to do the main job, and 5Lua functions to test the output, so it will only work with the LuaTeX 6TeX engine. 7 8In order for patterns to be used correctly, it is necessary to use a 9font that supports all the characters used by the languages at hand 10(which is the same limitation as the original TeX engine). Otherwise 11some characters might be lost, and the results would be meaningless. 12 13The pattern testing functions honor \lefthyphenmin and \righthyphenmin 14(they will just use whatever value they happen to have at the time a 15word is set). 16 17The main functions are to be called from either TeX or Lua, while there 18are usually equivalents in both languages: 19 20\loadpatterns{<language tag>} loads the patterns for said language. 21 22\comparehyphenation{<text>} takes a list of hyphenated words and breaks 23them into words; then it computes the hyphenation points in each word 24using the patterns that are active at the time and prints them to the 25log file with a word on each line. 26 27The invocation \comparehyphenation{thefirstword-inmytext 28the-sec-ond-word-in-my-text} will thus output something like 29 30the-first-word-in-my-text (thefirstword-inmytext) 31the-se-cond-word-in-my-text (the-sec-ond-word-in-my-text) 32 33I wrote this to compare the way our patterns hyphenated words with the 34hyphenation points that are found in typeset documents. 35 36test-patterns-sl.tex gives an example of using the internal Lua commands 37to retrieve the list of hyphenated words in a Lua table. 38 39The implementation, and in particular the names of the functions, is a 40confusing mess in all respects and should be changed, but at the moment 41I have to focus on other projects and wouldn't like to spend too much 42time on it. 43 44Arthur, Paris-Berlin, 2010-09-19. 45