diff options
author | Dr. Clea F. Rees <cfrees@imapmail.org> | 2009-08-07 00:46:05 +0000 |
---|---|---|
committer | Dr. Clea F. Rees <cfrees@imapmail.org> | 2009-08-07 00:46:05 +0000 |
commit | 9c90bb16206889de7dd2d82b2105a8e3d2bb8f86 (patch) | |
tree | 701b7b5dcedcee8c27bf251192da05f3bfe1f6bc /Master/texmf-dist/source | |
parent | e508801ab0b9dae308a9f31a025735094bf1ac22 (diff) |
hyph-utf8 new version
git-svn-id: svn://tug.org/texlive/trunk@14560 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
3 files changed, 162 insertions, 1 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb index e275a1d266a..3a8365f2fa5 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-tl-files.rb @@ -19,7 +19,7 @@ languages = $l.list.sort{|a,b| a.name <=> b.name} language_grouping = { 'norwegian' => ['nb', 'nn'], - 'german' => ['de-1901', 'de-1996'], + 'german' => ['de-1901', 'de-1996', 'de-ch-1901'], 'mongolian' => ['mn-cyrl', 'mn-cyrl-x-2a'], 'greek' => ['el-monoton', 'el-polyton'], 'ancientgreek' => ['grc', 'grc-x-ibycus'], diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb new file mode 100644 index 00000000000..0f5c202b379 --- /dev/null +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb @@ -0,0 +1,149 @@ +#!/usr/bin/env ruby + +load 'languages.rb' + +# this file auto-generates loaders for hyphenation patterns - to be improved + +$package_name="hyph-utf8" +$ctan_url = "http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8" + +# TODO - make this a bit less hard-coded +$path_tex_generic="../../../tex/generic" + +$l = Languages.new +# TODO: should be singleton +languages = $l.list.sort{|a,b| a.name <=> b.name} + +language_grouping = { + 'norwegian' => ['nb', 'nn'], + 'german' => ['de-1901', 'de-1996','de-ch-1901'], + 'mongolian' => ['mn-cyrl', 'mn-cyrl-x-2a'], + 'greek' => ['el-monoton', 'el-polyton'], + 'ancientgreek' => ['grc', 'grc-x-ibycus'], + 'chinese' => ['zh-latn'], + # TODO - until someone tells what to do + #'serbian' => ['sr-latn', 'sr-cyrl'], + 'serbian' => ['sr-latn'], +} + +language_used_in_group = Hash.new +language_grouping.each_value do |group| + group.each do |code| + language_used_in_group[code] = true + end +end + +# a hash with language name as key and array of languages as the value +language_groups = Hash.new +# single languages first +languages.each do |language| + # temporary remove cyrilic serbian until someone explains what is needed + if language.code == 'sr-cyrl' then + languages.delete(language) + elsif language_used_in_group[language.code] == nil then + language_groups[language.name] = [language] + end +end +# then groups of languages +language_grouping.each do |name,group| + language_groups[name] = [] + group.each do |code| + language_groups[name].push($l[code]) + end +end + +language_groups.sort.each do |language_name,language_list| + first_line_printed = false + language_list.each do |language| + if not first_line_printed then + puts "<tr>\n\t<td><b>#{language_name.capitalize}</b></td>" + first_line_printed = true; + else + puts "<tr>\n\t<td> </td>" + end + + # synonyms + if language.synonyms != nil and language.synonyms.length > 0 then + synonyms=", #{language.synonyms.join(', ')}" + else + synonyms="" + end + puts "\t<td>#{language.name}#{synonyms}</td>" + +# if language.use_old_patterns == false then + if language.use_new_loader == true then + url_patterns = "#{$ctan_url}/patterns/hyph-#{language.code}.tex" + code = "<a href=\"#{url_patterns}\">#{language.code}</a>" + else + url_patterns = "" + code = language.code + end + + puts "\t<td>#{code}</td>" + + # lefthyphenmin/righthyphenmin + if language.hyphenmin == nil or language.hyphenmin.length == 0 then + lmin = '' + rmin = '' + elsif language.filename_old_patterns == "zerohyph.tex" then + lmin = '' + rmin = '' + else + lmin = language.hyphenmin[0] + rmin = language.hyphenmin[1] + end + puts "\t<td>(#{lmin},#{rmin})</td>" + # which file to use + if language.use_new_loader then + file = "loadhyph-#{language.code}.tex" + else + file = "#{language.filename_old_patterns}" + end + #puts "\t<td>#{file}</td>" + if language.encoding == nil then + encoding = "" + else + encoding = language.encoding.upcase + end + puts "\t<td>#{encoding}</td>" + puts "</tr>\n" + end + # if language_name != "russian" and language_name != "ukrainian" then + # language_list.each do |language| + # if language.use_old_patterns and language.filename_old_patterns != "zerohyph.tex" then + # $file_tlpsrc.puts "runpattern f texmf/tex/generic/hyphen/#{language.filename_old_patterns}" + # end + # end + # end + # if language_name == "greek" then + # $file_tlpsrc.puts "docpattern d texmf/doc/generic/elhyphen" + # elsif language_name == "hungarian" then + # $file_tlpsrc.puts "docpattern d texmf/doc/generic/huhyphen" + # elsif language_name == "german" then + # $file_tlpsrc.puts "runpattern f texmf/tex/generic/hyphen/dehyphtex.tex" + # $file_tlpsrc.puts "runpattern f texmf/tex/generic/hyphen/ghyphen.README" + # end + # $file_tlpsrc.close +end + +#--------------# +# language.dat # +#--------------# +$file_language_dat = File.open("#{$path_language_dat}/language.dat", "w") +language_groups.sort.each do |language_name,language_list| + language_list.each do |language| + if language.use_new_loader then + $file_language_dat.puts "#{language.name}\tloadhyph-#{language.code}.tex" + else + $file_language_dat.puts "#{language.name}\t#{language.filename_old_patterns}" + end + + # synonyms + if language.synonyms != nil then + language.synonyms.each do |synonym| + $file_language_dat.puts "=#{synonym}" + end + end + end +end +$file_language_dat.close diff --git a/Master/texmf-dist/source/generic/hyph-utf8/languages.rb b/Master/texmf-dist/source/generic/hyph-utf8/languages.rb index 6bfb3f5aac6..685255c3b0f 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/languages.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/languages.rb @@ -483,6 +483,18 @@ class Languages < Hash "exceptions" => false, "message" => "Italian Hyphenation Patterns", }, +# kurmanji +{ + "code" => "kmr", + "name" => "kurmanji", + "use_new_loader" => true, + "use_old_patterns" => false, + "filename_old_patterns" => "kmrhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Kurmanji Hyphenation Patterns (v. 1.0 2009/06/29 JKn and MSh)", +}, # latin xu-lahyph.tex { "code" => "la", |