diff options
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/lib')
6 files changed, 19 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/converter.rb b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/converter.rb index 3b966d45a40..d270767c1b8 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/converter.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/converter.rb @@ -1,18 +1,22 @@ # encoding: UTF-8 -require 'scanf' -require 'byebug' - module TeX module Hyphen class Converter + def self.scan_line(line) + m = line.match /^(0x\h{2})\tU\+(\h{4})(?:\t(1?)(?:\t(\w+)))?$/ + return nil unless m + + return m[1].to_i(16), m[2].to_i(16).chr(Encoding::UTF_8), m[3].to_i, m[4] + end + def read(conversion) @mapping = { } File.read(conversion).each_line do |line| next if line =~ /^#/ - eightbit, usv = line.scanf "0x%02X\tU+%04X" - @mapping[eightbit] = usv.chr(Encoding::UTF_8) + eightbit, usv = Converter.scan_line line + @mapping[eightbit] = usv.chr end end @@ -28,7 +32,6 @@ module TeX if doconvert puts (line.strip.each_byte.map do |byte| - byebug unless @mapping[byte] @mapping[byte] end || '').join end diff --git a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/language.rb b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/language.rb index 3d3437d74b5..df6daa39478 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/language.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/language.rb @@ -1,6 +1,5 @@ require 'yaml' require 'hydra' -require 'byebug' unless ENV['RACK_ENV'] == "production" require_relative 'path' @@ -277,7 +276,6 @@ module TeX @exceptions = readtexfile.superstrip.gsub(/.*\\hyphenation\s*\{(.*?)\}.*/m,'\1').supersplit if @exceptions != "" @hyphenation = @exceptions.inject [] do |exceptions, exception| - # byebug unless exception exceptions << [exception.gsub('-', ''), exception] end.to_h else @@ -298,7 +296,6 @@ module TeX unless @hydra begin - # byebug metadata = extract_metadata @hydra = Hydra.new patterns, :lax, '', metadata rescue InvalidMetadata diff --git a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/packages.yml b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/packages.yml index bc029739388..68a70fea0ed 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/packages.yml +++ b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/packages.yml @@ -1,3 +1,8 @@ +finish: + description: + Hyphenation patterns for Finnish in T1 and UTF-8 encodings. + The older set, labelled just “fi”, tries to implement etymological rules, + while the newer ones (fi-x-school) implements the simpler rules taught at Finnish school. german: dependency: dehyph description: |- diff --git a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/loader.rb b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/loader.rb index 878bf0ef0d3..1efcb1ee4bf 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/loader.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/loader.rb @@ -4,7 +4,7 @@ module TeX module Loader def unicode_only? # TODO Spec out - ['cu', 'sa','as','bn','gu','hi','hy','kn','lo','mul-ethi','ml','mr','or','pa','ta','te', 'pi', 'mk'].include? @bcp47 + ['cu', 'sa','as','bn','gu','hi','hy','kn','lo','mul-ethi','ml','mr','or','pa','ta','te', 'pi'].include? @bcp47 end def string_enc @@ -143,7 +143,6 @@ module TeX end end - byebug unless specification.is_a? Hash comment = specification[:comment] message = specification[:message] if comment then [sprintf('%% %s', comment)] else [] end + diff --git a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/package.rb b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/package.rb index 1d40dc512e8..3de7d69805e 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/package.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/package.rb @@ -104,7 +104,7 @@ module TeX unless has_dependency? languages.each do |language| if language.use_old_patterns_comment and language.legacy_patterns != "zerohyph.tex" and language.bcp47 != 'cop' - if language.bcp47 == 'la-x-classic' + if ['la-x-classic', 'mk'].include? language.bcp47 # FIXME. Yes, fix it ;-) files << sprintf("tex/generic/hyph-utf8/patterns/tex-8bit/%s", language.legacy_patterns) else files << sprintf("tex/generic/hyphen/%s", language.legacy_patterns) diff --git a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/source.rb b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/source.rb index dce5be00b41..172b9b0a60b 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/source.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/lib/tex/hyphen/texlive/source.rb @@ -82,9 +82,10 @@ module TeX end files << File.join(PATH::HYPHU8, 'patterns', 'tex', sprintf('hyph-%s.tex', bcp47)) - if encoding && encoding != "ascii" && bcp47 != 'la-x-classic' then + # FIXME That line is awful -- AR 2020-11-22 + if encoding && encoding != "ascii" && !['la-x-classic', 'mk'].include?( bcp47) then files << File.join(PATH::HYPHU8, 'patterns', 'ptex', sprintf('hyph-%s.%s.tex', bcp47, encoding)) - elsif bcp47 == "cop" + elsif ['cop', 'mk'].include? bcp47 # FIXME That one too! files << File.join(PATH::HYPHU8, 'patterns', 'tex-8bit', legacy_patterns) end |