diff options
author | Mojca Miklavec <mojca.miklavec@gmail.com> | 2016-05-14 08:45:44 +0000 |
---|---|---|
committer | Mojca Miklavec <mojca.miklavec@gmail.com> | 2016-05-14 08:45:44 +0000 |
commit | db6eac672fdcc9511aefe04128beeba23aa771fe (patch) | |
tree | 0e5540950c6549e66b06d0515cb3eb7c9b56648c /Master/texmf-dist/source/generic | |
parent | dbdff71511ec691b32ba830bee926f80db90c473 (diff) |
update hyph-utf8
* new Church Slavonic patterns (now in collection-langcyrillic)
* new Liturgical Latin patterns (for Gregorio)
* righthyphenmin for French set to 2
* some licence changes
git-svn-id: svn://tug.org/texlive/trunk@41113 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic')
5 files changed, 171 insertions, 34 deletions
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 78eaee9ba1e..111395acd49 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 @@ -7,7 +7,6 @@ load 'languages.rb' $package_name="hyph-utf8" - # TODO - make this a bit less hard-coded $path_tex_generic=File.expand_path("../../../tex/generic") $path_loadhyph="#{$path_tex_generic}/#{$package_name}/loadhyph" @@ -78,21 +77,19 @@ text_patterns_utf8 = text_patterns text_patterns_quote = " \\input hyph-quote-#{language.code}.tex" -list_languages_with_quotes = ['af', 'fr', 'fur', 'it', 'oc', 'pms', 'rm', 'uk', 'zh-latn-pinyin'] - ########### # lccodes # ########### lccodes_common = [] -if list_languages_with_quotes.include?(language.code) +if language.has_quotes then lccodes_common.push("\\lccode`\\'=`\\'") end -if ['af', 'pt', 'ru', 'tk', 'uk'].include?(language.code) +if language.has_dashes then lccodes_common.push("\\lccode`\\-=`\\-") end -if ['sh-latn', 'sh-cyrl'].include?(language.code) +if ['sh-latn', 'sh-cyrl'].include?(language.code) then text_patterns_utf8 = [" \\input hyph-sh-latn.tex", " \\input hyph-sh-cyrl.tex"] text_engine_utf8 = [" #{comment_engine_utf8}", @@ -121,11 +118,11 @@ end ######################################## # GROUP nr. 1 - ONLY USABLE WITH UTF-8 # ######################################## - # some special cases firs + # some special cases first # # some languages (sanskrit) are useless in 8-bit engines; we only want to load them for UTF engines # TODO - maybe consider doing something similar for ibycus - if ['sa','as','bn','gu','hi','hy','kn','lo','mul-ethi','ml','mr','or','pa','ta','te'].include?(language.code) then + if ['cu', 'sa','as','bn','gu','hi','hy','kn','lo','mul-ethi','ml','mr','or','pa','ta','te'].include?(language.code) then file.puts(text_if_native_utf) file.puts(text_engine_utf8) # lccodes @@ -133,6 +130,12 @@ end file.puts(' % Set \lccode for Ethiopian word space.') file.puts(' \lccode"1361="1361') file.puts(' \lccode"1362="1362') + elsif language.code == "cu" then + file.puts(' % fix lccodes for some characters (they were recently included in Unicode)') + file.puts(' \lccode"1C82="1C82 % sharp o in lowercase "uk"') + ['1DF6', '1DF7', '1DF8', '1DF9', 'A69E', '1C86', 'A67E', 'FE2E', 'FE2F'].each do |l| + file.puts(" \\lccode\"#{l}=\"#{l}") + end elsif language.code != 'lo' then file.puts(' % Set \lccode for ZWNJ and ZWJ.') file.puts(' \lccode"200C="200C') @@ -209,13 +212,17 @@ end file.puts(text_if_native_utf) file.puts(text_engine_utf8) file.puts(text_patterns_utf8) - if list_languages_with_quotes.include?(language.code) + if language.has_quotes file.puts(text_patterns_quote) end file.puts('\else') file.puts(text_engine_8bit) - file.puts(text_patterns_conv) - file.puts(text_patterns) + if ['la-x-liturgic'].include?(language.code) then + file.puts(text_patterns_ptex) + else + file.puts(text_patterns_conv) + file.puts(text_patterns) + end file.puts('\fi\else') file.puts(text_engine_ptex) file.puts(text_patterns_ptex) 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 e38d725f510..3c468b6eb95 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 @@ -82,7 +82,9 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language| file_ptex.puts("\\bgroup") # setting lccodes for letters characters.each do |c| - if c >= 128 then + if (c == 0x01FD or c == 0x0301) and language.code == 'la-x-liturgic' + # skip + elsif c >= 128 then code = encoding.unicode_characters[c].code_enc file_ptex.puts sprintf("\\lccode\"%02X=\"%02X", code, code) 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 f1b4f89193c..6bf7dd3758b 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 @@ -1,8 +1,9 @@ #!/usr/bin/env ruby +# encoding: utf-8 -load 'languages.rb' +# this file auto-generates tlpsrc files for hyphenation patterns - to be improved -# this file auto-generates loaders for hyphenation patterns - to be improved +load 'languages.rb' $package_name="hyph-utf8" @@ -29,7 +30,7 @@ language_grouping = { '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'], + 'latin' => ['la', 'la-x-classic', 'la-x-liturgic'], } language_used_in_group = Hash.new @@ -80,6 +81,10 @@ end # 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" @@ -93,6 +98,8 @@ language_groups.sort.each do |language_name,language_list| $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 @@ -128,15 +135,45 @@ language_groups.sort.each do |language_name,language_list| file_exceptions = "" if language.use_new_loader then file = "file=loadhyph-#{language.code}.tex" - # we skip the mongolian language - if language.code != "mn-cyrl-x-lmc" then + 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 + # check for existance of patterns and exceptions if !File::exists?( "#{$path_txt}/#{filename_pat}" ) then puts "some problem with #{$path_txt}/#{filename_pat}!!!" @@ -177,25 +214,42 @@ language_groups.sort.each do |language_name,language_list| 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 - $file_tlpsrc.puts 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 - $file_tlpsrc.puts "runpattern f texmf-dist/tex/generic/hyphen/#{language.filename_old_patterns}" + files_run.push("tex/generic/hyphen/#{language.filename_old_patterns}") end end end + + # documeentation if language_name == "greek" then - $file_tlpsrc.puts - $file_tlpsrc.puts "docpattern d texmf-dist/doc/generic/elhyphen" + files_doc.push("doc/generic/elhyphen") elsif language_name == "hungarian" then - $file_tlpsrc.puts - $file_tlpsrc.puts "docpattern d texmf-dist/doc/generic/huhyphen" + files_doc.push("doc/generic/huhyphen") elsif language_name == "german" then - $file_tlpsrc.puts - $file_tlpsrc.puts "runpattern f texmf-dist/tex/generic/hyphen/dehyphtex.tex" - $file_tlpsrc.puts "runpattern f texmf-dist/tex/generic/hyphen/ghyphen.README" + files_run.push("tex/generic/hyphen/dehyphtex.tex") + files_run.push("tex/generic/hyphen/ghyphen.README") + 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}" + end + files_run.sort.uniq.each do |f| + $file_tlpsrc.puts "runpattern f texmf-dist/#{f}" end $file_tlpsrc.close end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb b/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb index bf224f7cdc3..6e197e2fa73 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb @@ -54,6 +54,7 @@ class HyphEncoding attr_reader :encoding_name, :unicode_characters, :unicode_characters_first_byte, :lowercase_characters def convert_string_to_escaped_characters(str) + skip_this_string = false characters = str.unpack('U*') new_string = Array.new(characters.length) characters.each_index do |i| @@ -65,6 +66,9 @@ class HyphEncoding new_string[i] = [c].pack('U') elsif c == 8217 # ’ new_string[i] = "'" + elsif (c == 0x01FD or c == 0x0301) and @encoding_name == 'ec' + skip_this_string = true + new_string[i] = sprintf("[U+%04X]", c) else puts sprintf("There must be an error: character U+%04X in string '%s' is not ASCII or %s.", c, str, @encoding_name.upcase) end @@ -73,6 +77,9 @@ class HyphEncoding new_string[i] = sprintf("^^%x", uc.code_enc) end end + if skip_this_string + new_string.unshift("% ") + end return new_string.join('') end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/languages.rb b/Master/texmf-dist/source/generic/hyph-utf8/languages.rb index bf91035d29b..fe24933721d 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/languages.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/languages.rb @@ -37,9 +37,20 @@ class Language @licence = language_hash["licence"] @authors = language_hash["authors"] + @has_quotes = false + @has_dashes = false + if @synonyms==nil then @synonyms = [] end end + def set_quotes + @has_quotes = true + end + + def set_dashes + @has_dashes = true + end + # TODO: simplify this (reduce duplication) def get_exceptions @@ -113,6 +124,7 @@ class Language attr_reader :code, :name, :synonyms, :hyphenmin, :encoding, :exceptions, :message attr_reader :description_s, :description_l, :version attr_reader :licence, :authors + attr_reader :has_quotes, :has_dashes # this hack is needed for Serbian attr_writer :code end @@ -205,6 +217,8 @@ class Authors < Hash # 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], } # authors.each do |a| @@ -828,18 +842,17 @@ class Languages < Hash "use_new_loader" => true, "use_old_patterns" => false, "filename_old_patterns" => "frhyph.tex", - "hyphenmin" => [2,3], + "hyphenmin" => [2,2], "encoding" => "ec", "exceptions" => false, - "message" => "French hyphenation patterns (V2.12, 2002/12/11)", + "message" => "French hyphenation patterns", - "version" => "2.12", - "last_modified" => "2002-12-11", + "version" => "2.13", + "last_modified" => "2016-05-12", "type" => "rules", - "authors" => ["rene_bastian", "daniel_flipo", "bernard_gaulle"], - # TODO for Arthur: recreate mailing-list - # "email" => ["cesure-l{at}gutenberg{dot}eu{dot}org"], - "licence" => "other-free", # Knuthian type + "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" => [ #......................................................................# @@ -1268,6 +1281,30 @@ class Languages < Hash "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.030", + "last_modified" => "2016-04-28", + "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", @@ -2071,6 +2108,26 @@ class Languages < Hash "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", + ], +} # dumylang -> dumyhyph.tex # nohyphenation -> zerohyph.tex # arabic -> zerohyph.tex @@ -2078,8 +2135,18 @@ class Languages < Hash # =persian ] + # TODO: do not hardcode this list; auto-generate it instead + languages_with_quotes = ['af', 'fr', 'fur', 'it', 'oc', 'pms', 'rm', 'uk', 'zh-latn-pinyin'] + languages_with_dashes = ['af', 'pt', 'ru', 'tk', 'uk'] + languages.each do |l| language = Language.new(l) + if languages_with_quotes.include?(language.code) then + language.set_quotes() + end + if languages_with_dashes.include?(language.code) then + language.set_dashes() + end @@list.push(language) self[language.code] = language end |