diff options
Diffstat (limited to 'Master/texmf-dist/source')
11 files changed, 2635 insertions, 2753 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/author-data.rb b/Master/texmf-dist/source/generic/hyph-utf8/author-data.rb new file mode 100644 index 00000000000..fa0673c1254 --- /dev/null +++ b/Master/texmf-dist/source/generic/hyph-utf8/author-data.rb @@ -0,0 +1,92 @@ +class Author + @@author_data = { +#authors = { + "donald_knuth" => ["Donald", "Knuth", nil, false, false], + "peter_heslin" => ["Peter", "Heslin", nil, false, false], + "dimitrios_filippou" => ["Dimitrios", "Filippou", "dimitrios{dot}filippou{at}riotinto{dot}com", true, true], + "claudio_beccari" => ["Claudio", "Beccari","claudio{dot}beccari{at}gmail{dot}com", true, true], + "juan_aguirregabiria" => ["Juan M.", "Aguirregabiria", "juanmari{dot}aguirregabiria{at}ehu.es", true, true], + "igor_marinovic" => ["Igor", "Marinović", "marinowski{at}gmail.com", true, true], + "tilla_fick" => ["Tilla", "Fick", "fick{dot}tilla{at}gmail{dot}com", true, true], + "chris_swanepoel" => ["Chris", "Swanepoel", "cj{at}swanepoel{dot}net", true, true], + "matjaz_vrecko" => ["Matjaž", "Vrečko", "matjaz{at}mg-soft{dot}si", true, true], + "goncal_badenes" => ["Gonçal", "Badenes", "g{dot}badenes{at}ieee.org", false, false], + "pavel_sevecek" => ["Pavel", "Ševeček", "pavel{at}lingea{dot}cz", false, false], + # email doesn't work + "jana_chlebikova" => ["Jana", "Chlebíková", "chlebikj{at}dcs{dot}fmph{dot}uniba{dot}sk", false, false], + "yannis_haralambous" => ["Yannis", "Haralambous", "yannis{dot}haralambous{at}telecom-bretagne{dot}eu", true, false], + "frank_jensen" => ["Frank", "Jensen", "frank{dot}jensen{at}hugin{dot}com", true, true], + "sergei_pokrovsky" => ["Sergei", "Pokrovsky", "sergio{dot}pokrovskij{at}gmail{dot}com", true, true], + "javier_bezos" => ["Javier", "Bezos", "jbezos{at}tex-tipografia{dot}com", true, true], + "een_saar" => ["Enn", "Saar", "saar{at}aai{dot}ee", false, false], + "dejan_muhamedagic" => ["Dejan", "Muhamedagić", "dejan{at}hello-penguin{dot}com", true, true], + "brian_wilson" => ["Brian", "Wilson", "bountonw{at}gmail{dot}com", true, true], + "arthur_reutenauer" => ["Arthur", "Reutenauer", "arthur{dot}reutenauer{at}normalesup{dot}org", true, true], + "mojca_miklavec" => ["Mojca", "Miklavec", "mojca{dot}miklavec{dot}lists{at}gmail{dot}com", true, true], + "santhosh_thottingal" => ["Santhosh", "Thottingal", "santhosh{dot}thottingal{at}gmail{dot}com>", true, true], + # email doesn't work + "yves_codet" => ["Yves", "Codet", "ycodet{at}club-internet{dot}fr", true, true], + "rune_kleveland" => ["Rune", "Kleveland", nil, false, false], + # email doesn't work + "ole_michael_selberg" => ["Ole Michael", "Selberg", "o{dot}m{dot}selberg{at}c2i{dot}net", true, true], + "dorjgotov_batmunkh" => ["Dorjgotov", "Batmunkh", "bataak{at}gmail{dot}com", true, true], + "nazar_annagurban" => ["Nazar", "Annagurban", "nazartm{at}gmail{dot}com", false, false], + "jan_michael_rynning" => ["Jan Michael", "Rynning", nil, false, false], + "eduard_werner" => ["Eduard", "Werner", "edi{dot}werner{at}gmx{dot}de", false, false], + "werner_lemberg" => ["Werner", "Lemberg", "wl{at}gnu{dot}org", true, true], + # email doesn't work + "pedro_j_de_rezende" => ["Pedro J.", "de Rezende", "rezende{at}ddc{dot}unicamp{dot}br", false, false], + "j_joao_dias_almeida" => ["J. Joao", "Dias Almeida", "jj{at}di{dot}uminho{dot}pt"], + # email doesn't work + "piet_tutelaers" => ["Piet", "Tutelaers", "p{dot}t{dot}h{dot}tutelaers{at}tue{dot}nl", false, false], + "vytas_statulevicius" => ["Vytas", "Statulevičius", "vytas{at}vtex{dot}nl", false, false], + "sigitas_tolusis" => ["Sigitas", "Tolušis", "sigitas{at}vtex{dot}lt", false, false], + "janis_vilims" => ["Janis", "Vilims", "jvilims{at}apollo{dot}lv", false, false], + "joerg_knappen" => ["Jörg", "Knappen", "jknappen{at}web{dot}de", true, true], + "medeni_shemde" => ["Medeni", "Shemdê", nil, false, false], + "terry_mart" => ["Terry", "Mart", "mart{at}kph{dot}uni-mainz{dot}de", false, false], + # email doesn't work + "jorgen_pind" => ["Jorgen", "Pind", "jorgen{at}lexis{dot}hi{dot}is", false, false], + "marteinn_sverrisson" => ["Marteinn", "Sverrisson", nil, false, false], + # email doesn't work + "kristinn_gylfason" => ["Kristinn", "Gylfason", "kristgy{at}ieee{dot}org", false, false], + # email doesn't work + "kevin_p_scannell" => ["Kevin P.", "Scannell", "scanell{at}slu{dot}edu", false, false], + # email doesn't work + "peter_kleiweg" => ["Peter", "Kleiweg", "p{dot}c{dot}c{dot}kleiweg{at}rug{dot}nl", false, false], + "hanna_kolodziejska" => ["Hanna", "Kołodziejska", nil, false, false], + "boguslaw_jackowski" => ["Bogusław", "Jackowski", nil, true, true], + "marek_rycko" => ["Marek", "Ryćko", nil, false, false], + "vladimir_volovich" => ["Vladimir", "Volovich", nil, true, true], # TODO add e-mail address + "alexander_i_lebedev" => ["Alexander I.", "Lebedev", "swan{at}scon155{dot}phys{dot}msu{dot}su", false, false], # Not sure were 'I' belongs + # first email doesn't work + "maksym_polyakov" => ["Maksym", "Polyakov", "polyama{at}auburn{dot}edu", false, false], # Second e-mail address in ukrhypmp.tex: mpoliak@i.com.ua + "adrian_rezus" => ["Adrian", "Rezus", "adriaan{at}\{sci,cs\}{dot}kun{dot}nl", false, false], + # email doesn't work + "sahak_petrosyan" => ["Sahak", "Petrosyan", "sahak{at}mit{dot}edu", true, true], # I think "true, true" is right. Arthur + "dominik_wujastyk" => ["Dominik", "Wujastyk", "wujastyk{at}gmail{dot}com", false, false], + "graham_toal" => ["Graham", "Toal", nil, false, false], + "donald_e_knuth" => ["Donald E.", "Knuth", nil, false, false], # Don doesn't use e-mail ;-) + "gerard_d_c_kuiken" => ["Gerard D.C.", "Kuiken", nil, false, false], + "pierre_mackay" => ["P. A.", "MacKay", nil, true, true], + "h_turgut_uyar" => ["H. Turgut", "Uyar", "uyar{at}itu{dot}edu{tr}", true, true], + # email doesn't work + "s_ekin_kocabas" => ["S. Ekin", "Kocabas", "kocabas{at}stanford{dot}edu", true, true], + "bence_nagy" => ["Bence", "Nagy", "nagybence{at}tipogral{dot}hu", true, true], + "kauko_saarinen" => ["Kauko", "Saarinen", nil, false, false], + "fred_karlsson" => ["Fred", "Karlsson", nil, false, false], + "rene_bastian" => ["René", "Bastian", nil, false, false], # TODO make contact + "daniel_flipo" => ["Daniel", "Flipo", nil, false, false], # TODO make contact + "bernard_gaulle" => ["Bernard", "Gaulle", nil, false, false], # Deceased... + "theppitak_karoonboonyanan" => ["Theppitak", "Karoonboonyanan", "theppitak{at}gmail{dot}com", true, true], + "levan_shoshiashvili" => ["Levan", "Shoshiashvili", "shoshia{at}hotmail{dot}com", true, true], + # email doesn't work + "javier_mugica" => ["Javier", "Múgica", "javier{at}digi21{dot}eu", true, true], + "georgi_boshnakov" => ["Georgi", "Boshnakov", "georgi{dot}boshnakov{at}manchester{dot}ac{dot}uk", true, true], + "mike_kroutikov" => ["Mike", "Kroutikov", "pgmmpk{at}gmail{dot}com", true, true], + "aleksandr_andreev" => ["Aleksandr", "Andreev", "", true, true], + "maksim_salau" => ["Maksim", "Salau", "maksim{dot}salau{at}gmail{dot}com", true, false], + "wie_ming_ang" => ["Wie-Ming", "Cittānurakkho Bhikkhu", "wiemingang{at}gmail{dot}com", true, true] +} +# +end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-converters.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-converters.rb index 7b3a0cff320..d76aa29657e 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-converters.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-converters.rb @@ -1,166 +1,177 @@ #!/usr/bin/env ruby -require File.expand_path(File.join(File.dirname(__FILE__), 'hyph-utf8')) - -# $encodings = ["ec", "qx", "t2a", "lmc", "il2", "il3", "l7x", "t8m", "lth"] -$encodings = ["t8m", "lth"] +require_relative 'hyph-utf8' $path_root=File.expand_path("../../../..", __FILE__) $encoding_data_dir = File.expand_path("../data/encodings", __FILE__) $output_data_dir = "#{$path_root}/tex/generic/hyph-utf8/conversions" -$encodings.each do |encoding| +def output_file_name(encoding) + File.join($output_data_dir, sprintf('conv-utf8-%s.tex', encoding)) +end + +$header = <<__EOHEADER__ +%% conv-utf8-%s.tex +%% +%% Conversion from UTF-8 to %s, +%% used before loading hyphenation patterns for 8-bit TeX engines. +%% +%% This file is part of hyph-utf8 package and autogenerated. +%% See http://tug.org/tex-hyphen +%% +%% Copyright 2008-%d TeX Users Group. +%% You may freely use, modify and/or distribute this file. +%% (But consider adapting the scripts if you need modifications.) +__EOHEADER__ + +def output_copyright_notice(outfile, encoding) + outfile.printf $header, encoding, encoding.upcase, Time.new.year +end + +$uniconvmacro1 = <<__EOUNIMAC1__ +% macros adapted from ConTeXt MKII; see unic-ini.mkii +\\def\\unicodechar#1{% + \\ifcsname unichar@\\number#1\\endcsname + \\csname unichar@\\number#1\\endcsname + \\else + \\errmessage{Unicode character [#1] not in encoding.}% + \\fi} +__EOUNIMAC1__ + +$uniconvmacros = [nil, nil] + +$uniconvmacros << <<__EOTWOBYTES__ +\\def\\utftwouniglyph#1#2% + {\\expandafter\\unicodechar\\expandafter + {\\the\\numexpr64*(#1-192)+`#2-128\\relax}} +__EOTWOBYTES__ + +$uniconvmacros << <<__EOTHREEBYTES__ +\\def\\utfthreeuniglyph#1#2#3% + {\\expandafter\\unicodechar\\expandafter + {\\the\\numexpr4096*(#1-224)+64*(`#2-128)+`#3-128\\relax}} +__EOTHREEBYTES__ + +$uniconvmacros << <<__EOFOURBYTES__ +\\def\\utffouruniglyph#1#2#3#4% + {\\expandafter\\unicodechar\\expandafter + {\\the\\numexpr262144*(#1-240)+4096*(`#2-128)+64*(`#3-128)+`#4-128\\relax}} +__EOFOURBYTES__ + +$uniconvmacro2 = <<__EOUNIMAC2__ + +\\def\\addunichar #1 #2 {\\expandafter\\def\\csname unichar@\\number#1\\endcsname{#2}} + +% \\addunichar "unicode_code - ^^font_encoding_code +__EOUNIMAC2__ + +["t8m", "lth"].each do |encoding| # load encoding e = HyphEncoding.new(encoding) # open file - file_out = File.open("#{$output_data_dir}#{File::Separator}conv-utf8-#{encoding}.tex", "w") - - # copyright notice - file_out.puts "% conv-utf8-#{encoding}.tex" - file_out.puts "%" - file_out.puts "% Conversion from UTF-8 to #{encoding.upcase}," - file_out.puts "% used before loading hyphenation patterns for 8-bit TeX engines." - file_out.puts "%" - file_out.puts "% This file is part of hyph-utf8 package and autogenerated." - file_out.puts "% See http://tug.org/tex-hyphen" - file_out.puts "%" - file_out.puts "% Copyright 2008-#{Time.new.year} TeX Users Group." - file_out.puts "% You may freely use, modify and/or distribute this file." - file_out.puts "% (But consider adapting the scripts if you need modifications.)" - file_out.puts - - # macro to get mapping unicode -> font encoding & error message if screwed up - file_out.puts '% macros adapted from ConTeXt MKII; see unic-ini.mkii' - file_out.puts '\def\unicodechar#1{%' - file_out.puts ' \ifcsname unichar@\number#1\endcsname' - file_out.puts ' \csname unichar@\number#1\endcsname' - file_out.puts ' \else' - file_out.puts ' \errmessage{Unicode character [#1] not in encoding.}%' - file_out.puts ' \fi}' - - # minimal and maximal lenght of characters in the encoding (until now just 2 & 3) - unicode_characters_array = e.unicode_characters.sort - length_min = unicode_characters_array.first[1].bytes.size - length_max = unicode_characters_array.last[1].bytes.size - - # only output the necessary macros for transforming UTF-8 -> Unicode number - if length_min <= 2 and length_max >= 2 then - file_out.puts '\def\utftwouniglyph#1#2%' - file_out.puts ' {\expandafter\unicodechar\expandafter' - file_out.puts ' {\the\numexpr64*(#1-192)+`#2-128\relax}}' - end - if length_min <= 3 and length_max >= 3 then - file_out.puts '\def\utfthreeuniglyph#1#2#3%' - file_out.puts ' {\expandafter\unicodechar\expandafter' - file_out.puts ' {\the\numexpr4096*(#1-224)+64*(`#2-128)+`#3-128\relax}}' - end - if length_min <= 4 and length_max >= 4 then - file_out.puts '\def\utffouruniglyph#1#2#3#4%' - file_out.puts ' {\expandafter\unicodechar\expandafter' - file_out.puts ' {\the\numexpr262144*(#1-240)+4096*(`#2-128)+64*(`#3-128)+`#4-128\relax}}' - end + File.open(output_file_name(encoding), "w") do |file_out| - # macro to store mapping unicode -> font encoding - file_out.puts - file_out.puts '\def\addunichar #1 #2 {\expandafter\def\csname unichar@\number#1\endcsname{#2}}' - file_out.puts - file_out.puts '% \addunichar "unicode_code - ^^font_encoding_code' + # copyright notice + output_copyright_notice(file_out, encoding) + file_out.puts - # all unicode characters in the encoding - e.unicode_characters.sort.each do |code,c| - file_out.puts sprintf("\\addunichar \"%04X ^^%02x \\lccode\"%02X=\"%02X %% %s - %s", - c.code_uni, c.code_enc, c.code_enc, c.code_enc, [c.code_uni].pack('U'), c.name) - end - file_out.puts - - # make all the possible first characters active - # output the definition into file - e.unicode_characters_first_byte.sort.each do |first_byte_code,chars| - byte = first_byte_code.hex - size = chars[0].bytes.size - # 2-byte: 0b11000000 <= byte < 0b11100000 - if size == 2 then - str = "two" - # 3-byte: 0b11100000 <= byte < 0b11110000 - elsif size == 3 then - str = "three" - # 4-byte: 0b11110000 <= byte < 0b11111000 - elsif size == 4 then - str = "four" + # macro to get mapping unicode -> font encoding & error message if screwed up + file_out.puts $uniconvmacro1 + + # minimal and maximal length of characters in the encoding (until now just 2 & 3) + unicode_characters_array = e.unicode_characters.sort + length_min = unicode_characters_array.first[1].bytes.size + length_max = unicode_characters_array.last[1].bytes.size + + # only output the necessary macros for transforming UTF-8 -> Unicode number + (length_min..length_max).each do |nbytes| + file_out.puts $uniconvmacros[nbytes] end - file_out.puts sprintf("\\catcode\"%02X=\\active \\def^^%02x{\\utf%suniglyph{\"%02X}}", byte, byte, str, byte) - end - file_out.close -end + # macro to store mapping unicode -> font encoding + file_out.puts $uniconvmacro2 -$encodings = ["ec", "qx", "t2a", "lmc", "il2", "il3", "l7x"] + # all unicode characters in the encoding + e.unicode_characters.sort.each do |code,c| + file_out.printf("\\addunichar \"%04X ^^%02x \\lccode\"%02X=\"%02X %% %s - %s\n", + c.code_uni, c.code_enc, c.code_enc, c.code_enc, [c.code_uni].pack('U'), c.name) + end + file_out.puts + + # make all the possible first characters active + # output the definition into file + e.unicode_characters_first_byte.sort.each do |first_byte_code,chars| + byte = first_byte_code.hex + size = chars[0].bytes.size + # 2-byte: 0b11000000 <= byte < 0b11100000 + str = case size + when 2 then + "two" + # 3-byte: 0b11100000 <= byte < 0b11110000 + when 3 then + "three" + # 4-byte: 0b11110000 <= byte < 0b11111000 + when 4 then + "four" + end + file_out.printf("\\catcode\"%02X=\\active \\def^^%02x{\\utf%suniglyph{\"%02X}}\n", byte, byte, str, byte) + end + end +end -$encodings.each do |encoding| +["ec", "qx", "t2a", "lmc", "il2", "il3", "l7x"].each do |encoding| # load encoding e = HyphEncoding.new(encoding) # open file - file_out = File.open("#{$output_data_dir}#{File::Separator}conv-utf8-#{encoding}.tex", "w") - - # copyright notice - file_out.puts "% conv-utf8-#{encoding}.tex" - file_out.puts "%" - file_out.puts "% Conversion from UTF-8 to #{encoding.upcase}," - file_out.puts "% used before loading hyphenation patterns for 8-bit TeX engines." - file_out.puts "%" - file_out.puts "% This file is part of hyph-utf8 package and autogenerated." - file_out.puts "% See http://tug.org/tex-hyphen" - file_out.puts "%" - file_out.puts "% Copyright 2008-#{Time.new.year} TeX Users Group." - file_out.puts "% You may freely use, modify and/or distribute this file." - file_out.puts "% (But consider adapting the scripts if you need modifications.)" - file_out.puts "%" - - e.unicode_characters_first_byte.sort.each do |first_byte_code,chars| - # sorting all the second characters alphabetically - chars.sort!{|x,y| x.code_uni <=> y.code_uni } - # make all the possible first characters active - # output the definition into file - file_out.puts sprintf("\\catcode\"%02X=\\active", first_byte_code.hex) - end - file_out.puts "%" - e.unicode_characters_first_byte.sort.each do |first_byte_code,chars| - first_byte_code = first_byte_code.hex - size = chars[0].bytes.size - if size != 2 then - throw "The encoding #{encoding} uses more than two bytes to encode characters" - else - - file_out.puts sprintf("\\def^^%02x#1{%%", first_byte_code) - string_fi = "" - for i in 1..(chars.size) - uni_character = chars[i-1] - enc_byte = uni_character.code_enc - enc_byte = [ uni_character.code_enc ].pack('c').unpack('H2') - ux_code = sprintf("U+%04X", uni_character.code_uni) - file_out.puts sprintf("\t\\ifx#1^^%02x^^%02x\\else %% %s - U+%04X - %s", uni_character.bytes[1], uni_character.code_enc, [uni_character.code_uni].pack('U'), uni_character.code_uni, uni_character.name) - string_fi = string_fi + "\\fi" + File.open(output_file_name(encoding), "w") do |file_out| + + # copyright notice + output_copyright_notice(file_out, encoding) + file_out.puts '%' + + e.unicode_characters_first_byte.sort.each do |first_byte_code,chars| + # sorting all the second characters alphabetically + chars.sort!{|x,y| x.code_uni <=> y.code_uni } + # make all the possible first characters active + # output the definition into file + file_out.printf("\\catcode\"%02X=\\active\n", first_byte_code.hex) + end + file_out.puts "%" + e.unicode_characters_first_byte.sort.each do |first_byte_code,chars| + first_byte_code = first_byte_code.hex + size = chars[0].bytes.size + if size != 2 then + throw "The encoding #{encoding} uses more than two bytes to encode characters" + else + + file_out.printf("\\def^^%02x#1{%%\n", first_byte_code) + string_fi = "" + for i in 1..(chars.size) + uni_character = chars[i-1] + enc_byte = uni_character.code_enc + enc_byte = [ uni_character.code_enc ].pack('c').unpack('H2') + file_out.printf("\t\\ifx#1^^%02x^^%02x\\else %% %s - U+%04X - %s\n", uni_character.bytes[1], uni_character.code_enc, [uni_character.code_uni].pack('U'), uni_character.code_uni, uni_character.name) + string_fi = string_fi + "\\fi" + end + + # at least three bytes end - - # at least three bytes + file_out.puts "\t\\errmessage{Hyphenation pattern file corrupted or #{encoding} encoding not supported!}" + file_out.puts string_fi + "}" + end + file_out.puts '%' + file_out.puts '% ensure all the chars above have valid \lccode values' + file_out.puts '%' + e.lowercase_characters.each do |character| + code = [ character.code_enc ].pack("c").unpack("H2").first.upcase + # \lccode"FF="FF + file_out.printf "\\lccode\"%s=\"%s %% %s - U+%04X - %s\n", code, code, [character.code_uni].pack('U'), character.code_uni, character.name end - file_out.puts "\t\\errmessage{Hyphenation pattern file corrupted or #{encoding} encoding not supported!}" - file_out.puts string_fi + "}" - end - file_out.puts '%' - file_out.puts '% ensure all the chars above have valid \lccode values' - file_out.puts '%' - e.lowercase_characters.each do |character| - code = [ character.code_enc ].pack("c").unpack("H2").first.upcase - # \lccode"FF="FF - ux_code = sprintf("U+%04X", character.code_uni) - file_out.puts "\\lccode\"#{code}=\"#{code} % #{[character.code_uni].pack('U')} - #{ux_code} - #{character.name}" - end - file_out.puts - file_out.close + file_out.puts + end end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb index 2a13d32d065..4b9d8a62c3b 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-pattern-loaders.rb @@ -12,7 +12,7 @@ $path_tex_generic=File.expand_path("../../../../tex/generic", __FILE__) $path_loadhyph="#{$path_tex_generic}/#{$package_name}/loadhyph" # TODO: should be singleton -languages = Languages.new.list +languages = Language.all #text_if_native_utf = "\input pattern-loader.tex\n\\ifNativeUtfEightPatterns" @@ -28,7 +28,7 @@ string_enc = (language.encoding == nil) ? "" : language.encoding.upcase + " " # TODO: write a more comprehensive one text_header = "% filename: loadhyph-#{language.code}.tex -% language: #{language.name} +% language: #{language.name.safe} % % Loader for hyphenation patterns, generated by % source/generic/hyph-utf8/generate-pattern-loaders.rb @@ -82,7 +82,7 @@ text_patterns_quote = " \\input hyph-quote-#{language.code}.tex" ########### lccodes_common = [] -if language.has_quotes then +if language.has_apostrophes then lccodes_common.push("\\lccode`\\'=`\\'") end if language.has_dashes then @@ -97,7 +97,8 @@ if ['sh-latn', 'sh-cyrl'].include?(language.code) then " % We load both scripts at the same time to simplify usage"] end - if language.use_new_loader then + next if language.use_old_loader + if language.code == 'sh-latn' then filename = "#{$path_loadhyph}/loadhyph-sr-latn.tex" elsif language.code == 'sh-cyrl' then @@ -212,7 +213,7 @@ end file.puts(text_if_native_utf) file.puts(text_engine_utf8) file.puts(text_patterns_utf8) - if language.has_quotes + if language.has_apostrophes file.puts(text_patterns_quote) end file.puts('\else') @@ -233,5 +234,4 @@ end ####### file.puts('\endgroup') end - end end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb index 2c1a6ee60d4..fe64c38364b 100755 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb @@ -6,131 +6,55 @@ # use 'gem install unicode' if unicode is missing on your computer require 'unicode' -$LOAD_PATH << File.expand_path('..', __FILE__) -require 'languages.rb' +require_relative 'languages.rb' +include Language::TeXLive -$path_root=File.expand_path("../../../..", __FILE__) -$path_plain="#{$path_root}/tex/generic/hyph-utf8/patterns/txt" -$path_quote="#{$path_root}/tex/generic/hyph-utf8/patterns/quote" -$path_TL=File.expand_path("../../../../../TL", __FILE__) -$path_language_dat_lua="#{$path_root}/tex/luatex/hyph-utf8/config" +# FIXME sr-cyrl? +Language.all.sort.each do |language| + code = language.code -$l = Languages.new -# TODO: should be singleton -languages = $l.list.sort{|a,b| a.name <=> b.name} - -# TODO: we should rewrite this -# not using: eo, el -# todo: mn, no!, sa, sh -# codes = ['bg', 'ca', 'cs', 'cy', 'da', 'de-1901', 'de-1996', 'de-ch-1901', 'en-gb', 'en-us', 'es', 'et', 'eu', 'fi', 'fr', 'ga', 'gl', 'hr', 'hsb', 'hu', 'ia', 'id', 'is', 'it', 'kmr', 'la', 'lt', 'lv', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sr-cyrl', 'sv', 'tr', 'uk'] - -language_codes = Hash.new -languages.each do |language| - language_codes[language.code] = language.code -end - -language_codes['mn-cyrl-x-lmc'] = nil -# language_codes['sh-latn'] = nil -# language_codes['sh-cyrl'] = nil -# language_codes['sr-cyrl'] = nil - -# $file_language_dat_lua = File.open("#{$path_language_dat_lua}/language.dat.lua", "w") -# $file_language_dat_lua.puts "return {\n" - -languages.sort{|x,y| x.code <=> y.code }.each do |language| - if language.use_new_loader or language.code == 'en-us' then - include_language = true - else - include_language = false + if language.use_old_loader || code == 'mn-cyrl-x-lmc' puts "(skipping #{language.code})" + next end - code = language_codes[language.code] - if code == nil - include_language = false - end - if code == 'en_US' - include_language = true - end - - if include_language - puts "generating #{code}" - - $file_pat = File.open("#{$path_plain}/hyph-#{code}.pat.txt", 'w') - $file_hyp = File.open("#{$path_plain}/hyph-#{code}.hyp.txt", 'w') - $file_let = File.open("#{$path_plain}/hyph-#{code}.chr.txt", 'w') - $file_inf = File.open("#{$path_plain}/hyph-#{code}.lic.txt", 'w') - - patterns = language.get_patterns - exceptions = language.get_exceptions - patterns_quote = Array.new + puts "generating #{code}" - if code == 'nn' or code == 'nb' - patterns = "" - patterns = $l['no'].get_patterns - end + outfile = Proc.new do |ext| + File.open File.join(PATH::TXT, sprintf('hyph-%s.%s.txt', code, ext)), 'w' + end - characters_indexes = patterns.join('').gsub(/[.0-9]/,'').unpack('U*').sort.uniq + # patterns + patterns = language.extract_apostrophes + file = outfile.('pat') + patterns[:plain].each do |pattern| + file.puts pattern + end - # patterns - patterns.each do |pattern| - $file_pat.puts pattern - if pattern =~ /'/ then - if code != "grc" and code != "el-monoton" and code != "el-polyton" then - pattern_with_quote = pattern.gsub(/'/,"’") - $file_pat.puts pattern_with_quote - patterns_quote.push(pattern_with_quote) - end - end - end - # exceptions - if exceptions != "" - $file_hyp.puts exceptions - end - # letters - characters_indexes.each do |c| - ch = [c].pack('U') - $file_let.puts ch + Unicode.upcase(ch) - if ch == "'" and code != "grc" and code != "el-monoton" and code != "el-polyton" then - $file_let.puts "’’" - end + # apostrophes if applicable + with_apostrophe = patterns[:with_apostrophe] + if with_apostrophe + file = File.open File.join(PATH::QUOTE, sprintf('hyph-quote-%s.tex', code)), 'w' + file.printf "\\bgroup\n\\lccode`\\’=`\\’\n\\patterns{\n" + with_apostrophe.each do |pattern| + file.printf "%s\n", pattern end - # licence and readme - # $file_inf.puts "#{language.message}\n\n(more info about the licence to be added later)\n\n" - $file_inf.puts language.get_comments_and_licence - - $file_pat.close - $file_hyp.close - $file_let.close - $file_inf.close + file.puts "}\n\\egroup\n" + end - if patterns_quote.length > 0 - f = File.open("#{$path_quote}/hyph-quote-#{code}.tex", 'w') - f.puts "\\bgroup\n\\lccode`\\’=`\\’\n\\patterns{\n#{patterns_quote.join("\n")}\n}\n\\egroup\n" - f.close - end + # exceptions + file = outfile.('hyp') # This ensure a file is created, even if it may be empty + file.puts language.exceptions if language.exceptions != "" - # $file_language_dat_lua.puts "\t[\"#{language.name}\"]={" - # $file_language_dat_lua.puts "\t\tloader=\"loadhyph-#{language.code}.tex\"," - # $file_language_dat_lua.puts "\t\tcode=\"#{code}\"," - # if language.hyphenmin == nil or language.hyphenmin.length == 0 then - # lmin = '' - # rmin = '' - # else - # lmin = language.hyphenmin[0] - # rmin = language.hyphenmin[1] - # end - # $file_language_dat_lua.puts "\t\tlefthyphenmin=#{lmin}," - # $file_language_dat_lua.puts "\t\trighthyphenmin=#{rmin}," - # if language.synonyms.length > 0 - # $file_language_dat_lua.puts "\t\tsynonyms={\"#{language.synonyms.join('","')}\"}," - # else - # $file_language_dat_lua.puts "\t\tsynonyms={}," - # end - # $file_language_dat_lua.puts "\t},\n" + # characters + file = outfile.('chr') + language.extract_characters.each do |character| + file.puts character end -end -# $file_language_dat_lua.puts "}\n" + # comments and licence + file = outfile.('lic') + file.puts language.get_comments_and_licence -# $file_language_dat_lua.close + file.close +end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-ptex-patterns.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-ptex-patterns.rb index 1399280a5a8..e537fe43ba7 100755 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-ptex-patterns.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-ptex-patterns.rb @@ -1,19 +1,10 @@ #!/usr/bin/env ruby -require File.expand_path(File.join(File.dirname(__FILE__), 'hyph-utf8')) +require_relative 'hyph-utf8' +require_relative 'languages' # this file generates patterns for pTeX out of the plain ones -# use 'gem install unicode' if unicode is missing on your computer -# require 'jcode' -# require 'rubygems' -# require 'unicode' - -require_relative 'languages.rb' - -$path_root=File.expand_path("../../../..", __FILE__) -$path_ptex="#{$path_root}/tex/generic/hyph-utf8/patterns/ptex" - # load encodings encodings_list = ["ascii", "ec", "qx", "t2a", "lmc", "il2", "il3", "l7x", "t8m", "lth"] encodings = Hash.new @@ -21,46 +12,37 @@ encodings_list.each do |encoding_name| encodings[encoding_name] = HyphEncoding.new(encoding_name) end -$l = Languages.new - -# TODO: should be singleton -languages = $l.list.sort{|a,b| a.name <=> b.name} - -language_codes = Hash.new -languages.each do |language| - language_codes[language.code] = language.code -end - -languages.sort{|x,y| x.code <=> y.code }.each do |language| - encoding = nil - if language.use_new_loader then - if language.encoding == nil or language_codes[language.code] == nil - include_language = false - puts "(skipping #{language.code} # encoding)" - elsif language.encoding == 'ascii' - include_language = false - puts "(skipping #{language.code} # ascii)" - else - include_language = true - encoding = encodings[language.encoding] - end - else - include_language = false +header = <<-HEADER +%% pTeX-friendly hyphenation patterns +%% +%% language: %s (%s) +%% encoding: %s +%% +%% This file has been auto-generated from hyph-%s.tex +%% with a script [texmf]/scripts/generic/hyph-utf8/generate-ptex-patterns.rb +%% See the original file for details about author, licence etc. +%% +HEADER + +Language.all.sort.each do |language| + if language.use_old_loader puts "(skipping #{language.code} # loader)" + next end - code = language_codes[language.code] - - if include_language - puts ">> generating #{code} (#{language.name})" - file_ptex = File.open("#{$path_ptex}/hyph-#{code}.#{language.encoding}.tex", "w") + if language.encoding == nil || language.encoding == 'ascii' + puts "(skipping #{language.code} # #{if language.encoding then 'ascii' else 'encoding' end})" + next + else + encoding = encodings[language.encoding] + end - patterns = language.get_patterns - exceptions = language.get_exceptions + code = language.code - if code == 'nn' or code == 'nb' - patterns = $l['no'].get_patterns - end + puts ">> generating #{code} (#{language.name.safe})" + File.open(File.join(PATH::PTEX, sprintf('hyph-%s.%s.tex', code, language.encoding)), 'w') do |file_ptex| + patterns = language.patterns + exceptions = language.exceptions characters = patterns.join('').gsub(/[.0-9]/,'').unpack('U*').sort.uniq @@ -69,15 +51,7 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language| exceptions = encoding.convert_to_escaped_characters(exceptions) end - file_ptex.puts("% pTeX-friendly hyphenation patterns") - file_ptex.puts("%") - file_ptex.puts("% language: #{language.name} (#{language.code})") - file_ptex.puts("% encoding: #{language.encoding}") - file_ptex.puts("%") - file_ptex.puts("% This file has been auto-generated from hyph-#{language.code}.tex") - file_ptex.puts("% with a script [texmf]/scripts/generic/hyph-utf8/generate-ptex-patterns.rb") - file_ptex.puts("% See the original file for details about author, licence etc.") - file_ptex.puts("%") + file_ptex.printf(header, language.name.safe, language.code, language.encoding, language.code) file_ptex.puts("\\bgroup") # setting lccodes for letters @@ -86,7 +60,7 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language| # skip elsif c >= 128 then code = encoding.unicode_characters[c].code_enc - file_ptex.puts sprintf("\\lccode\"%02X=\"%02X", code, code) + file_ptex.printf("\\lccode\"%02X=\"%02X\n", code, code) end end # patterns @@ -98,7 +72,5 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language| file_ptex.puts("\\hyphenation{\n#{exceptions.join("\n")}\n}") end file_ptex.puts("\\egroup") - - file_ptex.close end end 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 845d43951c0..223b3f04579 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 @@ -4,274 +4,79 @@ # this file auto-generates tlpsrc files for hyphenation patterns - to be improved require_relative 'languages.rb' - -$package_name="hyph-utf8" - -# TODO - make this a bit less hard-coded -$path_tex_generic=File.expand_path("../../../../tex/generic", __FILE__) -$path_TL=File.expand_path("../../../../../TL", __FILE__) -$path_language_dat="#{$path_TL}/texmf-dist/tex/generic/config" -# hyphen-foo.tlpsrc for TeX Live -$path_tlpsrc="#{$path_TL}/tlpkg/tlpsrc" - -$path_txt="#{$path_tex_generic}/#{$package_name}/patterns/txt" - -$l = Languages.new -# TODO: should be singleton -languages = $l.list.sort{|a,b| a.name <=> b.name} - -language_grouping = { - 'english' => ['en-gb', 'en-us'], - 'norwegian' => ['nb', 'nn'], - 'german' => ['de-1901', 'de-1996', 'de-ch-1901'], - 'mongolian' => ['mn-cyrl', 'mn-cyrl-x-lmc'], - 'greek' => ['el-monoton', 'el-polyton'], - 'ancientgreek' => ['grc', 'grc-x-ibycus'], - 'chinese' => ['zh-latn-pinyin'], - 'indic' => ['as', 'bn', 'gu', 'hi', 'kn', 'ml', 'mr', 'or', 'pa', 'ta', 'te'], - 'serbian' => ['sh-latn', 'sh-cyrl'], - 'latin' => ['la', 'la-x-classic', 'la-x-liturgic'], -} - -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' or language.code == 'en-us' then - # ignore the language - elsif language_used_in_group[language.code] == nil then - language_groups[language.name] = [language] - end - - if language.code == 'sh-latn' then - language.code = 'sr-latn' - elsif language.code == 'sh-cyrl' then - language.code = 'sr-cyrl' - 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 - -# languages.each do |language| -# if language.hyphenmin == nil then -# lmin = '' -# rmin = '' -# else -# lmin = language.hyphenmin[0] -# rmin = language.hyphenmin[1] -# end -# puts "#{language.name}: #{lmin} #{rmin}" -# end +include Language::TeXLive +include TeXLive #--------# # TLPSRC # #--------# -language_groups.sort.each do |language_name,language_list| - files_path_hyph8 = "tex/generic/hyph-utf8" - files_run = [] - files_doc = [] - files_src = [] - $file_tlpsrc = File.open("#{$path_tlpsrc}/hyphen-#{language_name}.tlpsrc", 'w') - puts "generating #{$path_tlpsrc}/hyphen-#{language_name}.tlpsrc" - - #$file_tlpsrc.puts "name hyphen-#{language_name}" - $file_tlpsrc.puts "category TLCore" - $file_tlpsrc.puts "depend hyphen-base" - $file_tlpsrc.puts "depend hyph-utf8" - - # external dependencies for Russian and Ukrainian (until we implement the new functionality at least) - if language_name == "russian" then - $file_tlpsrc.puts "depend ruhyphen" - elsif language_name == "ukrainian" then - $file_tlpsrc.puts "depend ukrhyph" - elsif language_name == "norwegian" then - files_run.push("#{files_path_hyph8}/patterns/tex/hyph-no.tex") - end - language_list.each do |language| - if language.description_s != nil then - $file_tlpsrc.puts "shortdesc #{language.description_s}." - $file_tlpsrc.puts "longdesc #{language.description_l.join("\nlongdesc ")}" - # if language.version != nil then - # $file_tlpsrc.puts "catalogue-version #{language.version}" - # end - end - name = "name=#{language.name}" - # synonyms - if language.synonyms != nil and language.synonyms.length > 0 then - synonyms=" synonyms=#{language.synonyms.join(',')}" - else - synonyms="" - end - # 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 - hyphenmins = "lefthyphenmin=#{lmin} \\\n\trighthyphenmin=#{rmin}" - # which file to use - file = "" - file_patterns = "" - file_exceptions = "" - if language.use_new_loader then - file = "file=loadhyph-#{language.code}.tex" - files_run.push("#{files_path_hyph8}/loadhyph/loadhyph-#{language.code}.tex") - if language.has_quotes then - files_run.push("#{files_path_hyph8}/patterns/quote/hyph-quote-#{language.code}.tex") - end - - if language.code == "mn-cyrl-x-lmc" then - files_run.push("#{files_path_hyph8}/patterns/tex/hyph-#{language.code}.tex") - files_run.push("#{files_path_hyph8}/patterns/ptex/hyph-#{language.code}.#{language.encoding}.tex") - # we skip the mongolian language for luatex files - else - if language.code == "sr-latn" or language.code == "sr-cyrl" then - code = language.code.gsub(/sr/, "sh") - filename_pat = "hyph-sh-latn.pat.txt,hyph-sh-cyrl.pat.txt" - filename_hyp = "hyph-sh-latn.hyp.txt,hyph-sh-cyrl.hyp.txt" - - files_run.push("#{files_path_hyph8}/patterns/tex/hyph-#{code}.tex") - files_run.push("#{files_path_hyph8}/patterns/ptex/hyph-#{code}.#{language.encoding}.tex") - # duplicate entries (will be removed later) - files_run.push("#{files_path_hyph8}/patterns/tex/hyph-sr-cyrl.tex") - ['chr', 'pat', 'hyp', 'lic'].each do |t| - files_run.push("#{files_path_hyph8}/patterns/txt/hyph-#{code}.#{t}.txt") - # duplicate entries (will be removed later) - files_run.push("#{files_path_hyph8}/patterns/txt/hyph-sr-cyrl.#{t}.txt") - end - else - filename_pat = "hyph-#{language.code}.pat.txt" - filename_hyp = "hyph-#{language.code}.hyp.txt" - - files_run.push("#{files_path_hyph8}/patterns/tex/hyph-#{language.code}.tex") - if language.encoding != nil and language.encoding != "ascii" then - files_run.push("#{files_path_hyph8}/patterns/ptex/hyph-#{language.code}.#{language.encoding}.tex") - elsif language.code == "cop" then - files_run.push("#{files_path_hyph8}/patterns/tex-8bit/#{language.filename_old_patterns}") - # files_run.push("#{files_path_hyph8}/patterns/tex-8bit/copthyph.tex") - end - ['chr', 'pat', 'hyp', 'lic'].each do |t| - files_run.push("#{files_path_hyph8}/patterns/txt/hyph-#{language.code}.#{t}.txt") - end +Package.all.sort.each do |package| + tlpsrcname = File.join(PATH::TLPSRC, sprintf('hyphen-%s.tlpsrc', package.name.safe)) + file_tlpsrc = File.open(tlpsrcname, 'w') + printf "generating %s\n", tlpsrcname - # check for existance of patterns and exceptions - if !File::exists?( "#{$path_txt}/#{filename_pat}" ) then - puts "some problem with #{$path_txt}/#{filename_pat}!!!" - end - if !File::exists?( "#{$path_txt}/#{filename_hyp}" ) then - puts "some problem with #{$path_txt}/#{filename_hyp}!!!" - end - end + file_tlpsrc.puts "category TLCore" + package.list_dependencies.each do |dependency| + file_tlpsrc.puts dependency + end - file_patterns = "file_patterns=#{filename_pat}" - if File::size?( "#{$path_txt}/#{filename_hyp}" ) != nil then - file_exceptions = "file_exceptions=#{filename_hyp}" - # TODO: nasty workaround - elsif language.code == "sr-latn" or language.code == "sr-cyrl" then - file_exceptions = "file_exceptions=#{filename_hyp}" - else - file_exceptions = "file_exceptions=" - # puts "> #{filename_hyp} is empty" - end - end - else - file = "file=#{language.filename_old_patterns}" - if language.code == 'ar' or language.code == 'fa' then - file = file + " \\\n\tfile_patterns=" - elsif language.code == 'grc-x-ibycus' then - # TODO: fix this - file = file + " \\\n\tluaspecial=\"disabled:8-bit only\"" - end + # FIXME Still doesn’t work well for Latin + file_tlpsrc.printf "shortdesc %s.\n", package.description_s + package.description_l.each do |line| + file_tlpsrc.printf "longdesc %s\n", line + end + package.languages.each do |language| + if language.description_s && language.description_l then + # file_tlpsrc.printf "shortdesc %s.\n", language.description_s + # language.description_l.each do |line| + # file_tlpsrc.printf "longdesc %s\n", line + # end end - $file_tlpsrc.puts "execute AddHyphen \\\n\t#{name}#{synonyms} \\" - $file_tlpsrc.print "\t#{hyphenmins} \\\n\t#{file}" - if file_patterns + file_exceptions != "" - $file_tlpsrc.print " \\\n\t#{file_patterns} \\\n\t#{file_exceptions}" + file_tlpsrc.printf "execute AddHyphen \\\n\tname=%s%s \\\n", language.name.safe, language.list_synonyms + file_tlpsrc.printf "\t%s \\\n\t%s", language.list_hyphenmins, language.list_loader + if language.patterns_line + language.exceptions_line != "" + file_tlpsrc.printf " \\\n\t%s \\\n\t%s", language.patterns_line, language.exceptions_line end if language.code == "mn-cyrl-x-lmc" then - $file_tlpsrc.print " \\\n\tluaspecial=\"disabled:only for 8bit montex with lmc encoding\"" + file_tlpsrc.printf " \\\n\tluaspecial=\"disabled:only for 8bit montex with lmc encoding\"" end # end-of-line - $file_tlpsrc.puts - - # add sources - if ['es', 'eu', 'gl', 'hy', 'mul-ethi', 'tk', 'tr'].include?(language.code) then - files_src.push("source/generic/hyph-utf8/languages/#{language.code}") - end - # add documentation - if ['bg', 'es', 'hu', 'sa'].include?(language.code) then - files_doc.push("doc/generic/hyph-utf8/#{language.code}") - end - 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" and language.filename_old_patterns != "copthyph.tex" then - files_run.push("tex/generic/hyphen/#{language.filename_old_patterns}") - end - end + file_tlpsrc.puts end - # documeentation - if language_name == "greek" then - files_doc.push("doc/generic/elhyphen") - elsif language_name == "hungarian" then - files_doc.push("doc/generic/huhyphen") - elsif language_name == "german" then - files_run.push("tex/generic/hyphen/dehyphtex.tex") - files_run.push("tex/generic/hyphen/ghyphen.README") + # documentation + package.list_support_files('doc').sort.each do |filename| + file_tlpsrc.printf "docpattern d texmf-dist/%s\n", filename end - files_doc.sort.each do |f| - $file_tlpsrc.puts "docpattern d texmf-dist/#{f}" - end - files_src.sort.each do |f| - $file_tlpsrc.puts "srcpattern d texmf-dist/#{f}" + # sources + package.list_support_files('source').sort.each do |filename| + file_tlpsrc.printf "srcpattern d texmf-dist/%s\n", filename end - files_run.sort.uniq.each do |f| - $file_tlpsrc.puts "runpattern f texmf-dist/#{f}" + + package.list_run_files.sort.uniq.each do |filename| + file_tlpsrc.printf "runpattern f texmf-dist/%s\n", filename end - $file_tlpsrc.close + 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_dat_filename = File.join PATH::LANGUAGE_DAT, 'language.dat' +File.open(language_dat_filename, 'w') do |file_language_dat| + printf "Generating %s\n", language_dat_filename + Package.all.sort.each do |package| + package.languages.each do |language| + # main language name + file_language_dat.printf "%s\t%s\n", language.name.safe, language.loadhyph + + # synonyms language.synonyms.each do |synonym| - $file_language_dat.puts "=#{synonym}" + file_language_dat.printf "=%s\n", synonym end end end end -$file_language_dat.close diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb index 56ed48af393..20607a45109 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-webpage.rb @@ -2,10 +2,12 @@ require_relative 'languages.rb' +include TeXLive +include Language::TeXLive + # this file auto-generates loaders for hyphenation patterns - to be improved $package_name="hyph-utf8" -$ctan_url = "http://mirror.ctan.org/language/hyph-utf8/tex/generic/hyph-utf8" # TODO - make this a bit less hard-coded $path_tex_generic="../../../tex/generic" @@ -20,13 +22,13 @@ language_default = Language.new({ "licence" => "", }) -$l = Languages.new + # add english to the list -$l["default"] = language_default +# $l["default"] = language_default # TODO: should be singleton -languages = $l.list.sort{|a,b| a.name <=> b.name} +languages = Language.all.sort{|a,b| a.name <=> b.name} -$a = Authors.new +$a = Author language_grouping = { 'english' => ['default', 'en-gb', 'en-us'], @@ -42,44 +44,18 @@ language_grouping = { 'serbian' => ['sh-latn', 'sh-cyrl'], } -language_used_in_group = Hash.new -language_grouping.each_value do |group| - group.each do |code| - language_used_in_group[code] = true - end -end - space_leading = " " space_tr = " " -# 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| +Package.all.sort.each do |package| first_line_printed = false - language_list.each do |language| + package.languages.each do |language| if language != nil then puts "#{space_leading}<tr>" line_content = "" if not first_line_printed then - line_content = "<b>#{language_name.capitalize}</b>" + line_content = "<b>#{package.name.capitalize}</b>" first_line_printed = true; else line_content = " " @@ -95,12 +71,12 @@ language_groups.sort.each do |language_name,language_list| puts "#{space_leading}#{space_tr}<td>#{language.name}#{synonyms}</td>" # if language.use_old_patterns == false then - if language.use_new_loader == true then - url_patterns = "#{$ctan_url}/patterns/tex/hyph-#{language.code}.tex" - code = "<a href=\"#{url_patterns}\">#{language.code}</a>" - else + if language.use_old_loader then url_patterns = "" code = language.code + else + url_patterns = "#{$ctan_url}/patterns/tex/hyph-#{language.code}.tex" + code = "<a href=\"#{url_patterns}\">#{language.code}</a>" end puts "#{space_leading}#{space_tr}<td>#{code}</td>" @@ -118,10 +94,10 @@ language_groups.sort.each do |language_name,language_list| end puts "#{space_leading}#{space_tr}<td>(#{lmin},#{rmin})</td>" # which file to use - if language.use_new_loader then - file = "loadhyph-#{language.code}.tex" - else + if language.use_old_loader then file = "#{language.filename_old_patterns}" + else + file = "loadhyph-#{language.code}.tex" end #puts "\t<td>#{file}</td>" if language.encoding == nil then diff --git a/Master/texmf-dist/source/generic/hyph-utf8/language-data.rb b/Master/texmf-dist/source/generic/hyph-utf8/language-data.rb new file mode 100644 index 00000000000..368eb8b37c7 --- /dev/null +++ b/Master/texmf-dist/source/generic/hyph-utf8/language-data.rb @@ -0,0 +1,1734 @@ +class Language +# "use_new_loader" +# => true - create a new file and use that one +# => false - use "filename_old_patterns" in language.dat +# "filename_old_patterns" +# => [string] - the name used in language.dat if "use_new_loader" is false +# "eightbitfilename" +# => [string] - if set, load another file for 8-bit engines +# "code" +# => [string] - used in filenames, needs to conform to the standard +# "name" +# => [string] - +# "synonyms" => [], +# "hyphenmin" => [], +# "encoding" => nil, +# "exceptions" => false, +# "message" => nil, + + @@language_data = [ +# -------------------------------------- +# languages with no hyphenation patterns +# -------------------------------------- +# arabic +{ + "code" => "ar", + "name" => "arabic", + "use_old_loader" => true, + "filename_old_patterns" => "zerohyph.tex", +# "hyphenmin" => [], # not needed + "encoding" => nil, + "exceptions" => false, + "message" => nil, + + # TODO + "description_l" => [ + #......................................................................# + "Prevent hyphenation in Arabic.", + ], +}, +# farsi +# =persian +{ + "code" => "fa", + "name" => "farsi", "synonyms" => ["persian"], + "use_old_loader" => true, + "filename_old_patterns" => "zerohyph.tex", +# "hyphenmin" => [], # not needed + "encoding" => nil, + "exceptions" => false, + "message" => nil, + + # TODO + "description_l" => [ + #......................................................................# + "Prevent hyphenation in Persian.", + ], +}, +# ---------------------------- +# languages using old patterns +# ---------------------------- +# greek +# =polygreek +# monogreek +{ + "code" => "el-monoton", + "name" => "monogreek", + "use_old_patterns" => true, + "use_old_patterns_comment" => "Old patterns work in a different way, one-to-one conversion from UTF-8 is not possible.", + "filename_old_patterns" => "grmhyph5.tex", + "hyphenmin" => [1,1], # polyglossia + "encoding" => nil, + "exceptions" => true, + "message" => "Hyphenation patterns for uni-accent (monotonic) Modern Greek", + + "version" => "5.0", + "last_modified" => "2008-06-06", + "type" => "rules", + "authors" => ["dimitrios_filippou"], + "licence" => "LPPL", + # "description_s" => "Monotonic Modern Greek hyphenation patterns", + # "description_l" => [ + # #......................................................................# + # "Hyphenation patterns for Modern Greek in monotonic spelling.", + # "The pattern file used for 8-bit engines is grmhyph5.tex, in Babel's LGR encoding,", + # "that is not part of hyph-utf8.", + # "Patterns in UTF-8 use two code positions for each of the vowels with acute accent", + # "(a.k.a tonos, oxia), e.g., U+03AD, U+1F73 for epsilon.", + # ], + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Modern Greek in monotonic and polytonic", + "spelling in LGR and UTF-8 encodings. Patterns in UTF-8 use two code", + "positions for each of the vowels with acute accent (a.k.a tonos,", + "oxia), e.g., U+03AC, U+1F71 for alpha.", + ], +}, +{ + "code" => "el-polyton", + "name" => "greek", "synonyms" => ["polygreek"], + "use_old_patterns" => true, + "use_old_patterns_comment" => "Old patterns work in a different way, one-to-one conversion from UTF-8 is not possible.", + "filename_old_patterns" => "grphyph5.tex", + # left/right hyphen min for Greek can be as low as one (1), + # but for aesthetic reasons keep them at 2/2. + # Dimitrios Filippou + "hyphenmin" => [1,1], # polyglossia + "encoding" => nil, + "exceptions" => true, + "message" => "Hyphenation patterns for multi-accent (polytonic) Modern Greek", + + "version" => "5.0", + "last_modified" => "2008-06-06", + "type" => "rules", + "authors" => ["dimitrios_filippou"], + "licence" => "LPPL", + # "description_s" => "Polytonic Modern Greek hyphenation patterns", + # # #.....................................................................# + # "description_l" => [ + # #......................................................................# + # "Hyphenation patterns for Modern Greek in polytonic spelling.", + # "The pattern file used for 8-bit engines is grphyph5.tex that is", + # "not part of hyph-utf8. Patterns in UTF-8 use two code positions for", + # "each of the vowels with acute accent (a.k.a tonos, oxia), e.g.,", + # "U+03AC, U+1F71 for alpha.", + # ], +}, +# ancientgreek +{ + "code" => "grc", + "name" => "ancientgreek", + "use_old_patterns" => true, + "use_old_patterns_comment" => "Old patterns work in a different way, one-to-one conversion from UTF-8 is not possible.", + "filename_old_patterns" => "grahyph5.tex", + "hyphenmin" => [1,1], # polyglossia + "encoding" => nil, + "exceptions" => false, + "message" => "Hyphenation patterns for Ancient Greek", + + "version" => "5.0", + "last_modified" => "2016-05-12", + "type" => "rules", + "authors" => ["dimitrios_filippou"], + "licence" => "LPPL", + # "description_s" => "Ancient Greek hyphenation patterns", + # "description_l" => [ + # #......................................................................# + # "Hyphenation patterns for Ancient Greek.", + # "The pattern file used for 8-bit engines is grahyph5.tex, in Babel's LGR encoding,", + # "that is not part of hyph-utf8.", + # "Patterns in UTF-8 use two code positions for each of the vowels with acute accent", + # "(a.k.a tonos, oxia), e.g., U+03AE, U+1F75 for eta.", + # ], + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Ancient Greek in LGR and UTF-8 encodings,", + "including support for (obsolete) Ibycus font encoding.", + "Patterns in UTF-8 use two code positions for each of the vowels with", + "acute accent (a.k.a tonos, oxia), e.g., U+03AE, U+1F75 for eta.", + ], +}, +# ------------------------------- +# special patterns, not converted +# ------------------------------- +# ibycus ibyhyph.tex +{ + "code" => "grc-x-ibycus", + "name" => "ibycus", + "use_old_patterns" => true, + "use_old_loader" => true, + "filename_old_patterns" => "ibyhyph.tex", + "hyphenmin" => [2,2], + "encoding" => nil, + "exceptions" => false, + "message" => "Ancient Greek hyphenation patterns for Ibycus encoding", + + # "authors" => ["peter_heslin"], + "version" => 3.0, +}, +# ---------------------------------------------------------- +# more languages using old patterns (see el-* and grc above) +# ---------------------------------------------------------- +# coptic +{ + "code" => "cop", + "name" => "coptic", + "use_old_patterns" => true, + "use_old_patterns_comment" => "TODO: automatic conversion could be done, but was too complicated; leave for later.", + "filename_old_patterns" => "copthyph.tex", + "hyphenmin" => [1,1], # polyglossia TODO: no documentation found + "encoding" => nil, + "exceptions" => false, + "message" => "Coptic hyphenation patterns", + + "version" => nil, + "last_modified" => "2004-10-03", + "type" => "rules", + "authors" => [ "claudio_beccari" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Coptic in UTF-8 encoding", + "as well as in ASCII-based encoding for 8-bit engines.", + "The latter can only be used with special Coptic fonts (like CBcoptic).", + "The patterns are considered experimental.", + ], +}, +# german +{ + "code" => "de-1901", + "name" => "german", + "use_old_patterns" => true, + "use_old_patterns_comment" => "Kept for the sake of backward compatibility, but newer and better patterns by WL are available.", + "filename_old_patterns" => "dehypht.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "German hyphenation patterns (traditional orthography)", + + "version" => "0.40", + "last_modified" => "2014-05-21", # For the active project + "type" => "dictionary", + "authors" => ["werner_lemberg"], + "licence" => "LPPL", + # "description_s" => "German hyphenation patterns in traditional spelling", + # "description_l" => [ + # "Hyphenation patterns for German in traditional spelling, in T1/EC and UTF-8 encoding.", + # "Patterns encoded in UTF-8 are provided by a separate package.", + # ], + + "description_l" => [ + #......................................................................# + "Hyphenation patterns for German in T1/EC and UTF-8 encodings,", + "for traditional and reformed spelling, including Swiss German.", + "The package includes the latest patterns from dehyph-exptl", + "(known to TeX under names 'german', 'ngerman' and 'swissgerman'),", + "however 8-bit engines still load old versions of patterns", + "for 'german' and 'ngerman' for backward-compatibility reasons.", + "Swiss German patterns are suitable for Swiss Standard German", + "(Hochdeutsch) not the Alemannic dialects spoken in Switzerland", + "(Schwyzerduetsch).", + "There are no known patterns for written Schwyzerduetsch.", + ] +}, +# ngerman +{ + "code" => "de-1996", + "name" => "ngerman", + "use_old_patterns" => true, + "use_old_patterns_comment" => "Kept for the sake of backward compatibility, but newer and better patterns by WL are available.", + "filename_old_patterns" => "dehyphn.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "German hyphenation patterns (reformed orthography)", + + "version" => "0.40", + "last_modified" => "2014-05-21", # For the active project + "type" => "dictionary", + "authors" => ["werner_lemberg"], + "licence" => "LPPL", + # "description_s" => "German hyphenation patterns in reformed spelling", + # "description_l" => [ + # "Hyphenation patterns for German in reformed spelling, in T1/EC and UTF-8 encoding.", + # "Patterns encoded in UTF-8 are provided by a separate package.", + # ], +}, +# swissgerman +{ + "code" => "de-ch-1901", + "name" => "swissgerman", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Swiss-German hyphenation patterns (traditional orthography)", + + "version" => "0.40", + "last_modified" => "2014-05-21", # For the active project + "type" => "dictionary", + "authors" => ["werner_lemberg"], + "licence" => "LPPL", + # "description_l" => "German hyphenation patterns, traditional spelling in Switzerland.", + # "description_s" => [ + # "Hyphenation patterns for German in traditional spelling as used in Switzerland, in T1/EC and UTF-8.", + # "These patterns are suitable for Standard German (Hochdeutsch), not the Alemannic dialects", + # "spoken in Switzerland (Schwyzerdütsch). There are no patterns for written Schwyzerdütsch", + # "we know of.", + # ], +}, +# russian +{ + "code" => "ru", + "name" => "russian", + "use_old_patterns" => true, + "use_old_patterns_comment" => "The old system allows choosing patterns and encodings manually. That mechanism needs to be implemented first in this package, so we still fall back on old system.", + "filename_old_patterns" => "ruhyphen.tex", + "hyphenmin" => [2,2], + "encoding" => "t2a", + "exceptions" => false, + "message" => "Russian hyphenation patterns", + + "version" => nil, + "last_modified" => "2003-03-10", # Date of the patterns proper, not the support files + "type" => "dictionary", + "authors" => ["alexander_i_lebedev", "werner_lemberg", "vladimir_volovich"], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Russian in T2A and UTF-8 encodings.", + "For 8-bit engines, the 'ruhyphen' package provides a number of", + "different pattern sets, as well as different (8-bit) encodings, that", + "can be chosen at format-generation time. The UTF-8 version only", + "provides the default pattern set. A mechanism similar to the one used", + "for 8-bit patterns may be implemented in the future.", + ], +}, +# ukrainian +{ + "code" => "uk", + "name" => "ukrainian", + "use_old_patterns" => true, + "use_old_patterns_comment" => "The old system allows choosing patterns and encodings manually. That mechanism needs to be implemented first in this package, so we still fall back on old system.", + "filename_old_patterns" => "ukrhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "t2a", + "exceptions" => false, + "message" => "Ukrainian hyphenation patterns", + + "version" => nil, + "last_modified" => "2001-05-10", # Date of the patterns proper + # "type" => "rules", # TODO: it is not really clear + "authors" => ["maksym_polyakov", "werner_lemberg", "vladimir_volovich"], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Ukrainian in T2A and UTF-8 encodings.", + "For 8-bit engines, the 'ukrhyph' package provides a number of", + "different pattern sets, as well as different (8-bit) encodings, that", + "can be chosen at format-generation time. The UTF-8 version only", + "provides the default pattern set. A mechanism similar to the one used", + "for 8-bit patterns may be implemented in the future.", + ], +}, +# ---------------------------- +# languages using new patterns +# ---------------------------- +# afrikaans +{ + "code" => "af", + "name" => "afrikaans", + "filename_old_patterns" => nil, + "hyphenmin" => [1,2], # in babel: 2,2 + "encoding" => "ec", + "exceptions" => true, + "message" => "Afrikaans hyphenation patterns", + + "version" => "1.0", + "last_modified" => "2013-10-08", + "type" => "dictionary", + "authors" => [ "tilla_fick", "chris_swanepoel" ], + "email" => [ "hyphen{at}rekenaar{dot}net" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Afrikaans in T1/EC and UTF-8 encodings.", + "OpenOffice includes older patterns created by a different author,", + "but the patterns packaged with TeX are considered superior in quality.", + # "Word list used to generate patterns with opatgen might be released in future.", + ], +}, +# catalan +{ + "code" => "ca", + "name" => "catalan", + "filename_old_patterns" => "cahyph.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => true, + "message" => "Catalan hyphenation patterns", + + "version" => "1.11", + "last_modified" => "2003-07-15", + "type" => "rules", # not only rules, also patgen, but it is a good approximation + "authors" => [ "goncal_badenes" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Catalan in T1/EC and UTF-8 encodings.", + ], +}, +# czech +{ + "code" => "cs", + "name" => "czech", + "filename_old_patterns" => "czhyph.tex", + "filename_old_patterns_other" => ["czhyphen.tex","czhyphen.ex"], + # Both Czech and Slovak: \lefthyphenmin=2, \righthyphenmin=3 + # Typographical rules allow \righthyphenmin=2 when typesetting in a + # narrow column (newspapers etc.). + # (used to be 2,2) + "hyphenmin" => [2,3], + "encoding" => "ec", + "exceptions" => true, + "message" => "Czech hyphenation patterns", + + "version" => "3", + # guessing based on CTAN/macros/cstex/base/csplain.tar.gz: + # 1998-12-17 (patterns) + # 1995-08-23 (exceptions) + # but patterns claim 1995 + "last_modified" => "1995", # todo: no date + "type" => "dictionary", + "authors" => [ "pavel_sevecek" ], + "licence" => "GPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Czech in T1/EC and UTF-8 encodings.", + "Original patterns 'czhyphen' are still distributed in the 'csplain'", + "package and loaded with ISO Latin 2 encoding (IL2).", + # however hyph-utf8 could also be used for that + ], +}, +# slovak +{ + "code" => "sk", + "name" => "slovak", + "filename_old_patterns" => "skhyph.tex", + "filename_old_patterns_other" => ["skhyphen.tex","skhyphen.ex"], + # see czech + "hyphenmin" => [2,3], + "encoding" => "ec", + "exceptions" => true, + "message" => "Slovak hyphenation patterns", + + "version" => "2", + "last_modified" => "1992-04-24", + "type" => "dictionary", + "authors" => [ "jana_chlebikova" ], + "licence" => "GPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Slovak in T1/EC and UTF-8 encodings.", + "Original patterns 'skhyphen' are still distributed in the 'csplain'", + "package and loaded with ISO Latin 2 encoding (IL2).", + # however hyph-utf8 could also be used for that + ], +}, +# welsh +{ + "code" => "cy", + "name" => "welsh", + "filename_old_patterns" => "cyhyph.tex", + "hyphenmin" => [2,3], + "encoding" => "ec", + "exceptions" => false, + "message" => "Welsh hyphenation patterns", + + "version" => nil, + "last_modified" => "1996", + "type" => "dictionary", + "authors" => [ "yannis_haralambous" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Welsh in T1/EC and UTF-8 encodings.", + ], +}, +# danish +{ + "code" => "da", + "name" => "danish", + "filename_old_patterns" => "dkhyph.tex", + "filename_old_patterns_other" => ["dkcommon.tex", "dkspecial.tex"], + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Danish hyphenation patterns", + + "version" => nil, + "last_modified" => "2011-01-11", + "type" => "dictionary", + "authors" => [ "frank_jensen" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Danish in T1/EC and UTF-8 encodings.", + ], +}, +# esperanto +{ + "code" => "eo", + "name" => "esperanto", + "filename_old_patterns" => "eohyph.tex", + "hyphenmin" => [2,2], + "encoding" => "il3", # TODO + "exceptions" => false, + "message" => "Esperanto hyphenation patterns", + + "version" => nil, + "last_modified" => "1999-08-10", + "type" => "rules", + "authors" => [ "sergei_pokrovsky" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Esperanto ISO Latin 3 and UTF-8 encodings.", + "Note that TeX distributions don't ship any suitable fonts in Latin 3", + "encoding, so unless you create your own font support or want to use", + "MlTeX, using native Unicode engines is highly recommended.", + # "Hyphenation patterns for Esperanto ISO Latin 3 and UTF-8 encodings.", + # "Note that TeX distributions usually don't ship any suitable fonts in", + # "Latin 3 encoding, so unless you create your own font support or want", + # "to use MlTeX, using native UTF-8 engines is highly recommended.", + ], +}, +# spanish +# =espanol +{ + "code" => "es", + "name" => "spanish", "synonyms" => ["espanol"], + "filename_old_patterns" => "eshyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Spanish hyphenation patterns", + + "version" => "4.7", + "last_modified" => "2015-11-12", + "type" => "dictionary", + "authors" => [ "javier_bezos" ], + "licence" => "MIT/X11", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Spanish in T1/EC and UTF-8 encodings.", + ], +}, +# basque +{ + "code" => "eu", + "name" => "basque", + "filename_old_patterns" => "bahyph.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Basque hyphenation patterns", + + "version" => nil, + "last_modified" => "2008-06-26", + "type" => "rules", + "authors" => [ "juan_aguirregabiria" ], + "licence" => "other-free", # "public-check", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Basque in T1/EC and UTF-8 encodings.", + # "Generating scripts for these rule-based patterns is included in hyph-utf8." + ], +}, +# french +# =patois +# =francais +{ + "code" => "fr", + "name" => "french", "synonyms" => ["patois","francais"], + "filename_old_patterns" => "frhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "French hyphenation patterns", + + "version" => "2.13", + "last_modified" => "2016-05-12", + "type" => "rules", + "authors" => ["daniel_flipo", "bernard_gaulle", "arthur_reutenauer"], + "email" => ["cesure-l{at}gutenberg{dot}eu{dot}org"], + "licence" => "MIT", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for French in T1/EC and UTF-8 encodings.", + ] +}, +# galician +{ + "code" => "gl", + "name" => "galician", + "filename_old_patterns" => "glhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Galician hyphenation patterns", + + "version" => "2.4", + "last_modified" => "2010-04-23", + "type" => "rules", + "authors" => ["javier_mugica"], + "licence" => "LPPL", # Status maintained + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Galician in T1/EC and UTF-8 encodings.", + # "Generated automatically from the mkpattern utility.", + ] +}, +# estonian +{ + "code" => "et", + "name" => "estonian", + "filename_old_patterns" => "ethyph.tex", + "hyphenmin" => [2,3], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Estonian hyphenation patterns", + + "version" => nil, + "last_modified" => "2004-04-13", + "type" => "dictionary", + "authors" => [ "een_saar" ], + "licence" => "LPPL|MIT", # Dual MIT-LPPL + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Estonian in T1/EC and UTF-8 encodings.", + ], +}, +# finnish +{ + "code" => "fi", + "name" => "finnish", + "filename_old_patterns" => "fihyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Finnish hyphenation patterns", + + "version" => "2.2", + "last_modified" => "1989-03-08", + "type" => "rules", + "authors" => ["kauko_saarinen", "fred_karlsson"], + "licence" => "other-free", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Finnish in T1/EC and UTF-8 encodings.", + ], +}, +# croatian +{ + "code" => "hr", + "name" => "croatian", + "filename_old_patterns" => "hrhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Croatian hyphenation patterns", + + "version" => nil, + "last_modified" => "1996-03-19", + "type" => "dictionary", + "authors" => [ "igor_marinovic" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Croatian in T1/EC and UTF-8 encodings.", + ], +}, +# hungarian +{ + "code" => "hu", + "name" => "hungarian", + "filename_old_patterns" => "huhyphn.tex", + "hyphenmin" => [2,2], # polyglossia + "encoding" => "ec", + "exceptions" => false, + "message" => "Hungarian hyphenation patterns", + + "source" => "https://github.com/nagybence/huhyphn/", # FIXME Check and remove from desc below + "version" => "v20110815", + "last_modified" => "2011-08-15", # actually, it is "2009-06-12" or older for contents; we probably want to check/fix this + "type" => "dictionary", + "authors" => ["bence_nagy"], + "licence" => "MPL 1.1/GPL 2.0/LGPL 2.1", # TODO + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Hungarian in T1/EC and UTF-8 encodings.", + # TODO: same comment as for Irish: I'm slightly reluctant to put URL addresses here. + "From https://github.com/nagybence/huhyphn/." + ], +}, +# armenian +# Sahak Petrosyan <sahak at mit dot edu> +{ + "code" => "hy", + "name" => "armenian", + "filename_old_patterns" => nil, + "hyphenmin" => [1,2], # taken from Hyphenator.js; check the value + "encoding" => nil, + "exceptions" => false, + "message" => "Armenian hyphenation patterns", + + "version" => nil, + "last_modified" => "2010-05", + "type" => "rules", + "authors" => ["sahak_petrosyan"], + "licence" => "LGPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Armenian for Unicode engines.", + # "Auto-generated from a script included in hyph-utf8.", + ], +}, +# interlingua +{ + "code" => "ia", + "name" => "interlingua", + "filename_old_patterns" => "iahyphen.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ascii", + "exceptions" => true, + "message" => "Hyphenation patterns for Interlingua", + + "version" => "0.2c", + "last_modified" => "2005-06-28", + "type" => "dictionary", + "authors" => ["peter_kleiweg"], + "licence" => "LPPL", # TODO Status maintained + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Interlingua in ASCII encoding.", + ], +}, +# indonesian +{ + "code" => "id", + "name" => "indonesian", + "filename_old_patterns" => "inhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ascii", + "exceptions" => true, + "message" => "Indonesian hyphenation patterns", + + "version" => "1.3", + "last_modified" => "1997-09-19", + "type" => "rules", + "authors" => ["joerg_knappen", "terry_mart"], + "licence" => "GPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Indonesian (Bahasa Indonesia) in ASCII", + "encoding. They are probably also usable for Malay (Bahasa Melayu).", + ], +}, +# icelandic +{ + "code" => "is", + "name" => "icelandic", + "filename_old_patterns" => "icehyph.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Icelandic hyphenation patterns", + + "version" => nil, + "last_modified" => "2004-03-02", + "type" => "dictionary", + # TODO: I'm not sure that the last two names are relevant, I don't find the source of Marteinn Sverrisson + "authors" => ["jorgen_pind", "marteinn_sverrisson", "kristinn_gylfason"], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Icelandic in T1/EC and UTF-8 encodings.", + ], +}, +# irish +{ + "code" => "ga", + "name" => "irish", + "filename_old_patterns" => "gahyph.tex", + "hyphenmin" => [2,3], # babel + "encoding" => "ec", + "exceptions" => true, + "message" => "Irish hyphenation patterns", + + "version" => "1.0", + "last_modified" => "2004-01-22", + "type" => "dictionary", + "authors" => ["kevin_p_scannell"], + "licence" => "GPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Irish (Gaeilge) in T1/EC and UTF-8 encodings.", + "Visit http://borel.slu.edu/fleiscin/index.html for more information.", + # TODO: I'm slightly reluctant to put URL here + ], +}, +# italian +{ + "code" => "it", + "name" => "italian", + "filename_old_patterns" => "ithyph.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ascii", + "exceptions" => false, + "message" => "Italian hyphenation patterns", + + "version" => "4.9", + "last_modified" => "2014-04-22", + "type" => "rules", # TODO: we might want to check that, but it seems unlikely that patgen was used + "authors" => ["claudio_beccari"], + "licence" => "LPPL", # Status: maintained! + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Italian in ASCII encoding.", + # supposed to be ... + "Compliant with the Recommendation UNI 6461 on hyphenation", + "issued by the Italian Standards Institution", + "(Ente Nazionale di Unificazione UNI).", + # "Implements Recommendation UNI 6461 issued by the Italian Standards Institution", + # "(Ente Nazionale di Unificazione UNI).", + ], +}, +# romansh +{ + "code" => "rm", + "name" => "romansh", + "filename_old_patterns" => nil, + "hyphenmin" => [2,2], # todo + "encoding" => "ascii", + "exceptions" => false, + "message" => "Romansh hyphenation patterns", + + "version" => "1.1", + "last_modified" => "2012-04-10", + "type" => "rules", + "authors" => ["claudio_beccari"], + "licence" => "LPPL", # Status: maintained! + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Romansh in ASCII encoding.", + "They are supposed to comply with the rules indicated by the Lia", + "Rumantscha (Romansh language society).", + ], +}, +# friulan +{ + "code" => "fur", + "name" => "friulan", "synonyms" => [], + "filename_old_patterns" => nil, + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Friulan hyphenation patterns", + + "version" => "1.1", + "last_modified" => "2012-04-10", + "type" => "rules", + "authors" => ["claudio_beccari"], + "licence" => "LPPL", # Status: maintained! + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Friulan in ASCII encoding.", + "They are supposed to comply with the common spelling of the", + "Friulan (Furlan) language as fixed by the Regional Law N.15/96", + "dated November 6, 1996 and its following amendments.", + ], +}, +# piedmontese +{ + "code" => "pms", + "name" => "piedmontese", + "filename_old_patterns" => nil, + "hyphenmin" => [2,2], + "encoding" => "ascii", + "exceptions" => false, + "message" => "Piedmontese hyphenation patterns", + + "version" => "1.0", + "last_modified" => "2013-02-14", + "type" => "rules", + "authors" => ["claudio_beccari"], + "licence" => "LPPL", # Status: maintained! + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Piedmontese in ASCII encoding.", + "Compliant with 'Gramatica dla lengua piemonteisa' by Camillo Brero.", + ], +}, +# kurmanji +{ + "code" => "kmr", + "name" => "kurmanji", + "filename_old_patterns" => "kmrhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Kurmanji hyphenation patterns", + + "version" => "1.0", + "last_modified" => "2009-06-29", + "type" => "dictionary", + "authors" => ["joerg_knappen", "medeni_shemde"], + "licence" => "LPPL", # Status: maintained! + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Kurmanji (Northern Kurdish) as spoken in", + "Turkey and by the Kurdish diaspora in Europe, in T1/EC and UTF-8", + "encodings." + ], +}, +# latin +{ + "code" => "la", + "name" => "latin", + "filename_old_patterns" => "lahyph.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Latin hyphenation patterns", + + "version" => "3.2a", + "last_modified" => "2014-06-04", # patterns (behaviour) last modified on 2010-06-01 + "type" => "rules", + "authors" => [ "claudio_beccari" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Latin in T1/EC and UTF-8 encodings,", + "mainly in modern spelling (u when u is needed and v when v is needed),", + "medieval spelling with the ligatures \\ae and \\oe and the (uncial)", + "lowercase 'v' written as a 'u' is also supported. Apparently", + "there is no conflict between the patterns of modern Latin and", + "those of medieval Latin.", + ], +}, +# classiclatin +{ + "code" => "la-x-classic", + "name" => "classiclatin", + "filename_old_patterns" => nil, + "hyphenmin" => [2,2], + "encoding" => "ascii", + "exceptions" => false, + "message" => "Classical Latin hyphenation patterns", + + "version" => "1.2", + "last_modified" => "2014-10-06", + "type" => "rules", + "authors" => [ "claudio_beccari" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for the Classical Latin in T1/EC and UTF-8", + "encodings. Classical Latin hyphenation patterns are different from", + "those of 'plain' Latin, the latter being more adapted to modern Latin.", + ], +}, +# liturgicallatin +{ + "code" => "la-x-liturgic", + "name" => "liturgicallatin", + "filename_old_patterns" => nil, + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Liturgical Latin hyphenation patterns", + + "version" => "1.040", + "last_modified" => "2016-05-19", + "type" => "rules", + "authors" => [ "claudio_beccari" ], + "licence" => "MIT", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for the Liturgical Latin in T1/EC and UTF-8", + "encodings.", + ], +}, +# lithuanian +{ + "code" => "lt", + "name" => "lithuanian", + "hyphenmin" => [2,2], + "encoding" => "l7x", + "exceptions" => false, + "message" => "Lithuanian hyphenation patterns", + + "version" => nil, + "last_modified" => "2002-11-20", # 1992-03-04, for the content? + "authors" => ["vytas_statulevicius", "yannis_haralambous", "sigitas_tolusis"], + # "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Lithuanian in L7X and UTF-8 encodings.", + # "Designed for \\lefthyphenmin and \\righthyphenmin set to 2.", + "\\lefthyphenmin and \\righthyphenmin have to be at least 2.", + # "Changing them to 1 according to grammatical rules from 1997", + # "would require to review and maybe rebuild the patterns." + ], +}, +# latvian +{ + "code" => "lv", + "name" => "latvian", + "hyphenmin" => [2,2], + "encoding" => "l7x", + "exceptions" => false, + "message" => "Latvian hyphenation patterns", + + "version" => "0.3", + "last_modified" => "2005-09-14", + "type" => "dictionary", + "authors" => ["janis_vilims"], + "licence" => "LGPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Latvian in L7X and UTF-8 encodings.", + ], +}, +# dutch +{ + "code" => "nl", + "name" => "dutch", + "filename_old_patterns" => "nehyph96.tex", + # quoting Hans Hagen: + # patterns generated with 2,2 (so don't go less) but use prefered values 2,3 (educational publishers want 4,5 -) + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => true, + "message" => "Dutch hyphenation patterns", + + "version" => "1.1", + "last_modified" => "1996-11", + "type" => "dictionary", + "authors" => ["piet_tutelaers"], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Dutch in T1/EC and UTF-8 encodings.", + # "\\lefthyphenmin and \\righthyphenmin must both be > 1.", + "These patterns don't handle cases like 'menuutje' > 'menu-tje',", + "and don't hyphenate words that have different hyphenations according", + "to their meaning." + ], +}, +# occitan +{ + "code" => "oc", + "name" => "occitan", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Occitan hyphenation patterns", + + "version" => "0.1", + "last_modified" => "2016-02-04", + "type" => "rules", + "authors" => [ "claudio_beccari" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Occitan in T1/EC and UTF-8 encodings.", + "They are supposed to be valid for all the Occitan variants", + "spoken and written in the wide area called 'Occitanie' by the French.", + "It ranges from the Val d'Aran within Catalunya, to the South Western", + "Italian Alps encompassing the southern half of the French pentagon.", + ], +}, +# polish +{ + "code" => "pl", + "name" => "polish", + "filename_old_patterns" => "plhyph.tex", + #{}"hyphenmin" => [1,1], + "hyphenmin" => [2,2], + "encoding" => "qx", + "exceptions" => true, + "message" => "Polish hyphenation patterns", + + "version" => "3.0a", + "last_modified" => "1995-06-17", + "type" => "dictionary", + "authors" => ["hanna_kolodziejska", "boguslaw_jackowski", "marek_rycko"], + "licence" => "public", # TODO Knuthian type + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Polish in QX and UTF-8 encodings.", + "These patterns are also used by Polish TeX formats MeX and LaMeX.", + ], +}, +# portuguese +# =portuges +{ + "code" => "pt", + "name" => "portuguese", "synonyms" => ["portuges"], + "filename_old_patterns" => "pthyph.tex", + "hyphenmin" => [2,3], # babel + "encoding" => "ec", + "exceptions" => true, + "message" => "Portuguese hyphenation patterns", + + "version" => "1.0", + "last_modified" => "1996-07-21", + "type" => "rules", # TODO: we could create a generating script + "authors" => ["pedro_j_de_rezende", "j_joao_dias_almeida"], + "licence" => "BSD-3", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Portuguese in T1/EC and UTF-8 encodings.", + ], +}, +# pinyin +{ + "code" => "zh-latn-pinyin", + "name" => "pinyin", + "filename_old_patterns" => "pyhyph.tex", + "hyphenmin" => [1,1], + "encoding" => "ec", + "exceptions" => false, + "message" => "Hyphenation patterns for unaccented pinyin syllables", + + "version" => "4.8.0", + "last_modified" => "2008-05-22", + "type" => "rules", # TODO: we could create a generating script + "authors" => ["werner_lemberg"], + "licence" => "GPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for unaccented transliterated Mandarin Chinese", + "(pinyin) in T1/EC and UTF-8 encodings.", + ], +}, +# romanian +{ + "code" => "ro", + "name" => "romanian", + "filename_old_patterns" => "rohyphen.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Romanian hyphenation patterns", # : `rohyphen' 1.1 <29.10.1996> + + "version" => "1.1R", + "last_modified" => "1996-11-07", + "type" => "dictionary", + "authors" => ["adrian_rezus"], + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Romanian in T1/EC and UTF-8 encodings.", + "The UTF-8 patterns use U+0219 for the character 's with comma accent'", + "and U+021B for 't with comma accent', but we may consider using U+015F", + "and U+0163 as well in the future.", + # "Generated by PatGen2-output hyphen-level 9.", + ], +}, +# slovenian +# =slovene +{ + "code" => "sl", + "name" => "slovenian", "synonyms" => ["slovene"], + "filename_old_patterns" => "sihyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Slovenian hyphenation patterns", + + "version" => "2.3", + "last_modified" => "1997-15-04", + "type" => "dictionary", + "authors" => [ "matjaz_vrecko" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Slovenian in T1/EC and UTF-8 encodings.", + ], +}, +# uppersorbian +{ + "code" => "hsb", + "name" => "upper sorbian", + "filename_old_patterns" => "sorhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => true, + "message" => "Upper Sorbian hyphenation patterns", +# \message{Hyphenation patterns for Upper Sorbian, E. Werner} +# \message{Completely new revision 1997, March 22} + + "version" => nil, + "last_modified" => "1997-03-22", + "authors" => ["eduard_werner"], + "type" => "dictionary", + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Upper Sorbian in T1/EC and UTF-8 encodings.", + ], +}, +# swedish +{ + "code" => "sv", + "name" => "swedish", + "filename_old_patterns" => "svhyph.tex", + "hyphenmin" => [2,2], # patters say it could be 1,2; babel says 2,2 - double check + "encoding" => "ec", + "exceptions" => false, + "message" => "Swedish hyphenation patterns", + + # "version" => "1994-03-03", # that is what author used in message + "version" => nil, + "last_modified" => "1994-03-03", + "type" => "dictionary", + "authors" => ["jan_michael_rynning"], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Swedish in T1/EC and UTF-8 encodings.", + ], +}, +# turkmen +{ + "code" => "tk", + "name" => "turkmen", + "filename_old_patterns" => nil, + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => false, + "message" => "Turkmen hyphenation patterns", + + "version" => "0.1", + "last_modified" => "2010-03-16", + "type" => "dictionary", + "authors" => [ "nazar_annagurban" ], + "licence" => "public", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Turkmen in T1/EC and UTF-8 encodings.", + ], +}, +# turkish +{ + "code" => "tr", + "name" => "turkish", + "filename_old_patterns" => "tkhyph.tex", + "hyphenmin" => [2,2], # polyglossia + "encoding" => "ec", + "exceptions" => false, + "message" => "Turkish hyphenation patterns", + + "version" => nil, + "last_modified" => "2008-06-28", + "type" => "rules", + "authors" => ["pierre_mackay", "h_turgut_uyar", "s_ekin_kocabas", "mojca_miklavec"], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Turkish in T1/EC and UTF-8 encodings.", + # "Auto-generated from a script included in the distribution.", + "The patterns for Turkish were first produced for the Ottoman Texts", + "Project in 1987 and were suitable for both Modern Turkish and Ottoman", + "Turkish in Latin script, however the required character set didn't fit", + "into EC encoding, so support for Ottoman Turkish had to be dropped to", + "keep compatibility with 8-bit engines.", + ] +}, + + + + +# ukenglish +{ + "code" => "en-gb", + "name" => "ukenglish", "synonyms" => ["british", "UKenglish"], + "filename_old_patterns" => "ukhyphen.tex", + "hyphenmin" => [2,3], # confirmed, same as what Knuth says + "encoding" => "ascii", + "exceptions" => true, + "message" => "Hyphenation patterns for British English", # FIXME Inconsistent + + "version" => "1.0a", # FIXME a much older comment says 2.0? + "last_modified" => "2005-10-18", + "type" => "dictionary", + "authors" => ["dominik_wujastyk", "graham_toal"], + "licence" => "other-free", # TODO Knuth-like + # (This will be uncommented during reimplementation) + # "description_s" => "British English hyphenation patterns", + # "description_l" => [ + # "Hyphenation patterns for British English in ASCII encoding.", + # ], + + "description_l" => [ + #......................................................................# + "Additional hyphenation patterns for American and British", + "English in ASCII encoding. The American English patterns", + "(usenglishmax) greatly extend the standard patterns from Knuth", + "to find many additional hyphenation points. British English", + "hyphenation is completely different from US English, so has its", + "own set of patterns.", + ], +}, +# (US english) +# usenglishmax +{ + "code" => "en-us", + "name" => "usenglishmax", + "filename_old_patterns" => "ushyphmax.tex", + "hyphenmin" => [2,3], # confirmed, same as what Knuth says + "encoding" => "ascii", + "exceptions" => true, + "message" => "Hyphenation patterns for American English", # FIXME Consistent + + "version" => nil, + "last_modified" => "1990-03-01", # 8-bit file also has version 2005-05-30. + "type" => "dictionary", + "authors" => ["donald_e_knuth", "gerard_d_c_kuiken"], + "licence" => "other-free", + # (This will be uncommented during reimplementation) + # "description_s" => "American English hyphenation patterns", + # "description_l" => [ + # "Hyphenation patterns for American English in ASCII encoding.", + # ], +}, +# US english +# { +# "code" => "en-us-x-knuth", +# "name" => "english", +# "use_new_loader" => false, +# "use_old_patterns" => false, +# "filename_old_patterns" => "hyphen.tex", +# "hyphenmin" => [2,3], # confirmed, same as what Knuth says +# "encoding" => "ascii", +# "exceptions" => true, +# "message" => "Hyphenation patterns for American English", +# }, +# TODO: FIXME!!! +# serbian +{ + "code" => "sh-latn", + "name" => "serbian", + "filename_old_patterns" => "shhyphl.tex", + # It is allowed to leave one character at the end of the row. + # However, if you think that it is graphicaly not very + # pleasant these patterns will work well with \lefthyphenmin=2. + # \lefthyphenmin=1 \righthyphenmin=2 + "hyphenmin" => [2,2], + "encoding" => "ec", + "exceptions" => true, + "message" => "Serbian hyphenation patterns in Latin script", + + # only for serbian + "version" => "2.02", + "last_modified" => "2008-06-22", + "type" => "dictionary", + "authors" => [ "dejan_muhamedagic" ], + "licence" => "LPPL", + # for both scripts + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Serbian in T1/EC, T2A and UTF-8 encodings.", + "For 8-bit engines the patterns are available separately as 'serbian'", + "in T1/EC encoding for Latin script and 'serbianc' in T2A encoding for", + "Cyrillic script. Unicode engines should only use 'serbian'", + "which has patterns in both scripts combined.", + ], +}, +# serbianc +{ + "code" => "sh-cyrl", + "name" => "serbianc", + # "filename_old_patterns" => "srhyphc.tex", + "hyphenmin" => [2,2], + "encoding" => "t2a", + "exceptions" => true, + "message" => "Serbian hyphenation patterns in Cyrillic script", +}, +# mongolian (used to be mongolian2a) +{ + "code" => "mn-cyrl", + "name" => "mongolian", + "filename_old_patterns" => "mnhyphn.tex", + "hyphenmin" => [2,2], + "encoding" => "t2a", + "exceptions" => false, + "message" => "(New) Mongolian hyphenation patterns", + + # only for this one + "version" => "1.2", + "last_modified" => "2010-04-03", + "type" => "dictionary", + "authors" => [ "dorjgotov_batmunkh" ], + "licence" => "LPPL", + # for both + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Mongolian in T2A, LMC and UTF-8 encodings.", + "LMC encoding is used in MonTeX. The package includes two sets of", + "patterns that will hopefully be merged in future.", + ], +}, +# mongolianlmc xu-mnhyph.tex (used to be mongolian) +{ + "code" => "mn-cyrl-x-lmc", + "name" => "mongolianlmc", + "filename_old_patterns" => "mnhyph.tex", + "hyphenmin" => [2,2], + "encoding" => "lmc", + "exceptions" => false, + "message" => "Mongolian hyphenation patterns", +}, +# bulgarian +{ + "code" => "bg", + "name" => "bulgarian", + "filename_old_patterns" => "bghyphen.tex", + "hyphenmin" => [2,2], # babel + "encoding" => "t2a", + "exceptions" => false, + "message" => "Bulgarian hyphenation patterns", + + "version" => "1.7", + "last_modified" => "2008-06", + "type" => "pattern", + "authors" => [ "georgi_boshnakov" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Bulgarian in T2A and UTF-8 encodings.", + ], +}, +# sanskrit +{ + "code" => "sa", + "name" => "sanskrit", + "hyphenmin" => [1,3], # polyglossia + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Sanskrit hyphenation patterns", + + "version" => "0.6", + "last_modified" => "2011-09-14", + "type" => "rules", + "authors" => ["yves_codet"], + "licence" => "free", # You may freely use, copy, modify and/or distribute this file. + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Sanskrit and Prakrit in transliteration,", + "and in Devanagari, Bengali, Kannada, Malayalam and Telugu scripts", + "for Unicode engines.", + ], +}, +# norwegian +{ + "code" => "no", + "name" => "norwegian", # TODO: fixme + "use_old_loader" => true, + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => false, + "message" => "Norwegian hyphenation patterns", +}, +# norsk +{ + "code" => "nb", + "name" => "bokmal", "synonyms" => ["norwegian", "norsk"], + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => true, + "message" => "Norwegian Bokmal hyphenation patterns", + + "version" => nil, + "last_modified" => "2012-05-18", + "type" => "dictionary", + "authors" => [ "rune_kleveland", "ole_michael_selberg" ], + "licence" => "free", # TODO + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Norwegian Bokmal and Nynorsk in T1/EC and", + "UTF-8 encodings.", + ], +}, +# nynorsk +{ + "code" => "nn", + "name" => "nynorsk", + "hyphenmin" => [2,2], # babel + "encoding" => "ec", + "exceptions" => true, + "message" => "Norwegian Nynorsk hyphenation patterns", +}, +##### +# assamese +{ + "code" => "as", + "name" => "assamese", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Assamese hyphenation patterns", + + # this is true for all Indic patterns + "version" => "0.9.0", + "last_modified" => "2016-01-16", + "type" => "rules", + "authors" => ["santhosh_thottingal"], + "licence" => "MIT", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Assamese, Bengali, Gujarati, Hindi, Kannada,", + "Malayalam, Marathi, Oriya, Panjabi, Tamil and Telugu for Unicode", + "engines.", + ], +}, +# bengali +{ + "code" => "bn", + "name" => "bengali", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Bengali hyphenation patterns", +}, +# gujarati +{ + "code" => "gu", + "name" => "gujarati", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Gujarati hyphenation patterns", +}, +# hindi +{ + "code" => "hi", + "name" => "hindi", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Hindi hyphenation patterns", +}, +# kannada +{ + "code" => "kn", + "name" => "kannada", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Kannada hyphenation patterns", +}, +# malayalam +{ + "code" => "ml", + "name" => "malayalam", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Malayalam hyphenation patterns", +}, +# marathi +{ + "code" => "mr", + "name" => "marathi", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Marathi hyphenation patterns", +}, +# oriya +{ + "code" => "or", + "name" => "oriya", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Oriya hyphenation patterns", +}, +# panjabi +{ + "code" => "pa", + "name" => "panjabi", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Panjabi hyphenation patterns", +}, +# tamil +{ + "code" => "ta", + "name" => "tamil", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Tamil hyphenation patterns", +}, +# telugu +{ + "code" => "te", + "name" => "telugu", + "hyphenmin" => [1,1], # TODO + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Telugu hyphenation patterns", +}, +# thai +{ + "code" => "th", + "name" => "thai", + "hyphenmin" => [2,3], + "encoding" => "lth", + "exceptions" => false, + "message" => "Thai hyphenation patterns", + + "version" => nil, + "last_modified" => "2015-05-07", + "type" => "dictionary", + "authors" => [ "theppitak_karoonboonyanan" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Thai in LTH and UTF-8 encodings.", + ], +}, +# lao +#{ +# "code" => "lo", +# "name" => "lao", +# "use_new_loader" => true, +# "use_old_patterns" => false, +# "hyphenmin" => [1,1], # TODO +# "encoding" => nil, # no patterns for 8-bit engines +# "exceptions" => false, +# "message" => "Lao hyphenation patterns", +# +# "version" => nil, +# "last_modified" => "2010-05-19", +# "type" => "rules", +# "authors" => [ "brian_wilson", "arthur_reutenauer", "mojca_miklavec" ], +# "licence" => "other-free", +# "description_s" => "Lao hyphenation patterns", +# "description_l" => [ +# #......................................................................# +# "Hyphenation patterns for Lao language for Unicode engines.", +# "Current version is experimental and gives bad results.", +# ], +#}, +# pan-Ethiopic +{ + "code" => "mul-ethi", + "name" => "ethiopic", "synonyms" => ["amharic", "geez"], + "version" => nil, + "last_modified" => "2011-01-10", + "authors" => ["arthur_reutenauer", "mojca_miklavec"], + "licence" => "public-ask", # TODO + "hyphenmin" => [1,1], + "encoding" => nil, # no patterns for 8-bit engines + "exceptions" => false, + "message" => "Pan-Ethiopic hyphenation patterns", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for languages written using the Ethiopic script", + "for Unicode engines. They are not supposed to be linguistically", + "relevant in all cases and should, for proper typography, be replaced", + "by files tailored to individual languages.", + ], +}, +# georgian +{ + "code" => "ka", + "name" => "georgian", + "hyphenmin" => [1,2], + "encoding" => "t8m", + "exceptions" => false, + "message" => "Georgian hyphenation patterns", + + "version" => "0.3", + "last_modified" => "2013-04-15", + "type" => "dictionary", + "authors" => [ "levan_shoshiashvili" ], + "licence" => "LPPL", + "description_l" => [ + #......................................................................# + "Hyphenation patterns for Georgian in T8M, T8K and UTF-8 encodings.", + ], +}, +# Church Slavonic +{ + "code" => "cu", + "name" => "church slavonic", + "hyphenmin" => [1, 2], + "encoding" => nil, + "exceptions" => true, + "message" => "Church Slavonic hyphenation patterns", + + "version" => nil, + "last_modified" => "2016-04-16", + "type" => "machine learning", + "authors" => ["mike_kroutikov", "aleksandr_andreev"], + "licence" => "MIT", + "description_l" => [ + "Hyphenation patterns for Church Slavonic in UTF-8 encoding", + ], +}, +# Belarusian +{ + "code" => "be", + "name" => "belarusian", + "hyphenmin" => [2,2], + "encoding" => "t2a", + "message" => "Belarusian hyphenation patterns", + + "version" => nil, + "last_modified" => "2016-09-29", + "type" => "rules", + "authors" => ["maksim_salau"], + "licence" => "MIT", + "description_l" => [ + "Belarusian hyphenation patterns in T2A and UTF-8 encodings" + ], +}, +# Pali +{ + "code" => "pi", + "name" => "pali", + "hyphenmin" => [1, 2], + # no encoding + "message" => "Pali hyphenation patterns", + # no version number + "last_modified" => "2018-06-29", + "type" => "rules", + "authors" => ["wie_ming_ang"], + "licence" => "MIT", + "description_l" => [ + "Pali hyphenation patterns in UTF-8 encoding", + ], +}, +# dumylang -> dumyhyph.tex +# nohyphenation -> zerohyph.tex +# arabic -> zerohyph.tex +# farsi zerohyph.tex +# =persian + ] +end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/languages.rb b/Master/texmf-dist/source/generic/hyph-utf8/languages.rb index e59b1f8b398..46ae947460f 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/languages.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/languages.rb @@ -1,4 +1,42 @@ # -*- coding: utf-8 -*- +require_relative 'author-data' +require_relative 'language-data' + +module PATH + ROOT = File.expand_path('../../../../..', __FILE__) + + TeXROOT = File.join(ROOT, 'hyph-utf8') + TeX_GENERIC = File.join(TeXROOT, 'tex', 'generic') + TXT = File.join(TeX_GENERIC, 'hyph-utf8', 'patterns', 'txt') + TEX = File.join(TeX_GENERIC, 'hyph-utf8', 'patterns', 'tex') + PTEX = File.join(TeX_GENERIC, 'hyph-utf8', 'patterns', 'ptex') + QUOTE = File.join(TeX_GENERIC, 'hyph-utf8', 'patterns', 'quote') + + HYPHU8 = File.join('tex', 'generic', 'hyph-utf8') + + TL = File.join(ROOT, 'TL') + LANGUAGE_DAT = File.join(PATH::TL, 'texmf-dist', 'tex', 'generic', 'config') + # hyphen-foo.tlpsrc for TeX Live + TLPSRC = File.join(PATH::TL, 'tlpkg', 'tlpsrc') +end + +class String + def superstrip + strip.gsub /%.*$/, '' + end + + def supersplit + strip.gsub(/\s+/m,"\n").split("\n") + end + + def safe + gsub /[\s-]/, '' + end + + def titlecase + split.map(&:capitalize).join(' ') + end +end class Author def initialize(name,surname,email,contacted1,contacted2) @@ -13,13 +51,28 @@ class Author end attr_reader :name, :surname, :email + + def self.authors + @@authors ||= @@author_data.map do |id, details| + author = Author.new(details[0], details[1], details[2], details[3], details[4]) + [id, author] + end.to_h + end + + def self.all + authors.values + end + + def self.[] a + authors[a] + end end class Language def initialize(language_hash) - @use_new_loader = language_hash["use_new_loader"] @use_old_patterns = language_hash["use_old_patterns"] @use_old_patterns_comment = language_hash["use_old_patterns_comment"] + @use_old_loader = language_hash["use_old_loader"] @filename_old_patterns = language_hash["filename_old_patterns"] @filename_old_patterns_other = language_hash["filename_old_patterns_other"] @code = language_hash["code"] @@ -27,87 +80,61 @@ class Language @synonyms = language_hash["synonyms"] @hyphenmin = language_hash["hyphenmin"] @encoding = language_hash["encoding"] - @exceptions = language_hash["exceptions"] @message = language_hash["message"] - @description_s = language_hash["description_s"] @description_l = language_hash["description_l"] @version = language_hash["version"] @licence = language_hash["licence"] @authors = language_hash["authors"] - @has_quotes = false - @has_dashes = false + @synonyms = [] unless @synonyms + end - if @synonyms==nil then @synonyms = [] end + def <=>(other) + code <=> other.code end - def set_quotes - @has_quotes = true + def self.all + @@languages ||= @@language_data.map do |language_data| + new language_data + end end - def set_dashes - @has_dashes = true + # TODO self.find + + @@texfile = Hash.new + def readtexfile(code = @code) + @@texfile[code] ||= File.read(File.join(PATH::TEX, sprintf('hyph-%s.tex', code))) end - # TODO: simplify this (reduce duplication) - - def get_exceptions - if @exceptions1 == nil - filename = File.expand_path("../../../../tex/generic/hyph-utf8/patterns/tex/hyph-#{@code}.tex", __FILE__); - lines = IO.readlines(filename, '.').join("") - exceptions = lines.gsub(/%.*/,''); - if (exceptions.index('\hyphenation') != nil) - @exceptions1 = exceptions.gsub(/.*\\hyphenation\s*\{(.*?)\}.*/m,'\1'). - gsub(/\s+/m,"\n"). - gsub(/^\s*/m,''). - gsub(/\s*$/m,''). - split("\n") - else - @exceptions1 = "" - end + def exceptions + @exceptions ||= if readtexfile.superstrip.index('\hyphenation') + readtexfile.superstrip.gsub(/.*\\hyphenation\s*\{(.*?)\}.*/m,'\1').supersplit + else + "" end - - return @exceptions1 end - def get_patterns - if @patterns == nil - filename = File.expand_path("../../../../tex/generic/hyph-utf8/patterns/tex/hyph-#{@code}.tex", __FILE__) - lines = IO.readlines(filename, '.').join("") - @patterns = lines.gsub(/%.*/,''). + def patterns + @patterns ||= if @code == 'eo' then + readtexfile.superstrip. + gsub(/.*\\patterns\s*\{(.*)\}.*/m,'\1'). + # + gsub(/\\adj\{(.*?)\}/m,'\1a. \1aj. \1ajn. \1an. \1e.'). + gsub(/\\nom\{(.*?)\}/m,'\1a. \1aj. \1ajn. \1an. \1e. \1o. \1oj. \1ojn. \1on.'). + gsub(/\\ver\{(.*?)\}/m,'\1as. \1i. \1is. \1os. \1u. \1us.'). + # + supersplit + else + readtexfile(if ['nb', 'nn'].include? @code then 'no' else @code end).superstrip. gsub(/.*\\patterns\s*\{(.*?)\}.*/m,'\1'). - gsub(/\s+/m,"\n"). - gsub(/^\s*/m,''). - gsub(/\s*$/m,''). - split("\n") - - if @code == 'eo' then - @patterns = lines.gsub(/%.*/,''). - gsub(/.*\\patterns\s*\{(.*)\}.*/m,'\1'). - # - gsub(/\\adj\{(.*?)\}/m,'\1a. \1aj. \1ajn. \1an. \1e.'). - gsub(/\\nom\{(.*?)\}/m,'\1a. \1aj. \1ajn. \1an. \1e. \1o. \1oj. \1ojn. \1on.'). - gsub(/\\ver\{(.*?)\}/m,'\1as. \1i. \1is. \1os. \1u. \1us.'). - # - gsub(/\s+/m,"\n"). - gsub(/^\s*/m,''). - gsub(/\s*$/m,''). - split("\n") - end + supersplit end - return @patterns end def get_comments_and_licence - if @comments_and_licence == nil then - filename = File.expand_path("../../../../tex/generic/hyph-utf8/patterns/tex/hyph-#{@code}.tex", __FILE__); - lines = IO.readlines(filename, '.').join("") - @comments_and_licence = lines. - gsub(/(.*)\\patterns.*/m,'\1') - end - return @comments_and_licence + @comments_and_licence ||= readtexfile.gsub(/(.*)\\patterns.*/m,'\1') end # def lc_characters @@ -120,2080 +147,357 @@ class Language # return @lc_characters # end - attr_reader :use_new_loader, :use_old_patterns, :use_old_patterns_comment, :filename_old_patterns - attr_reader :code, :name, :synonyms, :hyphenmin, :encoding, :exceptions, :message - attr_reader :description_s, :description_l, :version + attr_reader :use_old_loader, :use_old_patterns, :use_old_patterns_comment, :filename_old_patterns + attr_reader :code, :name, :synonyms, :hyphenmin, :encoding, :message + attr_reader :description_l, :version attr_reader :licence, :authors - attr_reader :has_quotes, :has_dashes - # this hack is needed for Serbian - attr_writer :code -end -class Authors < Hash - @@list = [] - - def initialize - authors = { -#authors = { - "donald_knuth" => ["Donald", "Knuth", nil, false, false], - "peter_heslin" => ["Peter", "Heslin", nil, false, false], - "dimitrios_filippou" => ["Dimitrios", "Filippou", "dimitrios{dot}filippou{at}riotinto{dot}com", true, true], - "claudio_beccari" => ["Claudio", "Beccari","claudio{dot}beccari{at}gmail{dot}com", true, true], - "juan_aguirregabiria" => ["Juan M.", "Aguirregabiria", "juanmari{dot}aguirregabiria{at}ehu.es", true, true], - "igor_marinovic" => ["Igor", "Marinović", "marinowski{at}gmail.com", true, true], - "tilla_fick" => ["Tilla", "Fick", "fick{dot}tilla{at}gmail{dot}com", true, true], - "chris_swanepoel" => ["Chris", "Swanepoel", "cj{at}swanepoel{dot}net", true, true], - "matjaz_vrecko" => ["Matjaž", "Vrečko", "matjaz{at}mg-soft{dot}si", true, true], - "goncal_badenes" => ["Gonçal", "Badenes", "g{dot}badenes{at}ieee.org", false, false], - "pavel_sevecek" => ["Pavel", "Ševeček", "pavel{at}lingea{dot}cz", false, false], - # email doesn't work - "jana_chlebikova" => ["Jana", "Chlebíková", "chlebikj{at}dcs{dot}fmph{dot}uniba{dot}sk", false, false], - "yannis_haralambous" => ["Yannis", "Haralambous", "yannis{dot}haralambous{at}telecom-bretagne{dot}eu", true, false], - "frank_jensen" => ["Frank", "Jensen", "frank{dot}jensen{at}hugin{dot}com", true, true], - "sergei_pokrovsky" => ["Sergei", "Pokrovsky", "sergio{dot}pokrovskij{at}gmail{dot}com", true, true], - "javier_bezos" => ["Javier", "Bezos", "jbezos{at}tex-tipografia{dot}com", true, true], - "een_saar" => ["Enn", "Saar", "saar{at}aai{dot}ee", false, false], - "dejan_muhamedagic" => ["Dejan", "Muhamedagić", "dejan{at}hello-penguin{dot}com", true, true], - "brian_wilson" => ["Brian", "Wilson", "bountonw{at}gmail{dot}com", true, true], - "arthur_reutenauer" => ["Arthur", "Reutenauer", "arthur{dot}reutenauer{at}normalesup{dot}org", true, true], - "mojca_miklavec" => ["Mojca", "Miklavec", "mojca{dot}miklavec{dot}lists{at}gmail{dot}com", true, true], - "santhosh_thottingal" => ["Santhosh", "Thottingal", "santhosh{dot}thottingal{at}gmail{dot}com>", true, true], - # email doesn't work - "yves_codet" => ["Yves", "Codet", "ycodet{at}club-internet{dot}fr", true, true], - "rune_kleveland" => ["Rune", "Kleveland", nil, false, false], - # email doesn't work - "ole_michael_selberg" => ["Ole Michael", "Selberg", "o{dot}m{dot}selberg{at}c2i{dot}net", true, true], - "dorjgotov_batmunkh" => ["Dorjgotov", "Batmunkh", "bataak{at}gmail{dot}com", true, true], - "nazar_annagurban" => ["Nazar", "Annagurban", "nazartm{at}gmail{dot}com", false, false], - "jan_michael_rynning" => ["Jan Michael", "Rynning", nil, false, false], - "eduard_werner" => ["Eduard", "Werner", "edi{dot}werner{at}gmx{dot}de", false, false], - "werner_lemberg" => ["Werner", "Lemberg", "wl{at}gnu{dot}org", true, true], - # email doesn't work - "pedro_j_de_rezende" => ["Pedro J.", "de Rezende", "rezende{at}ddc{dot}unicamp{dot}br", false, false], - "j_joao_dias_almeida" => ["J. Joao", "Dias Almeida", "jj{at}di{dot}uminho{dot}pt"], - # email doesn't work - "piet_tutelaers" => ["Piet", "Tutelaers", "p{dot}t{dot}h{dot}tutelaers{at}tue{dot}nl", false, false], - "vytas_statulevicius" => ["Vytas", "Statulevičius", "vytas{at}vtex{dot}nl", false, false], - "sigitas_tolusis" => ["Sigitas", "Tolušis", "sigitas{at}vtex{dot}lt", false, false], - "janis_vilims" => ["Janis", "Vilims", "jvilims{at}apollo{dot}lv", false, false], - "joerg_knappen" => ["Jörg", "Knappen", "jknappen{at}web{dot}de", true, true], - "medeni_shemde" => ["Medeni", "Shemdê", nil, false, false], - "terry_mart" => ["Terry", "Mart", "mart{at}kph{dot}uni-mainz{dot}de", false, false], - # email doesn't work - "jorgen_pind" => ["Jorgen", "Pind", "jorgen{at}lexis{dot}hi{dot}is", false, false], - "marteinn_sverrisson" => ["Marteinn", "Sverrisson", nil, false, false], - # email doesn't work - "kristinn_gylfason" => ["Kristinn", "Gylfason", "kristgy{at}ieee{dot}org", false, false], - # email doesn't work - "kevin_p_scannell" => ["Kevin P.", "Scannell", "scanell{at}slu{dot}edu", false, false], - # email doesn't work - "peter_kleiweg" => ["Peter", "Kleiweg", "p{dot}c{dot}c{dot}kleiweg{at}rug{dot}nl", false, false], - "hanna_kolodziejska" => ["Hanna", "Kołodziejska", nil, false, false], - "boguslaw_jackowski" => ["Bogusław", "Jackowski", nil, true, true], - "marek_rycko" => ["Marek", "Ryćko", nil, false, false], - "vladimir_volovich" => ["Vladimir", "Volovich", nil, true, true], # TODO add e-mail address - "alexander_i_lebedev" => ["Alexander I.", "Lebedev", "swan{at}scon155{dot}phys{dot}msu{dot}su", false, false], # Not sure were 'I' belongs - # first email doesn't work - "maksym_polyakov" => ["Maksym", "Polyakov", "polyama{at}auburn{dot}edu", false, false], # Second e-mail address in ukrhypmp.tex: mpoliak@i.com.ua - "adrian_rezus" => ["Adrian", "Rezus", "adriaan{at}\{sci,cs\}{dot}kun{dot}nl", false, false], - # email doesn't work - "sahak_petrosyan" => ["Sahak", "Petrosyan", "sahak{at}mit{dot}edu", true, true], # I think "true, true" is right. Arthur - "dominik_wujastyk" => ["Dominik", "Wujastyk", "wujastyk{at}gmail{dot}com", false, false], - "graham_toal" => ["Graham", "Toal", nil, false, false], - "donald_e_knuth" => ["Donald E.", "Knuth", nil, false, false], # Don doesn't use e-mail ;-) - "gerard_d_c_kuiken" => ["Gerard D.C.", "Kuiken", nil, false, false], - "pierre_mackay" => ["P. A.", "MacKay", nil, true, true], - "h_turgut_uyar" => ["H. Turgut", "Uyar", "uyar{at}itu{dot}edu{tr}", true, true], - # email doesn't work - "s_ekin_kocabas" => ["S. Ekin", "Kocabas", "kocabas{at}stanford{dot}edu", true, true], - "bence_nagy" => ["Bence", "Nagy", "nagybence{at}tipogral{dot}hu", true, true], - "kauko_saarinen" => ["Kauko", "Saarinen", nil, false, false], - "fred_karlsson" => ["Fred", "Karlsson", nil, false, false], - "rene_bastian" => ["René", "Bastian", nil, false, false], # TODO make contact - "daniel_flipo" => ["Daniel", "Flipo", nil, false, false], # TODO make contact - "bernard_gaulle" => ["Bernard", "Gaulle", nil, false, false], # Deceased... - "theppitak_karoonboonyanan" => ["Theppitak", "Karoonboonyanan", "theppitak{at}gmail{dot}com", true, true], - "levan_shoshiashvili" => ["Levan", "Shoshiashvili", "shoshia{at}hotmail{dot}com", true, true], - # email doesn't work - "javier_mugica" => ["Javier", "Múgica", "javier{at}digi21{dot}eu", true, true], - "georgi_boshnakov" => ["Georgi", "Boshnakov", "georgi{dot}boshnakov{at}manchester{dot}ac{dot}uk", true, true], - "mike_kroutikov" => ["Mike", "Kroutikov", "pgmmpk{at}gmail{dot}com", true, true], - "aleksandr_andreev" => ["Aleksandr", "Andreev", "", true, true], - "maksim_salau" => ["Maksim", "Salau", "maksim{dot}salau{at}gmail{dot}com", true, false], - "wie_ming_ang" => ["Wie-Ming", "Cittānurakkho Bhikkhu", "wiemingang{at}gmail{dot}com", true, true] -} -# - authors.each do |a| - author = Author.new(a[1][0], a[1][1], a[1][2], a[1][3], a[1][4]) - @@list.push(author) - self[a[0]] = author + # def message + # @name.titlecase + ' hyphenation patterns' + # end + + def description_s + @message + end + + # Strictly speaking a misnomer, because grc-x-ibycus should also return true. + # But useful for a number of apostrophe-related routines + def isgreek? + ['grc', 'el-polyton', 'el-monoton'].include? @code + end + + def has_apostrophes + begin + !isgreek? && patterns.any? { |p| p =~ /'/ } + rescue Errno::ENOENT + false end end -end + def has_dashes + begin + patterns.any? { |p| p =~ /-/ } + rescue Errno::ENOENT + false + end + end + + # Convenience methods related to TeX Live and the .tlpsrc files + module TeXLive + def loadhyph + return filename_old_patterns if use_old_loader + + code = @code + code = @code.gsub 'sh-', 'sr-' if @code =~ /^sh-/ + sprintf 'loadhyph-%s.tex', code + end + + # ext: 'pat' or 'hyp' + # filetype: 'patterns' or 'exceptions' + def plain_text_line(ext, filetype) + return "" if ['ar', 'fa', 'grc-x-ibycus', 'mn-cyrl-x-lmc'].include? @code + + if @code =~ /^sh-/ + # TODO Warning AR 2018-09-12 + filename = sprintf 'hyph-sh-latn.%s.txt,hyph-sh-cyrl.%s.txt', ext, ext + else + filename = sprintf 'hyph-%s.%s.txt', @code, ext + filepath = File.join(PATH::TXT, filename) + # check for existence of file and that it’s not empty + unless File.file?(filepath) && File.read(filepath).length > 0 + # if the file we were looking for was a pattern file, something’s wrong + if ext == 'pat' + raise sprintf("There is some problem with plain patterns for language [%s]!!!", @code) + else # the file is simply an exception file and we’re happy + filename = '' # And we return and empty file name after all + end + end + end + + sprintf "file_%s=%s", filetype, filename + end + + def exceptions_line + plain_text_line('hyp', 'exceptions') + end + + def patterns_line + plain_text_line('pat', 'patterns') + end + + def extract_apostrophes + plain, with_apostrophe = Array.new, nil + + patterns.each do |pattern| + plain << pattern + if pattern =~ /'/ && !isgreek? + pattern_with_apostrophe = pattern.gsub(/'/,"’") + plain << pattern_with_apostrophe + (with_apostrophe ||= []) << pattern_with_apostrophe + end + end + + { plain: plain, with_apostrophe: with_apostrophe } + end -# "use_new_loader" -# => true - create a new file and use that one -# => false - use "filename_old_patterns" in language.dat -# "filename_old_patterns" -# => [string] - the name used in language.dat if "use_new_loader" is false -# "eightbitfilename" -# => [string] - if set, load another file for 8-bit engines -# "code" -# => [string] - used in filenames, needs to conform to the standard -# "name" -# => [string] - -# "synonyms" => [], -# "hyphenmin" => [], -# "encoding" => nil, -# "exceptions" => false, -# "message" => nil, - -class Languages < Hash - @@list = [] - - def initialize - languages = [ -# -------------------------------------- -# languages with no hyphenation patterns -# -------------------------------------- -# arabic -{ - "code" => "ar", - "name" => "arabic", - "use_new_loader" => false, - "use_old_patterns" => false, - "filename_old_patterns" => "zerohyph.tex", -# "hyphenmin" => [], # not needed - "encoding" => nil, - "exceptions" => false, - "message" => nil, - - # TODO - "description_s" => "(No) Arabic hyphenation patterns", - "description_l" => [ - #......................................................................# - "Prevent hyphenation in Arabic.", - ], -}, -# farsi -# =persian -{ - "code" => "fa", - "name" => "farsi", "synonyms" => ["persian"], - "use_new_loader" => false, - "use_old_patterns" => false, - "filename_old_patterns" => "zerohyph.tex", -# "hyphenmin" => [], # not needed - "encoding" => nil, - "exceptions" => false, - "message" => nil, - - # TODO - "description_s" => "(No) Persian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Prevent hyphenation in Persian.", - ], -}, -# ------------------------------- -# special patterns, not converted -# ------------------------------- -# ibycus ibyhyph.tex -{ - "code" => "grc-x-ibycus", - "name" => "ibycus", - "use_new_loader" => false, - "use_old_patterns" => true, - "filename_old_patterns" => "ibyhyph.tex", - "hyphenmin" => [2,2], - "encoding" => nil, - "exceptions" => false, - "message" => "Ancient Greek hyphenation patterns for Ibycus encoding (v3.0)", - - # "authors" => ["peter_heslin"], - "version" => 3.0, -}, -# ---------------------------- -# languages using old patterns -# ---------------------------- -# greek -# =polygreek -{ - "code" => "el-polyton", - "name" => "greek", "synonyms" => ["polygreek"], - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "Old patterns work in a different way, one-to-one conversion from UTF-8 is not possible.", - "filename_old_patterns" => "grphyph5.tex", - # left/right hyphen min for Greek can be as low as one (1), - # but for aesthetic reasons keep them at 2/2. - # Dimitrios Filippou - "hyphenmin" => [1,1], # polyglossia - "encoding" => nil, - "exceptions" => true, - "message" => "Hyphenation patterns for multi-accent (polytonic) Modern Greek", - - "version" => "5.0", - "last_modified" => "2008-06-06", - "type" => "rules", - "authors" => ["dimitrios_filippou"], - "licence" => "LPPL", - # "description_s" => "Polytonic Modern Greek hyphenation patterns", - # # #.....................................................................# - # "description_l" => [ - # #......................................................................# - # "Hyphenation patterns for Modern Greek in polytonic spelling.", - # "The pattern file used for 8-bit engines is grphyph5.tex that is", - # "not part of hyph-utf8. Patterns in UTF-8 use two code positions for", - # "each of the vowels with acute accent (a.k.a tonos, oxia), e.g.,", - # "U+03AC, U+1F71 for alpha.", - # ], -}, -# monogreek -{ - "code" => "el-monoton", - "name" => "monogreek", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "Old patterns work in a different way, one-to-one conversion from UTF-8 is not possible.", - "filename_old_patterns" => "grmhyph5.tex", - "hyphenmin" => [1,1], # polyglossia - "encoding" => nil, - "exceptions" => true, - "message" => "Hyphenation patterns for uni-accent (monotonic) Modern Greek", - - "version" => "5.0", - "last_modified" => "2008-06-06", - "type" => "rules", - "authors" => ["dimitrios_filippou"], - "licence" => "LPPL", - # "description_s" => "Monotonic Modern Greek hyphenation patterns", - # "description_l" => [ - # #......................................................................# - # "Hyphenation patterns for Modern Greek in monotonic spelling.", - # "The pattern file used for 8-bit engines is grmhyph5.tex, in Babel's LGR encoding,", - # "that is not part of hyph-utf8.", - # "Patterns in UTF-8 use two code positions for each of the vowels with acute accent", - # "(a.k.a tonos, oxia), e.g., U+03AD, U+1F73 for epsilon.", - # ], - "description_s" => "Modern Greek hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Modern Greek in monotonic and polytonic", - "spelling in LGR and UTF-8 encodings. Patterns in UTF-8 use two code", - "positions for each of the vowels with acute accent (a.k.a tonos,", - "oxia), e.g., U+03AC, U+1F71 for alpha.", - ], -}, -# ancientgreek -{ - "code" => "grc", - "name" => "ancientgreek", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "Old patterns work in a different way, one-to-one conversion from UTF-8 is not possible.", - "filename_old_patterns" => "grahyph5.tex", - "hyphenmin" => [1,1], # polyglossia - "encoding" => nil, - "exceptions" => false, - "message" => "Hyphenation patterns for Ancient Greek", - - "version" => "5.0", - "last_modified" => "2016-05-12", - "type" => "rules", - "authors" => ["dimitrios_filippou"], - "licence" => "LPPL", - # "description_s" => "Ancient Greek hyphenation patterns", - # "description_l" => [ - # #......................................................................# - # "Hyphenation patterns for Ancient Greek.", - # "The pattern file used for 8-bit engines is grahyph5.tex, in Babel's LGR encoding,", - # "that is not part of hyph-utf8.", - # "Patterns in UTF-8 use two code positions for each of the vowels with acute accent", - # "(a.k.a tonos, oxia), e.g., U+03AE, U+1F75 for eta.", - # ], - "description_s" => "Ancient Greek hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Ancient Greek in LGR and UTF-8 encodings,", - "including support for (obsolete) Ibycus font encoding.", - "Patterns in UTF-8 use two code positions for each of the vowels with", - "acute accent (a.k.a tonos, oxia), e.g., U+03AE, U+1F75 for eta.", - ], -}, -# coptic -{ - "code" => "cop", - "name" => "coptic", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "TODO: automatic conversion could be done, but was too complicated; leave for later.", - "filename_old_patterns" => "copthyph.tex", - "hyphenmin" => [1,1], # polyglossia TODO: no documentation found - "encoding" => nil, - "exceptions" => false, - "message" => "Coptic hyphenation patterns", - - "version" => nil, - "last_modified" => "2004-10-03", - "type" => "rules", - "authors" => [ "claudio_beccari" ], - "licence" => "LPPL", - "description_s" => "Coptic hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Coptic in UTF-8 encoding", - "as well as in ASCII-based encoding for 8-bit engines.", - "The latter can only be used with special Coptic fonts (like CBcoptic).", - "The patterns are considered experimental.", - ], -}, -# german -{ - "code" => "de-1901", - "name" => "german", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "Kept for the sake of backward compatibility, but newer and better patterns by WL are available.", - "filename_old_patterns" => "dehypht.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "German hyphenation patterns (traditional orthography)", - - "version" => "0.40", - "last_modified" => "2014-05-21", # For the active project - "type" => "dictionary", - "authors" => ["werner_lemberg"], - "licence" => "LPPL", - # "description_s" => "German hyphenation patterns in traditional spelling", - # "description_l" => [ - # "Hyphenation patterns for German in traditional spelling, in T1/EC and UTF-8 encoding.", - # "Patterns encoded in UTF-8 are provided by a separate package.", - # ], - - "description_s" => "German hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for German in T1/EC and UTF-8 encodings,", - "for traditional and reformed spelling, including Swiss German.", - "The package includes the latest patterns from dehyph-exptl", - "(known to TeX under names 'german', 'ngerman' and 'swissgerman'),", - "however 8-bit engines still load old versions of patterns", - "for 'german' and 'ngerman' for backward-compatibility reasons.", - "Swiss German patterns are suitable for Swiss Standard German", - "(Hochdeutsch) not the Alemannic dialects spoken in Switzerland", - "(Schwyzerduetsch).", - "There are no known patterns for written Schwyzerduetsch.", - ] -}, -# ngerman -{ - "code" => "de-1996", - "name" => "ngerman", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "Kept for the sake of backward compatibility, but newer and better patterns by WL are available.", - "filename_old_patterns" => "dehyphn.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "German hyphenation patterns (reformed orthography)", - - "version" => "0.40", - "last_modified" => "2014-05-21", # For the active project - "type" => "dictionary", - "authors" => ["werner_lemberg"], - "licence" => "LPPL", - # "description_s" => "German hyphenation patterns in reformed spelling", - # "description_l" => [ - # "Hyphenation patterns for German in reformed spelling, in T1/EC and UTF-8 encoding.", - # "Patterns encoded in UTF-8 are provided by a separate package.", - # ], -}, -# swissgerman -{ - "code" => "de-ch-1901", - "name" => "swissgerman", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Swiss-German hyphenation patterns (traditional orthography)", - - "version" => "0.40", - "last_modified" => "2014-05-21", # For the active project - "type" => "dictionary", - "authors" => ["werner_lemberg"], - "licence" => "LPPL", - # "description_l" => "German hyphenation patterns, traditional spelling in Switzerland.", - # "description_s" => [ - # "Hyphenation patterns for German in traditional spelling as used in Switzerland, in T1/EC and UTF-8.", - # "These patterns are suitable for Standard German (Hochdeutsch), not the Alemannic dialects", - # "spoken in Switzerland (Schwyzerdütsch). There are no patterns for written Schwyzerdütsch", - # "we know of.", - # ], -}, -# russian -{ - "code" => "ru", - "name" => "russian", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "The old system allows choosing patterns and encodings manually. That mechanism needs to be implemented first in this package, so we still fall back on old system.", - "filename_old_patterns" => "ruhyphen.tex", - "hyphenmin" => [2,2], - "encoding" => "t2a", - "exceptions" => false, - "message" => "Russian hyphenation patterns", - - "version" => nil, - "last_modified" => "2003-03-10", # Date of the patterns proper, not the support files - "type" => "dictionary", - "authors" => ["alexander_i_lebedev", "werner_lemberg", "vladimir_volovich"], - "licence" => "LPPL", - "description_s" => "Russian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Russian in T2A and UTF-8 encodings.", - "For 8-bit engines, the 'ruhyphen' package provides a number of", - "different pattern sets, as well as different (8-bit) encodings, that", - "can be chosen at format-generation time. The UTF-8 version only", - "provides the default pattern set. A mechanism similar to the one used", - "for 8-bit patterns may be implemented in the future.", - ], -}, -# ukrainian -{ - "code" => "uk", - "name" => "ukrainian", - "use_new_loader" => true, - "use_old_patterns" => true, - "use_old_patterns_comment" => "The old system allows choosing patterns and encodings manually. That mechanism needs to be implemented first in this package, so we still fall back on old system.", - "filename_old_patterns" => "ukrhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "t2a", - "exceptions" => false, - "message" => "Ukrainian hyphenation patterns", - - "version" => nil, - "last_modified" => "2001-05-10", # Date of the patterns proper - # "type" => "rules", # TODO: it is not really clear - "authors" => ["maksym_polyakov", "werner_lemberg", "vladimir_volovich"], - "licence" => "LPPL", - "description_s" => "Ukrainian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Ukrainian in T2A and UTF-8 encodings.", - "For 8-bit engines, the 'ukrhyph' package provides a number of", - "different pattern sets, as well as different (8-bit) encodings, that", - "can be chosen at format-generation time. The UTF-8 version only", - "provides the default pattern set. A mechanism similar to the one used", - "for 8-bit patterns may be implemented in the future.", - ], -}, -# ---------------------------- -# languages using new patterns -# ---------------------------- -# afrikaans -{ - "code" => "af", - "name" => "afrikaans", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [1,2], # in babel: 2,2 - "encoding" => "ec", - "exceptions" => true, - "message" => "Afrikaans hyphenation patterns", - - "version" => "1.0", - "last_modified" => "2013-10-08", - "type" => "dictionary", - "authors" => [ "tilla_fick", "chris_swanepoel" ], - "email" => [ "hyphen{at}rekenaar{dot}net" ], - "licence" => "LPPL", - "description_s" => "Afrikaans hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Afrikaans in T1/EC and UTF-8 encodings.", - "OpenOffice includes older patterns created by a different author,", - "but the patterns packaged with TeX are considered superior in quality.", - # "Word list used to generate patterns with opatgen might be released in future.", - ], -}, -# catalan -{ - "code" => "ca", - "name" => "catalan", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "cahyph.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => true, - "message" => "Catalan hyphenation patterns", - - "version" => "1.11", - "last_modified" => "2003-07-15", - "type" => "rules", # not only rules, also patgen, but it is a good approximation - "authors" => [ "goncal_badenes" ], - "licence" => "LPPL", - "description_s" => "Catalan hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Catalan in T1/EC and UTF-8 encodings.", - ], -}, -# czech -{ - "code" => "cs", - "name" => "czech", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "czhyph.tex", - "filename_old_patterns_other" => ["czhyphen.tex","czhyphen.ex"], - # Both Czech and Slovak: \lefthyphenmin=2, \righthyphenmin=3 - # Typographical rules allow \righthyphenmin=2 when typesetting in a - # narrow column (newspapers etc.). - # (used to be 2,2) - "hyphenmin" => [2,3], - "encoding" => "ec", - "exceptions" => true, - "message" => "Czech hyphenation patterns (Pavel Sevecek, v3, 1995)", - - "version" => "3", - # guessing based on CTAN/macros/cstex/base/csplain.tar.gz: - # 1998-12-17 (patterns) - # 1995-08-23 (exceptions) - # but patterns claim 1995 - "last_modified" => "1995", # todo: no date - "type" => "dictionary", - "authors" => [ "pavel_sevecek" ], - "licence" => "GPL", - "description_s" => "Czech hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Czech in T1/EC and UTF-8 encodings.", - "Original patterns 'czhyphen' are still distributed in the 'csplain'", - "package and loaded with ISO Latin 2 encoding (IL2).", - # however hyph-utf8 could also be used for that - ], -}, -# slovak -{ - "code" => "sk", - "name" => "slovak", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "skhyph.tex", - "filename_old_patterns_other" => ["skhyphen.tex","skhyphen.ex"], - # see czech - "hyphenmin" => [2,3], - "encoding" => "ec", - "exceptions" => true, - "message" => "Slovak hyphenation patterns (Jana Chlebikova, 1992)", - - "version" => "2", - "last_modified" => "1992-04-24", - "type" => "dictionary", - "authors" => [ "jana_chlebikova" ], - "licence" => "GPL", - "description_s" => "Slovak hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Slovak in T1/EC and UTF-8 encodings.", - "Original patterns 'skhyphen' are still distributed in the 'csplain'", - "package and loaded with ISO Latin 2 encoding (IL2).", - # however hyph-utf8 could also be used for that - ], -}, -# welsh -{ - "code" => "cy", - "name" => "welsh", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "cyhyph.tex", - "hyphenmin" => [2,3], - "encoding" => "ec", - "exceptions" => false, - "message" => "Welsh hyphenation patterns", - - "version" => nil, - "last_modified" => "1996", - "type" => "dictionary", - "authors" => [ "yannis_haralambous" ], - "licence" => "LPPL", - "description_s" => "Welsh hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Welsh in T1/EC and UTF-8 encodings.", - ], -}, -# danish -{ - "code" => "da", - "name" => "danish", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "dkhyph.tex", - "filename_old_patterns_other" => ["dkcommon.tex", "dkspecial.tex"], - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Danish hyphenation patterns", - - "version" => nil, - "last_modified" => "2011-01-11", - "type" => "dictionary", - "authors" => [ "frank_jensen" ], - "licence" => "LPPL", - "description_s" => "Danish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Danish in T1/EC and UTF-8 encodings.", - ], -}, -# esperanto -{ - "code" => "eo", - "name" => "esperanto", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "eohyph.tex", - "hyphenmin" => [2,2], - "encoding" => "il3", # TODO - "exceptions" => false, - "message" => "Esperanto hyphenation patterns", - - "version" => nil, - "last_modified" => "1999-08-10", - "type" => "rules", - "authors" => [ "sergei_pokrovsky" ], - "licence" => "LPPL", - "description_s" => "Esperanto hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Esperanto ISO Latin 3 and UTF-8 encodings.", - "Note that TeX distributions don't ship any suitable fonts in Latin 3", - "encoding, so unless you create your own font support or want to use", - "MlTeX, using native Unicode engines is highly recommended.", - # "Hyphenation patterns for Esperanto ISO Latin 3 and UTF-8 encodings.", - # "Note that TeX distributions usually don't ship any suitable fonts in", - # "Latin 3 encoding, so unless you create your own font support or want", - # "to use MlTeX, using native UTF-8 engines is highly recommended.", - ], -}, -# spanish -# =espanol -{ - "code" => "es", - "name" => "spanish", "synonyms" => ["espanol"], - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "eshyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Spanish hyphenation patterns", - - "version" => "4.7", - "last_modified" => "2015-11-12", - "type" => "dictionary", - "authors" => [ "javier_bezos" ], - "licence" => "MIT/X11", - "description_s" => "Spanish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Spanish in T1/EC and UTF-8 encodings.", - ], -}, -# basque -{ - "code" => "eu", - "name" => "basque", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "bahyph.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Basque hyphenation patterns", - - "version" => nil, - "last_modified" => "2008-06-26", - "type" => "rules", - "authors" => [ "juan_aguirregabiria" ], - "licence" => "other-free", # "public-check", - "description_s" => "Basque hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Basque in T1/EC and UTF-8 encodings.", - # "Generating scripts for these rule-based patterns is included in hyph-utf8." - ], -}, -# french -# =patois -# =francais -{ - "code" => "fr", - "name" => "french", "synonyms" => ["patois","francais"], - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "frhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "French hyphenation patterns", - - "version" => "2.13", - "last_modified" => "2016-05-12", - "type" => "rules", - "authors" => ["daniel_flipo", "bernard_gaulle", "arthur_reutenauer"], - "email" => ["cesure-l{at}gutenberg{dot}eu{dot}org"], - "licence" => "MIT", - "description_s" => "French hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for French in T1/EC and UTF-8 encodings.", - ] -}, -# galician -{ - "code" => "gl", - "name" => "galician", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "glhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Galician hyphenation patterns", - - "version" => "2.4", - "last_modified" => "2010-04-23", - "type" => "rules", - "authors" => ["javier_mugica"], - "licence" => "LPPL", # Status maintained - "description_s" => "Galician hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Galician in T1/EC and UTF-8 encodings.", - # "Generated automatically from the mkpattern utility.", - ] -}, -# estonian -{ - "code" => "et", - "name" => "estonian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "ethyph.tex", - "hyphenmin" => [2,3], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Estonian hyphenation patterns", - - "version" => nil, - "last_modified" => "2004-04-13", - "type" => "dictionary", - "authors" => [ "een_saar" ], - "licence" => "LPPL|MIT", # Dual MIT-LPPL - "description_s" => "Estonian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Estonian in T1/EC and UTF-8 encodings.", - ], -}, -# finnish -{ - "code" => "fi", - "name" => "finnish", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "fihyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Finnish hyphenation patterns", - - "version" => "2.2", - "last_modified" => "1989-03-08", - "type" => "rules", - "authors" => ["kauko_saarinen", "fred_karlsson"], - "licence" => "other-free", - "description_s" => "Finnish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Finnish in T1/EC and UTF-8 encodings.", - ], -}, -# croatian -{ - "code" => "hr", - "name" => "croatian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "hrhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Croatian hyphenation patterns", - - "version" => nil, - "last_modified" => "1996-03-19", - "type" => "dictionary", - "authors" => [ "igor_marinovic" ], - "licence" => "LPPL", - "description_s" => "Croatian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Croatian in T1/EC and UTF-8 encodings.", - ], -}, -# hungarian -{ - "code" => "hu", - "name" => "hungarian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "huhyphn.tex", - "hyphenmin" => [2,2], # polyglossia - "encoding" => "ec", - "exceptions" => false, - "message" => "Hungarian hyphenation patterns (v20110815)", - - # https://github.com/nagybence/huhyphn/ - "version" => "v20110815", - "last_modified" => "2011-08-15", # actually, it is "2009-06-12" or older for contents; we probably want to check/fix this - "type" => "dictionary", - "authors" => ["bence_nagy"], - "licence" => "MPL 1.1/GPL 2.0/LGPL 2.1", # TODO - "description_s" => "Hungarian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Hungarian in T1/EC and UTF-8 encodings.", - # TODO: same comment as for Irish: I'm slightly reluctant to put URL addresses here. - "From https://github.com/nagybence/huhyphn/." - ], -}, -# armenian -# Sahak Petrosyan <sahak at mit dot edu> -{ - "code" => "hy", - "name" => "armenian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [1,2], # taken from Hyphenator.js; check the value - "encoding" => nil, - "exceptions" => false, - "message" => "Armenian hyphenation patterns", - - "version" => nil, - "last_modified" => "2010-05", - "type" => "rules", - "authors" => ["sahak_petrosyan"], - "licence" => "LGPL", - "description_s" => "Armenian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Armenian for Unicode engines.", - # "Auto-generated from a script included in hyph-utf8.", - ], -}, -# interlingua -{ - "code" => "ia", - "name" => "interlingua", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "iahyphen.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ascii", - "exceptions" => true, - "message" => "Hyphenation patterns for Interlingua", - - "version" => "0.2c", - "last_modified" => "2005-06-28", - "type" => "dictionary", - "authors" => ["peter_kleiweg"], - "licence" => "LPPL", # TODO Status maintained - "description_s" => "Interlingua hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Interlingua in ASCII encoding.", - ], -}, -# indonesian -{ - "code" => "id", - "name" => "indonesian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "inhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ascii", - "exceptions" => true, - "message" => "Indonesian hyphenation patterns", - - "version" => "1.3", - "last_modified" => "1997-09-19", - "type" => "rules", - "authors" => ["joerg_knappen", "terry_mart"], - "licence" => "GPL", - "description_s" => "Indonesian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Indonesian (Bahasa Indonesia) in ASCII", - "encoding. They are probably also usable for Malay (Bahasa Melayu).", - ], -}, -# icelandic -{ - "code" => "is", - "name" => "icelandic", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "icehyph.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Icelandic hyphenation patterns", - - "version" => nil, - "last_modified" => "2004-03-02", - "type" => "dictionary", - # TODO: I'm not sure that the last two names are relevant, I don't find the source of Marteinn Sverrisson - "authors" => ["jorgen_pind", "marteinn_sverrisson", "kristinn_gylfason"], - "licence" => "LPPL", - "description_s" => "Icelandic hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Icelandic in T1/EC and UTF-8 encodings.", - ], -}, -# irish -{ - "code" => "ga", - "name" => "irish", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "gahyph.tex", - "hyphenmin" => [2,3], # babel - "encoding" => "ec", - "exceptions" => true, - "message" => "Irish hyphenation patterns", - - "version" => "1.0", - "last_modified" => "2004-01-22", - "type" => "dictionary", - "authors" => ["kevin_p_scannell"], - "licence" => "GPL", - "description_s" => "Irish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Irish (Gaeilge) in T1/EC and UTF-8 encodings.", - "Visit http://borel.slu.edu/fleiscin/index.html for more information.", - # TODO: I'm slightly reluctant to put URL here - ], -}, -# italian -{ - "code" => "it", - "name" => "italian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "ithyph.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ascii", - "exceptions" => false, - "message" => "Italian hyphenation patterns", - - "version" => "4.9", - "last_modified" => "2014-04-22", - "type" => "rules", # TODO: we might want to check that, but it seems unlikely that patgen was used - "authors" => ["claudio_beccari"], - "licence" => "LPPL", # Status: maintained! - "description_s" => "Italian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Italian in ASCII encoding.", - # supposed to be ... - "Compliant with the Recommendation UNI 6461 on hyphenation", - "issued by the Italian Standards Institution", - "(Ente Nazionale di Unificazione UNI).", - # "Implements Recommendation UNI 6461 issued by the Italian Standards Institution", - # "(Ente Nazionale di Unificazione UNI).", - ], -}, -# romansh -{ - "code" => "rm", - "name" => "romansh", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [2,2], # todo - "encoding" => "ascii", - "exceptions" => false, - "message" => "Romansh hyphenation patterns", - - "version" => "1.1", - "last_modified" => "2012-04-10", - "type" => "rules", - "authors" => ["claudio_beccari"], - "licence" => "LPPL", # Status: maintained! - "description_s" => "Romansh hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Romansh in ASCII encoding.", - "They are supposed to comply with the rules indicated by the Lia", - "Rumantscha (Romansh language society).", - ], -}, -# friulan -{ - "code" => "fur", - "name" => "friulan", "synonyms" => [], - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Friulan hyphenation patterns", - - "version" => "1.1", - "last_modified" => "2012-04-10", - "type" => "rules", - "authors" => ["claudio_beccari"], - "licence" => "LPPL", # Status: maintained! - "description_s" => "Friulan hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Friulan in ASCII encoding.", - "They are supposed to comply with the common spelling of the", - "Friulan (Furlan) language as fixed by the Regional Law N.15/96", - "dated November 6, 1996 and its following amendments.", - ], -}, -# piedmontese -{ - "code" => "pms", - "name" => "piedmontese", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [2,2], - "encoding" => "ascii", - "exceptions" => false, - "message" => "Piedmontese hyphenation patterns", - - "version" => "1.0", - "last_modified" => "2013-02-14", - "type" => "rules", - "authors" => ["claudio_beccari"], - "licence" => "LPPL", # Status: maintained! - "description_s" => "Piedmontese hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Piedmontese in ASCII encoding.", - "Compliant with 'Gramatica dla lengua piemonteisa' by Camillo Brero.", - ], -}, -# 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)", - - "version" => "1.0", - "last_modified" => "2009-06-29", - "type" => "dictionary", - "authors" => ["joerg_knappen", "medeni_shemde"], - "licence" => "LPPL", # Status: maintained! - "description_s" => "Kurmanji hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Kurmanji (Northern Kurdish) as spoken in", - "Turkey and by the Kurdish diaspora in Europe, in T1/EC and UTF-8", - "encodings." - ], -}, -# latin -{ - "code" => "la", - "name" => "latin", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "lahyph.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Latin hyphenation patterns", - - "version" => "3.2a", - "last_modified" => "2014-06-04", # patterns (behaviour) last modified on 2010-06-01 - "type" => "rules", - "authors" => [ "claudio_beccari" ], - "licence" => "LPPL", - "description_s" => "Latin hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Latin in T1/EC and UTF-8 encodings,", - "mainly in modern spelling (u when u is needed and v when v is needed),", - "medieval spelling with the ligatures \\ae and \\oe and the (uncial)", - "lowercase 'v' written as a 'u' is also supported. Apparently", - "there is no conflict between the patterns of modern Latin and", - "those of medieval Latin.", - ], -}, -# classiclatin -{ - "code" => "la-x-classic", - "name" => "classiclatin", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [2,2], - "encoding" => "ascii", - "exceptions" => false, - "message" => "Classical Latin hyphenation patterns", - - "version" => "1.2", - "last_modified" => "2014-10-06", - "type" => "rules", - "authors" => [ "claudio_beccari" ], - "licence" => "LPPL", - "description_s" => "Classical Latin hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for the Classical Latin in T1/EC and UTF-8", - "encodings. Classical Latin hyphenation patterns are different from", - "those of 'plain' Latin, the latter being more adapted to modern Latin.", - ], -}, -# liturgicallatin -{ - "code" => "la-x-liturgic", - "name" => "liturgicallatin", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Liturgical Latin hyphenation patterns", - - "version" => "1.040", - "last_modified" => "2016-05-19", - "type" => "rules", - "authors" => [ "claudio_beccari" ], - "licence" => "MIT", - "description_s" => "Liturgical Latin hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for the Liturgical Latin in T1/EC and UTF-8", - "encodings.", - ], -}, -# lithuanian -{ - "code" => "lt", - "name" => "lithuanian", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], - "encoding" => "l7x", - "exceptions" => false, - "message" => "Lithuanian hyphenation patterns", - - "version" => nil, - "last_modified" => "2002-11-20", # 1992-03-04, for the content? - "authors" => ["vytas_statulevicius", "yannis_haralambous", "sigitas_tolusis"], - # "licence" => "LPPL", - "description_s" => "Lithuanian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Lithuanian in L7X and UTF-8 encodings.", - # "Designed for \\lefthyphenmin and \\righthyphenmin set to 2.", - "\\lefthyphenmin and \\righthyphenmin have to be at least 2.", - # "Changing them to 1 according to grammatical rules from 1997", - # "would require to review and maybe rebuild the patterns." - ], -}, -# latvian -{ - "code" => "lv", - "name" => "latvian", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], - "encoding" => "l7x", - "exceptions" => false, - "message" => "Latvian hyphenation patterns", - - "version" => "0.3", - "last_modified" => "2005-09-14", - "type" => "dictionary", - "authors" => ["janis_vilims"], - "licence" => "LGPL", - "description_s" => "Latvian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Latvian in L7X and UTF-8 encodings.", - ], -}, -# dutch -{ - "code" => "nl", - "name" => "dutch", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "nehyph96.tex", - # quoting Hans Hagen: - # patterns generated with 2,2 (so don't go less) but use prefered values 2,3 (educational publishers want 4,5 -) - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => true, - "message" => "Dutch hyphenation patterns", - - "version" => "1.1", - "last_modified" => "1996-11", - "type" => "dictionary", - "authors" => ["piet_tutelaers"], - "licence" => "LPPL", - "description_s" => "Dutch hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Dutch in T1/EC and UTF-8 encodings.", - # "\\lefthyphenmin and \\righthyphenmin must both be > 1.", - "These patterns don't handle cases like 'menuutje' > 'menu-tje',", - "and don't hyphenate words that have different hyphenations according", - "to their meaning." - ], -}, -# occitan -{ - "code" => "oc", - "name" => "occitan", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Occitan hyphenation patterns", - - "version" => "0.1", - "last_modified" => "2016-02-04", - "type" => "rules", - "authors" => [ "claudio_beccari" ], - "licence" => "LPPL", - "description_s" => "Occitan hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Occitan in T1/EC and UTF-8 encodings.", - "They are supposed to be valid for all the Occitan variants", - "spoken and written in the wide area called 'Occitanie' by the French.", - "It ranges from the Val d'Aran within Catalunya, to the South Western", - "Italian Alps encompassing the southern half of the French pentagon.", - ], -}, -# polish -{ - "code" => "pl", - "name" => "polish", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "plhyph.tex", - #{}"hyphenmin" => [1,1], - "hyphenmin" => [2,2], - "encoding" => "qx", - "exceptions" => true, - "message" => "Polish hyphenation patterns", - - "version" => "3.0a", - "last_modified" => "1995-06-17", - "type" => "dictionary", - "authors" => ["hanna_kolodziejska", "boguslaw_jackowski", "marek_rycko"], - "licence" => "public", # TODO Knuthian type - "description_s" => "Polish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Polish in QX and UTF-8 encodings.", - "These patterns are also used by Polish TeX formats MeX and LaMeX.", - ], -}, -# portuguese -# =portuges -{ - "code" => "pt", - "name" => "portuguese", "synonyms" => ["portuges"], - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "pthyph.tex", - "hyphenmin" => [2,3], # babel - "encoding" => "ec", - "exceptions" => true, - "message" => "Portuguese hyphenation patterns", - - "version" => "1.0", - "last_modified" => "1996-07-21", - "type" => "rules", # TODO: we could create a generating script - "authors" => ["pedro_j_de_rezende", "j_joao_dias_almeida"], - "licence" => "BSD-3", - "description_s" => "Portuguese hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Portuguese in T1/EC and UTF-8 encodings.", - ], -}, -# pinyin -{ - "code" => "zh-latn-pinyin", - "name" => "pinyin", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "pyhyph.tex", - "hyphenmin" => [1,1], - "encoding" => "ec", - "exceptions" => false, - "message" => "Hyphenation patterns for unaccented pinyin syllables (CJK 4.8.0)", - - "version" => "4.8.0", - "last_modified" => "2008-05-22", - "type" => "rules", # TODO: we could create a generating script - "authors" => ["werner_lemberg"], - "licence" => "GPL", - "description_s" => "Chinese pinyin hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for unaccented transliterated Mandarin Chinese", - "(pinyin) in T1/EC and UTF-8 encodings.", - ], -}, -# romanian -{ - "code" => "ro", - "name" => "romanian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "rohyphen.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Romanian hyphenation patterns", # : `rohyphen' 1.1 <29.10.1996> - - "version" => "1.1R", - "last_modified" => "1996-11-07", - "type" => "dictionary", - "authors" => ["adrian_rezus"], - "description_s" => "Romanian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Romanian in T1/EC and UTF-8 encodings.", - "The UTF-8 patterns use U+0219 for the character 's with comma accent'", - "and U+021B for 't with comma accent', but we may consider using U+015F", - "and U+0163 as well in the future.", - # "Generated by PatGen2-output hyphen-level 9.", - ], -}, -# slovenian -# =slovene -{ - "code" => "sl", - "name" => "slovenian", "synonyms" => ["slovene"], - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "sihyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Slovenian hyphenation patterns", - - "version" => "2.3", - "last_modified" => "1997-15-04", - "type" => "dictionary", - "authors" => [ "matjaz_vrecko" ], - "licence" => "LPPL", - "description_s" => "Slovenian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Slovenian in T1/EC and UTF-8 encodings.", - ], -}, -# uppersorbian -{ - "code" => "hsb", - "name" => "uppersorbian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "sorhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => true, - "message" => "Upper Sorbian hyphenation patterns (E. Werner)", -# \message{Hyphenation patterns for Upper Sorbian, E. Werner} -# \message{Completely new revision 1997, March 22} - - "version" => nil, - "last_modified" => "1997-03-22", - "authors" => ["eduard_werner"], - "type" => "dictionary", - "licence" => "LPPL", - "description_s" => "Upper Sorbian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Upper Sorbian in T1/EC and UTF-8 encodings.", - ], -}, -# swedish -{ - "code" => "sv", - "name" => "swedish", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "svhyph.tex", - "hyphenmin" => [2,2], # patters say it could be 1,2; babel says 2,2 - double check - "encoding" => "ec", - "exceptions" => false, - "message" => "Swedish hyphenation patterns (Jan Michael Rynning, 1994-03-03)", - - # "version" => "1994-03-03", # that is what author used in message - "version" => nil, - "last_modified" => "1994-03-03", - "type" => "dictionary", - "authors" => ["jan_michael_rynning"], - "licence" => "LPPL", - "description_s" => "Swedish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Swedish in T1/EC and UTF-8 encodings.", - ], -}, -# turkmen -{ - "code" => "tk", - "name" => "turkmen", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => nil, - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => false, - "message" => "Turkmen hyphenation patterns", - - "version" => "0.1", - "last_modified" => "2010-03-16", - "type" => "dictionary", - "authors" => [ "nazar_annagurban" ], - "licence" => "public", - "description_s" => "Turkmen hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Turkmen in T1/EC and UTF-8 encodings.", - ], -}, -# turkish -{ - "code" => "tr", - "name" => "turkish", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "tkhyph.tex", - "hyphenmin" => [2,2], # polyglossia - "encoding" => "ec", - "exceptions" => false, - "message" => "Turkish hyphenation patterns", - - "version" => nil, - "last_modified" => "2008-06-28", - "type" => "rules", - "authors" => ["pierre_mackay", "h_turgut_uyar", "s_ekin_kocabas", "mojca_miklavec"], - "licence" => "LPPL", - "description_s" => "Turkish hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Turkish in T1/EC and UTF-8 encodings.", - # "Auto-generated from a script included in the distribution.", - "The patterns for Turkish were first produced for the Ottoman Texts", - "Project in 1987 and were suitable for both Modern Turkish and Ottoman", - "Turkish in Latin script, however the required character set didn't fit", - "into EC encoding, so support for Ottoman Turkish had to be dropped to", - "keep compatibility with 8-bit engines.", - ] -}, - - - - -# ukenglish -{ - "code" => "en-gb", - "name" => "ukenglish", "synonyms" => ["british", "UKenglish"], - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "ukhyphen.tex", - "hyphenmin" => [2,3], # confirmed, same as what Knuth says - "encoding" => "ascii", - "exceptions" => true, - "message" => "Hyphenation patterns for British English", - - "version" => "1.0a", # FIXME a much older comment says 2.0? - "last_modified" => "2005-10-18", - "type" => "dictionary", - "authors" => ["dominik_wujastyk", "graham_toal"], - "licence" => "other-free", # TODO Knuth-like - # (This will be uncommented during reimplementation) - # "description_s" => "British English hyphenation patterns", - # "description_l" => [ - # "Hyphenation patterns for British English in ASCII encoding.", - # ], - - "description_s" => "English hyphenation patterns", - "description_l" => [ - #......................................................................# - "Additional hyphenation patterns for American and British", - "English in ASCII encoding. The American English patterns", - "(usenglishmax) greatly extend the standard patterns from Knuth", - "to find many additional hyphenation points. British English", - "hyphenation is completely different from US English, so has its", - "own set of patterns.", - ], -}, -# (US english) -# usenglishmax -{ - "code" => "en-us", - "name" => "usenglishmax", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "ushyphmax.tex", - "hyphenmin" => [2,3], # confirmed, same as what Knuth says - "encoding" => "ascii", - "exceptions" => true, - "message" => "Hyphenation patterns for American English", - - "version" => nil, - "last_modified" => "1990-03-01", # 8-bit file also has version 2005-05-30. - "type" => "dictionary", - "authors" => ["donald_e_knuth", "gerard_d_c_kuiken"], - "licence" => "other-free", - # (This will be uncommented during reimplementation) - # "description_s" => "American English hyphenation patterns", - # "description_l" => [ - # "Hyphenation patterns for American English in ASCII encoding.", - # ], -}, -# US english -# { -# "code" => "en-us-x-knuth", -# "name" => "english", -# "use_new_loader" => false, -# "use_old_patterns" => false, -# "filename_old_patterns" => "hyphen.tex", -# "hyphenmin" => [2,3], # confirmed, same as what Knuth says -# "encoding" => "ascii", -# "exceptions" => true, -# "message" => "Hyphenation patterns for American English", -# }, -# TODO: FIXME!!! -# serbian -{ - "code" => "sh-latn", - "name" => "serbian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "shhyphl.tex", - # It is allowed to leave one character at the end of the row. - # However, if you think that it is graphicaly not very - # pleasant these patterns will work well with \lefthyphenmin=2. - # \lefthyphenmin=1 \righthyphenmin=2 - "hyphenmin" => [2,2], - "encoding" => "ec", - "exceptions" => true, - "message" => "Serbian hyphenation patterns in Latin script", - - # only for serbian - "version" => "2.02", - "last_modified" => "2008-06-22", - "type" => "dictionary", - "authors" => [ "dejan_muhamedagic" ], - "licence" => "LPPL", - # for both scripts - "description_s" => "Serbian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Serbian in T1/EC, T2A and UTF-8 encodings.", - "For 8-bit engines the patterns are available separately as 'serbian'", - "in T1/EC encoding for Latin script and 'serbianc' in T2A encoding for", - "Cyrillic script. Unicode engines should only use 'serbian'", - "which has patterns in both scripts combined.", - ], -}, -# serbianc -{ - "code" => "sh-cyrl", - "name" => "serbianc", - "use_new_loader" => true, - "use_old_patterns" => false, - # "filename_old_patterns" => "srhyphc.tex", - "hyphenmin" => [2,2], - "encoding" => "t2a", - "exceptions" => true, - "message" => "Serbian hyphenation patterns in Cyrillic script", -}, -# mongolian (used to be mongolian2a) -{ - "code" => "mn-cyrl", - "name" => "mongolian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "mnhyphn.tex", - "hyphenmin" => [2,2], - "encoding" => "t2a", - "exceptions" => false, - "message" => "(New) Mongolian hyphenation patterns", - - # only for this one - "version" => "1.2", - "last_modified" => "2010-04-03", - "type" => "dictionary", - "authors" => [ "dorjgotov_batmunkh" ], - "licence" => "LPPL", - # for both - "description_s" => "Mongolian hyphenation patterns in Cyrillic script", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Mongolian in T2A, LMC and UTF-8 encodings.", - "LMC encoding is used in MonTeX. The package includes two sets of", - "patterns that will hopefully be merged in future.", - ], -}, -# mongolianlmc xu-mnhyph.tex (used to be mongolian) -{ - "code" => "mn-cyrl-x-lmc", - "name" => "mongolianlmc", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "mnhyph.tex", - "hyphenmin" => [2,2], - "encoding" => "lmc", - "exceptions" => false, - "message" => "Mongolian hyphenation patterns", -}, -# bulgarian -{ - "code" => "bg", - "name" => "bulgarian", - "use_new_loader" => true, - "use_old_patterns" => false, - "filename_old_patterns" => "bghyphen.tex", - "hyphenmin" => [2,2], # babel - "encoding" => "t2a", - "exceptions" => false, - "message" => "Bulgarian hyphenation patterns", - - "version" => "1.7", - "last_modified" => "2008-06", - "type" => "pattern", - "authors" => [ "georgi_boshnakov" ], - "licence" => "LPPL", - "description_s" => "Bulgarian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Bulgarian in T2A and UTF-8 encodings.", - ], -}, -# sanskrit -{ - "code" => "sa", - "name" => "sanskrit", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,3], # polyglossia - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Sanskrit hyphenation patterns (v0.6, 2011/09/14)", - - "version" => "0.6", - "last_modified" => "2011-09-14", - "type" => "rules", - "authors" => ["yves_codet"], - "licence" => "free", # You may freely use, copy, modify and/or distribute this file. - "description_s" => "Sanskrit hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Sanskrit and Prakrit in transliteration,", - "and in Devanagari, Bengali, Kannada, Malayalam and Telugu scripts", - "for Unicode engines.", - ], -}, -# norwegian -{ - "code" => "no", - "name" => "norwegian", # TODO: fixme - "use_new_loader" => false, - "use_old_patterns" => false, - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => false, - "message" => "Norwegian hyphenation patterns", -}, -# norsk -{ - "code" => "nb", - "name" => "bokmal", "synonyms" => ["norwegian", "norsk"], - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => true, - "message" => "Norwegian Bokmal hyphenation patterns", - - "version" => nil, - "last_modified" => "2012-05-18", - "type" => "dictionary", - "authors" => [ "rune_kleveland", "ole_michael_selberg" ], - "licence" => "free", # TODO - "description_s" => "Norwegian Bokmal and Nynorsk hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Norwegian Bokmal and Nynorsk in T1/EC and", - "UTF-8 encodings.", - ], -}, -# nynorsk -{ - "code" => "nn", - "name" => "nynorsk", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], # babel - "encoding" => "ec", - "exceptions" => true, - "message" => "Norwegian Nynorsk hyphenation patterns", -}, -##### -# assamese -{ - "code" => "as", - "name" => "assamese", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Assamese hyphenation patterns", - - # this is true for all Indic patterns - "version" => "0.9.0", - "last_modified" => "2016-01-16", - "type" => "rules", - "authors" => ["santhosh_thottingal"], - "licence" => "MIT", - "description_s" => "Indic hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Assamese, Bengali, Gujarati, Hindi, Kannada,", - "Malayalam, Marathi, Oriya, Panjabi, Tamil and Telugu for Unicode", - "engines.", - ], -}, -# bengali -{ - "code" => "bn", - "name" => "bengali", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Bengali hyphenation patterns", -}, -# gujarati -{ - "code" => "gu", - "name" => "gujarati", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Gujarati hyphenation patterns", -}, -# hindi -{ - "code" => "hi", - "name" => "hindi", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Hindi hyphenation patterns", -}, -# kannada -{ - "code" => "kn", - "name" => "kannada", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Kannada hyphenation patterns", -}, -# malayalam -{ - "code" => "ml", - "name" => "malayalam", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Malayalam hyphenation patterns", -}, -# marathi -{ - "code" => "mr", - "name" => "marathi", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Marathi hyphenation patterns", -}, -# oriya -{ - "code" => "or", - "name" => "oriya", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Oriya hyphenation patterns", -}, -# panjabi -{ - "code" => "pa", - "name" => "panjabi", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Panjabi hyphenation patterns", -}, -# tamil -{ - "code" => "ta", - "name" => "tamil", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Tamil hyphenation patterns", -}, -# telugu -{ - "code" => "te", - "name" => "telugu", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], # TODO - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Telugu hyphenation patterns", -}, -# thai -{ - "code" => "th", - "name" => "thai", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,3], - "encoding" => "lth", - "exceptions" => false, - "message" => "Thai hyphenation patterns", - - "version" => nil, - "last_modified" => "2015-05-07", - "type" => "dictionary", - "authors" => [ "theppitak_karoonboonyanan" ], - "licence" => "LPPL", - "description_s" => "Thai hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Thai in LTH and UTF-8 encodings.", - ], -}, -# lao -#{ -# "code" => "lo", -# "name" => "lao", -# "use_new_loader" => true, -# "use_old_patterns" => false, -# "hyphenmin" => [1,1], # TODO -# "encoding" => nil, # no patterns for 8-bit engines -# "exceptions" => false, -# "message" => "Lao hyphenation patterns", -# -# "version" => nil, -# "last_modified" => "2010-05-19", -# "type" => "rules", -# "authors" => [ "brian_wilson", "arthur_reutenauer", "mojca_miklavec" ], -# "licence" => "other-free", -# "description_s" => "Lao hyphenation patterns", -# "description_l" => [ -# #......................................................................# -# "Hyphenation patterns for Lao language for Unicode engines.", -# "Current version is experimental and gives bad results.", -# ], -#}, -# pan-Ethiopic -{ - "code" => "mul-ethi", - "name" => "ethiopic", "synonyms" => ["amharic", "geez"], - "version" => nil, - "last_modified" => "2011-01-10", - "authors" => ["arthur_reutenauer", "mojca_miklavec"], - "licence" => "public-ask", # TODO - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,1], - "encoding" => nil, # no patterns for 8-bit engines - "exceptions" => false, - "message" => "Pan-Ethiopic hyphenation patterns", - "description_s" => "Hyphenation patterns for Ethiopic scripts", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for languages written using the Ethiopic script", - "for Unicode engines. They are not supposed to be linguistically", - "relevant in all cases and should, for proper typography, be replaced", - "by files tailored to individual languages.", - ], -}, -# georgian -{ - "code" => "ka", - "name" => "georgian", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1,2], - "encoding" => "t8m", - "exceptions" => false, - "message" => "Georgian hyphenation patterns", - - "version" => "0.3", - "last_modified" => "2013-04-15", - "type" => "dictionary", - "authors" => [ "levan_shoshiashvili" ], - "licence" => "LPPL", - "description_s" => "Georgian hyphenation patterns", - "description_l" => [ - #......................................................................# - "Hyphenation patterns for Georgian in T8M, T8K and UTF-8 encodings.", - ], -}, -# Church Slavonic -{ - "code" => "cu", - "name" => "churchslavonic", - "use_new_loader" => true, - "hyphenmin" => [1, 2], - "encoding" => nil, - "exceptions" => true, - "message" => "Church Slavonic hyphenation patterns", - - "version" => nil, - "last_modified" => "2016-04-16", - "type" => "machine learning", - "authors" => ["mike_kroutikov", "aleksandr_andreev"], - "licence" => "MIT", - "description_s" => "Church Slavonic hyphenation patterns", - "description_l" => [ - "Hyphenation patterns for Church Slavonic in UTF-8 encoding", - ], -}, -# Belarusian -{ - "code" => "be", - "name" => "belarusian", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [2,2], - "encoding" => "t2a", - "message" => "Belarusian hyphenation patterns", - - "version" => nil, - "last_modified" => "2016-09-29", - "type" => "rules", - "authors" => ["maksim_salau"], - "licence" => "MIT", - "description_s" => "Belarusian hyphenation patterns", - "description_l" => [ - "Belarusian hyphenation patterns in T2A and UTF-8 encodings" - ], -}, -# Pali -{ - "code" => "pi", - "name" => "pali", - "use_new_loader" => true, - "use_old_patterns" => false, - "hyphenmin" => [1, 2], - # no encoding - "message" => "Pali hyphenation patterns", - # no version number - "last_modified" => "2018-06-29", - "type" => "rules", - "authors" => ["wie_ming_ang"], - "licence" => "MIT", - "description_s" => "Pali hyphenation patterns", - "description_l" => [ - "Pali hyphenation patterns in UTF-8 encoding", - ], -}, -# dumylang -> dumyhyph.tex -# nohyphenation -> zerohyph.tex -# arabic -> zerohyph.tex -# farsi zerohyph.tex -# =persian - ] - - # TODO: do not hardcode this list; auto-generate it instead - languages_with_quotes = ['af', 'be', 'fr', 'fur', 'it', 'oc', 'pms', 'rm', 'uk', 'zh-latn-pinyin'] - languages_with_dashes = ['af', 'be', 'pt', 'ru', 'tk', 'uk'] - - languages.each do |l| - language = Language.new(l) - if languages_with_quotes.include?(language.code) then - language.set_quotes() + def extract_characters + characters = Array.new + + characters_indexes = patterns.join.gsub(/[.0-9]/,'').unpack('U*').sort.uniq + characters_indexes.each do |c| + ch = [c].pack('U') + characters << ch + Unicode.upcase(ch) + characters << "’’" if ch == "'" && !isgreek? end - if languages_with_dashes.include?(language.code) then - language.set_dashes() + + characters + end + end + + def list_synonyms + # synonyms + if synonyms && synonyms.length > 0 + sprintf " synonyms=%s", synonyms.join(',') + else + '' + end + end + + def list_hyphenmins + # lefthyphenmin/righthyphenmin + lmin = (hyphenmin || [])[0] + rmin = (hyphenmin || [])[1] + sprintf "lefthyphenmin=%s \\\n\trighthyphenmin=%s", lmin, rmin + end + + def list_loader + # which loader to use + file = sprintf "file=%s", loadhyph + return file unless use_old_loader + + if ['ar', 'fa'].include? code + file = file + " \\\n\tfile_patterns=" + elsif code == 'grc-x-ibycus' + # TODO: fix this + file = file + " \\\n\tluaspecial=\"disabled:8-bit only\"" + end + end + + + def list_run_files + return [] if use_old_loader + + files = [] + + files << File.join(PATH::HYPHU8, 'loadhyph', loadhyph) + if has_apostrophes + files << File.join(PATH::HYPHU8, 'patterns', 'quote', sprintf("hyph-quote-%s.tex", code)) + end + + files << File.join(PATH::HYPHU8, 'patterns', 'tex', sprintf('hyph-%s.tex', code)) + if encoding && encoding != "ascii" then + files << File.join(PATH::HYPHU8, 'patterns', 'ptex', sprintf('hyph-%s.%s.tex', code, encoding)) + elsif code == "cop" + files << File.join(PATH::HYPHU8, 'patterns', 'tex-8bit', filename_old_patterns) + end + + # we skip the mongolian language for luatex files + return files if code == "mn-cyrl-x-lmc" + + ['chr', 'pat', 'hyp', 'lic'].each do |t| + files << File.join(PATH::HYPHU8, 'patterns', 'txt', sprintf('hyph-%s.%s.txt', code, t)) + end + + if code =~ /^sh-/ + # duplicate entries (will be removed later) + files << File.join(PATH::HYPHU8, 'patterns', 'tex', 'hyph-sr-cyrl.tex') + ['chr', 'pat', 'hyp', 'lic'].each do |t| + # duplicate entries (will be removed later) + files << File.join(PATH::HYPHU8, 'patterns', 'txt', sprintf('hyph-sr-cyrl.%s.txt', t)) end - @@list.push(language) - self[language.code] = language end + + files end +end + +module TeXLive + class Package + attr_reader :name + + def initialize(name) + @name = name + end + + @@package_mappings = { + "en-gb"=>"english", + "en-us"=>"english", + "nb"=>"norwegian", + "nn"=>"norwegian", + "de-1901"=>"german", + "de-1996"=>"german", + "de-ch-1901"=>"german", + "mn-cyrl"=>"mongolian", + "mn-cyrl-x-lmc"=>"mongolian", + "el-monoton"=>"greek", + "el-polyton"=>"greek", + "grc"=>"ancient greek", + "grc-x-ibycus"=>"ancient greek", + "zh-latn-pinyin"=>"chinese", + "as"=>"indic", + "bn"=>"indic", + "gu"=>"indic", + "hi"=>"indic", + "kn"=>"indic", + "ml"=>"indic", + "mr"=>"indic", + "or"=>"indic", + "pa"=>"indic", + "ta"=>"indic", + "te"=>"indic", + "sh-latn"=>"serbian", + "sh-cyrl"=>"serbian", + "la"=>"latin", + "la-x-classic"=>"latin", + "la-x-liturgic"=>"latin" + } + + def self.make_mappings + @@package_names = @@package_mappings.values.uniq.map do |package_name| + [package_name, new(package_name)] + end.to_h + + # a hash with the names of TeX Live packages, either individual language names, + # or an array of languages as the value + @@packages = Hash.new + Language.all.each do |language| + package_name = @@package_mappings[language.code] + next if !package_name && @@package_names.include?(language.name) + package_name ||= language.name + package = @@package_names[package_name] || new(package_name) + + (@@packages[package] ||= []) << language + end + + @@packages + end + + @@packages = make_mappings + def self.all + @@packages.keys + end + + # FIXME That’s oh-so-awful + def description_s + return 'Hyphenation patterns for Ethiopic scripts' if @name == 'ethiopic' + + if @name == 'arabic' + leader = '(No) Arabic' + elsif @name == 'farsi' + leader = '(No) Persian' + elsif @name == 'greek' + leader = 'Modern Greek' + elsif @name == 'chinese' + leader = 'Chinese pinyin' + elsif @name == 'norwegian' + leader = 'Norwegian Bokmal and Nynorsk' + else + leader = @name.titlecase + end + + shortdesc = sprintf '%s hyphenation patterns', leader + + shortdesc += ' in Cyrillic script' if @name == 'mongolian' - def list - return @@list + shortdesc + end + + # FIXME This should be at package level from the start + def description_l + languages.inject([]) do |description, language| + description + if language.description_l then language.description_l else [] end + end + end + + def languages + @languages ||= @@packages[self] + end + + def has_dependency? + { + "german" => "dehyph", + # for Russian and Ukrainian (until we implement the new functionality at least) + "russian" => "ruhyphen", + "ukrainian" => "ukrhyph", + }[name] + end + + def list_dependencies + dependencies = [ + "depend hyphen-base", + "depend hyph-utf8", + ] + + # external dependencies + if dependency = has_dependency? + dependencies << sprintf("depend %s", dependency) + end + + dependencies + end + + @@special_support = { + 'doc' => { + 'greek' => 'doc/generic/elhyphen', + 'hungarian' => 'doc/generic/huhyphen', + } + } + + def list_support_files(type) + # Cache directory contents + (@dirlist ||= { })[type] ||= Dir.glob(File.expand_path(sprintf('../../../../%s/generic/hyph-utf8/languages/*', type), __FILE__)).select do |file| + File.directory?(file) + end.map do |dir| + dir.gsub /^.*\//, '' + end + + files = (languages.map(&:code) & @dirlist[type]).map do |code| + sprintf("%s/generic/hyph-utf8/languages/%s", type, code) + end + + if special = @@special_support.dig(type, name) + files << special + end + + files + end + + def list_run_files + files = [] + files << "tex/generic/hyph-utf8/patterns/tex/hyph-no.tex" if name == "norwegian" + + files = languages.inject(files) do |files, language| + files + language.list_run_files + end + + unless has_dependency? + languages.each do |language| + if language.use_old_patterns and language.filename_old_patterns != "zerohyph.tex" and language.code != 'cop' + files << sprintf("tex/generic/hyphen/%s", language.filename_old_patterns) + end + end + end + + files + end + + def <=>(other) + name <=> other.name + end + + # FIXME Change later + def find(name) + @@package_names[self] + end end end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/languages/gl/glpatter-utf8.tex b/Master/texmf-dist/source/generic/hyph-utf8/languages/gl/glpatter-utf8.tex index 16126bbbcc5..4b116eede45 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/languages/gl/glpatter-utf8.tex +++ b/Master/texmf-dist/source/generic/hyph-utf8/languages/gl/glpatter-utf8.tex @@ -47,22 +47,28 @@ % and do not apply to this file. \expandafter\let\expandafter\lee\csname ~~lee\endcsname \keepcomments -% This is the file hyph-gl.tex, version 2.4 -% Hyphenation patterns for Galician, written in the utf8 encoding. +% title: Hyphenation patterns for Galician, written in the utf8 encoding. +% copyright: (c) Javier A. Múgica; 2006, 2007, 2008, 2010 +% notice: This file is part of the hyph-utf8 package. +% See http://www.hyphenation.org for more information. +% language: +% name: Galician +% tag: gl +% licence: +% name: LPPL +% version: 1.3 +% status: maintained +% maintainer: Javier A. Múgica +% url: https://latex-project.org/lppl/lppl-1-3.html % +% ========================================== % Generated with the mkpattern utility (v. 1.2), on 2010/04/23 % The original source file were glpatter-utf8.tex % This is a generated file % -% (c) Javier A. Múgica; 2006, 2007, 2008, 2010 -% License: LPPL version 1.3 -% -% LPPL maintenance status: maintained -% Current Maintainer: Javier A. Múgica -% -% For bug reports and comments: +% For bug reports and comments: % -% Javier Múgica, javier at digi21.eu +% Javier Múgica, javier at digi21.eu \let\lee\relax \halfcomments \iwrite{%} diff --git a/Master/texmf-dist/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua b/Master/texmf-dist/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua index 607c7270bbb..e3a13e19075 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua +++ b/Master/texmf-dist/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua @@ -1,13 +1,53 @@ #!/usr/bin/env texlua -- Extract Ethiopic syllables from the Unicode Character Database. --- Arthur Reutenauer, London, 2011, for the hyph-utf8 project --- http://tug.org/tex-hyphen --- Copyright (c) TeX Users Group, 2011. --- You may freely use, copy, modify and / or redistribute this file. +-- Copyright (c) 2011, 2016 Arthur Reutenauer +-- http://www.hyphenation.org/ +-- === Text of the MIT licence === +-- This file is available under the terms of the MIT licence. +-- Permission is hereby granted, free of charge, to any person obtaining a copy +-- of this software and associated documentation files (the “Software”), to deal +-- in the Software without restriction, including without limitation the rights to +-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +-- of the Software, and to permit persons to whom the Software is furnished to do +-- so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in all +-- copies or substantial portions of the Software. +-- +-- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +-- SOFTWARE. +-- === End of MIT licence === +-- Version 0.2 2016-05-22 -- Use with TeXLua. +local function extract_mit_licence() + reading_mit_licence = false + bolicence = lpeg.P'=== Text of the MIT licence ===' + eolicence = lpeg.P'=== End of MIT licence ===' + mit_licence = { } + for line in io.lines(arg[0]) do + line = line:gsub('^%-%- ', ''):gsub('^%-%-', '') + if eolicence:match(line) then + reading_mit_licence = false + end + + if reading_mit_licence then + mit_licence[#mit_licence + 1] = line + end + + if bolicence:match(line) then + reading_mit_licence = true + end + end +end + -- Small library to convert a hexadecimal string to a number local function hex_digit_to_num(h) local c = string.byte(h) @@ -49,26 +89,48 @@ local field = (1 - colon)^0 local eth_syll = P"ETHIOPIC SYLLABLE " * C(field) local ucd_entry = C(digit^4) * colon * eth_syll -local pattfile = assert(io.open("hyph-mul-ethi.tex", "w")) +local pattfile = assert(io.open("../../../../../tex/generic/hyph-utf8/patterns/tex/hyph-mul-ethi.tex", "w")) + + +extract_mit_licence() pattfile:write[[ -% Experimental pattern file for languages written using the Ethiopic script. -% Arthur Reutenauer, London, 2011, for the hyph-utf8 project. -% Copyright (c) TeX Users Group, 2011. -% You may freely use, copy, modify and / or redistribute this file. -% +% title: Experimental pattern file for languages written using the Ethiopic script. +% copyright: Copyright (c) 2011, 2016 Arthur Reutenauer +% notice: This file is part of the hyph-utf8 package. +% See http://www.hyphenation.org for more information +% language: +% name: Multiple languages using the Ethiopic scripts +% tag: mul-ethi +% version: 0.2 2016-05-22 +% licence: +% - name: MIT +% - url: https://opensource.org/licenses/MIT +% - text: > +]] + +for _, line in ipairs(mit_licence) do + if lpeg.match(lpeg.P(-1), line) then + pattfile:write('%\n') + else + pattfile:write('% ', line, '\n') + end +end + +pattfile:write[[ +% ========================================== % This is a generated file. If you wish to edit it, consider adapting the % generating programme -% (svn://tug.org/texhyphen/trunk/hyph-utf8/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua). +% (https://github.com/hyphenation/tex-hyphen/blob/master/hyph-utf8/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua). % -% The BCP 47 language tag for that file is "mul-ethi" to reflect the fact that +% The BCP 47 language tag for that file is “mul-ethi” to reflect the fact that % it can be used by multiple languages (and a single script, Ethiopic). It is, % though, not supposed to be linguistically relevant and should, for proper % typography, be replaced by files tailored to individual languages. What we % do for the moment is to simply allow break on either sides of Ethiopic % syllables, and to forbid it before some punctuation marks particular to % the Ethiopic script (which we thus make letters for this purpose). - +% ]] pattfile:write"\\patterns{%\n" @@ -77,14 +139,10 @@ for ucd_line in io.lines(ucd_file) do -- print(string.format("%04X", usv)) -- if usv then print(usv, char_name) end if usv then - -- arbitrarily excluding Ethiopic Extended-A - -- because they're not in unicode-letters.tex local hex = hex_string_to_num(usv) - if hex < 0xAB00 then - local hex = hex_string_to_num - pattfile:write("1", unicode.utf8.char(hex_string_to_num(usv)), "1 ") - pattfile:write("% U+", usv, " ", char_name:lower(), "\n") - end + local hex = hex_string_to_num + pattfile:write("1", unicode.utf8.char(hex_string_to_num(usv)), "1 ") + pattfile:write("% U+", usv, " ", char_name:lower(), "\n") end end |