summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb')
-rwxr-xr-xMaster/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb36
1 files changed, 23 insertions, 13 deletions
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 8627427ad90..7c60c10cc7a 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
@@ -11,6 +11,7 @@ load 'languages.rb'
$path_root=File.expand_path("../../..")
$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")
$path_language_dat_lua="#{$path_root}/tex/luatex/hyph-utf8/config"
@@ -27,19 +28,11 @@ language_codes = Hash.new
languages.each do |language|
language_codes[language.code] = language.code
end
-# language_codes['de-1901'] = 'de-1901'
-# language_codes['de-1996'] = 'de-1996'
-# language_codes['de-ch-1901'] = 'de-CH-1901'
-# language_codes['en-gb'] = 'en-GB'
-# language_codes['en-us'] = 'en-US'
-# language_codes['zh-latn'] = 'zh-Latn'
-# language_codes['el-monoton'] = 'el-monoton'
-# language_codes['el-polyton'] = 'el-polyton'
-# language_codes['mn-cyrl'] = 'mn'
+
language_codes['mn-cyrl-x-lmc'] = nil
-language_codes['sh-latn'] = 'sr-latn'
-language_codes['sh-cyrl'] = nil
-# language_codes['sr-cyrl'] = 'sr-Cyrl'
+# 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"
@@ -70,6 +63,7 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language|
patterns = language.get_patterns
exceptions = language.get_exceptions
+ patterns_quote = Array.new
if code == 'nn' or code == 'nb'
patterns = ""
@@ -80,7 +74,14 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language|
# patterns
patterns.each do |pattern|
- $file_pat.puts pattern.gsub(/'/,"’")
+ $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 != ""
@@ -90,6 +91,9 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language|
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
end
# licence and readme
$file_inf.puts "#{language.message}\n\n(more info about the licence to be added later)\n\n"
@@ -100,6 +104,12 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language|
$file_let.close
$file_inf.close
+ 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
+
# $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}\","