Open bpj opened 7 years ago
Indeed, there is a large supply of hyphenation pattern files (and exception lists) there at ctan.org. Now, what would be the most useful way to make this available to users of Text::Hyphen? I suspect that most will not want the overhead (and failures due to connectivity problems) of directly reading from the CTAN site every time you use Text::Hyphen. I'm not sure that packaging all these files into Text::Hyphen (rather than individual Text::Hyphen::XX modules) would be good (too bulky, and most languages will not be used by any given user). Is there a way to subscribe to pattern/exception files for those languages one is interested in? Perhaps then build a local Text::Hyphen::XX on the fly, or add it to/ update Text::Hyphen?
I think it would be useful to extend Text::Hyphen::new() with a $lang language option (default, en_US) to bring in the appropriate pattern/exception files for this language, in the manner of Text::Hyphen::XX, for this hyphenation object. That way, you could hyphenate multiple languages in one session with multiple hyphenation objects, if desired. $lang might then trigger pulling in the pattern and exception files from a local library under Text::Hyphen. It would be up to the owner of the system to maintain these files in sync with CTAN (I doubt that they will change very often). There would be no need to maintain separate Text::Hyphen::XX modules. Perhaps Text::Hyphen could look in a local cache for the desired language content, and if not found, refresh it from CTAN? It might be good to have a local utility to check with CTAN and refresh any changed language files, as well as load any new ones on request.
Text/
Hyphen/
existing code
languages/
en_US/ shipped with Text::Hyphen
de_DE/ optional German pattern/exceptions, etc.
OK, enough coffee-fueled ramblings for today!
file
for specifying the file (apparently combined pattern and exceptions), and a parameter style
that has something to do with the language. The documentation mumbles something about language-specific shortcuts, but I haven't explored it. I should probably do a thorough comparison with Text::Hyphen before investing any more time in either.
The place to find suitable files is http://mirror.ctan.org/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt/ right from the people who maintain TeX hyphenation files.