Allow loading patterns and exceptions from files or an array reference#1
Allow loading patterns and exceptions from files or an array reference#1bpj wants to merge 1 commit into
Conversation
*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.
|
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. OK, enough coffee-fueled ramblings for today! |
|
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.