diff options
Diffstat (limited to 'tex')
6 files changed, 135 insertions, 105 deletions
diff --git a/tex/context/third/transliterator/t-transliterator.mkiv b/tex/context/third/transliterator/t-transliterator.mkiv index ef8c15e..b4a3c86 100644 --- a/tex/context/third/transliterator/t-transliterator.mkiv +++ b/tex/context/third/transliterator/t-transliterator.mkiv @@ -54,7 +54,7 @@ translit.debug_count = 0 %D We want to keep track of all the tables we'll create so we put them into %D a separate dictionary accompanied by a description string. \startluacode -translit.tables = {} +translit.tables = translit.tables or {} \stopluacode @@ -96,6 +96,35 @@ translit.ru_consonants = {"б", "в", "г", "д", "ж", "з", "к", "л", "м", %D and %D trans_tables_trsc.lua.} +%D Metatables allow for easy concatenation. +\startluacode + +do + -- This returns the Union of both key sets for the “+” operator. + -- The values of the first table will be updated (read: overridden) by those given in the second. + local Dict_add = { + __add = function (dict_a, dict_b) + assert (type(dict_a) == "table" and type(dict_b) == "table") + local dict_result = setmetatable({}, Dict_add) + + for key, val in pairs(dict_a) do + dict_result[key] = val + end + + for key, val in pairs(dict_b) do + dict_result[key] = val + end + return dict_result + end + } + + function translit.make_add_dict(dict) + return setmetatable(dict, Dict_add) + end +end + +\stopluacode + %D The function \type{translit.subst(s, t)} is used to replace any key of %D \type{t} that occurs in \type{s} with the according value of \type{t}. @@ -116,14 +145,20 @@ end \startluacode -function translit.add_table (t, ...) - for _,tab in ipairs(arg) do - for key, value in pairs (tab) do - t[key] = value - end - end - return t -end +--function translit.add_table (...) + --print ("---------------HERE---------------") + --print (type(arg) .. ", Länge: " .. #arg) + --local t = translit.make_add_dict{} + --local cnt = 0 + --for _, tab in pairs(arg) do + --cnt=cnt+1 + --print(cnt .. " - " .. type(tab)) + --t = t + tab + --end + --print(cnt) + --for i,j in pairs(t) do print (i,j) end + --return t +--end \stopluacode %D We might want to have all the table data nicely formatted by \CONTEXT\ diff --git a/tex/context/third/transliterator/trans_tables_glag.lua b/tex/context/third/transliterator/trans_tables_glag.lua index 1b1ff18..e6aea13 100644 --- a/tex/context/third/transliterator/trans_tables_glag.lua +++ b/tex/context/third/transliterator/trans_tables_glag.lua @@ -7,7 +7,7 @@ -- Lowercase Glagolitic Transliteration -- ------------------------------------------- -translit.ocs_gla_low = { +translit.ocs_gla_low = translit.make_add_dict{ ["ⰰ"] = "a", -- GLAGOLITIC SMALL LETTER AZU ["ⰱ"] = "b", -- GLAGOLITIC SMALL LETTER BUKY ["ⰲ"] = "v", -- GLAGOLITIC SMALL LETTER VEDE @@ -63,7 +63,7 @@ translit.tables["Glagolica transliteration for OCS lowercase"] = translit.ocs_gl -- Uppercase (?!) Glagolitic Transliteration -- ------------------------------------------------ -translit.ocs_gla_upp = { +translit.ocs_gla_upp = translit.make_add_dict{ ["Ⰰ"] = "A", -- GLAGOLITIC CAPITAL LETTER AZU ["Ⰱ"] = "B", -- GLAGOLITIC CAPITAL LETTER BUKY ["Ⰲ"] = "V", -- GLAGOLITIC CAPITAL LETTER VEDE diff --git a/tex/context/third/transliterator/trans_tables_gr.lua b/tex/context/third/transliterator/trans_tables_gr.lua index 7ce6855..bed775a 100644 --- a/tex/context/third/transliterator/trans_tables_gr.lua +++ b/tex/context/third/transliterator/trans_tables_gr.lua @@ -16,7 +16,7 @@ -- Lowercase Greek Initial Position Diphthongs -- ------------------------------------------------- -translit.gr_di_in_low = { +translit.gr_di_in_low = translit.make_add_dict{ [" αὑ"] = " hau", [" αὕ"] = " hau", [" αὓ"] = " hau", @@ -45,7 +45,7 @@ translit.tables["Greek transliteration initial breathing diphthongs lowercase"] -- Uppercase Greek Initial Position Diphthongs -- ------------------------------------------------- -translit.gr_di_in_upp = { +translit.gr_di_in_upp = translit.make_add_dict{ [" Αὑ"] = " Hau", [" Αὕ"] = " Hau", [" Αὓ"] = " Hau", @@ -74,7 +74,7 @@ translit.tables["Greek transliteration initial breathing diphthongs uppercase"] -- Lowercase Greek Initial Position -- --------------------------------------- -translit.gr_in_low = { +translit.gr_in_low = translit.make_add_dict{ [" ἁ"] = " ha", [" ἅ"] = " ha", [" ἃ"] = " ha", @@ -121,7 +121,7 @@ translit.tables["Greek transliteration initial breathing lowercase"] = translit. -- Uppercase Greek Initial Position -- --------------------------------------- -translit.gr_in_upp = { +translit.gr_in_upp = translit.make_add_dict{ [" Ἁ"] = " Ha", [" Ἅ"] = " Ha", [" Ἃ"] = " Ha", @@ -168,7 +168,7 @@ translit.tables["Greek transliteration initial breathing uppercase"] = translit. -- Lowercase Greek Diphthongs -- --------------------------------- -translit.gr_di_low = { +translit.gr_di_low = translit.make_add_dict{ ["αυ"] = "au", ["αύ"] = "au", ["αὺ"] = "au", @@ -240,7 +240,7 @@ translit.tables["Greek transliteration diphthongs lowercase"] = translit.gr_in_l -- Uppercase Greek Diphthongs -- --------------------------------- -translit.gr_di_upp = { +translit.gr_di_upp = translit.make_add_dict{ ["Αυ"] = "Au", ["Αύ"] = "Au", ["Αὺ"] = "Au", @@ -309,7 +309,7 @@ translit.tables["Greek transliteration diphthongs uppercase"] = translit.gr_in_u -- The following will be used in an option that ensures transcription of -- nasalization, e.g. Ἁγχίσης -> “Anchises” (instead of “Agchises”) -translit.gr_nrule = { +translit.gr_nrule = translit.make_add_dict{ ["γγ"] = "ng", ["γκ"] = "nk", ["γξ"] = "nx", @@ -323,7 +323,7 @@ translit.tables["Greek transliteration optional nasalization"] = translit.gr_nru -- Lowercase Greek Transliteration -- -------------------------------------- -translit.gr_low = { +translit.gr_low = translit.make_add_dict{ ["α"] = "a", ["ά"] = "a", ["ὰ"] = "a", @@ -475,7 +475,7 @@ translit.tables["Greek transliteration lowercase"] = translit.gr_low -- Uppercase Greek Transliteration -- -------------------------------------- -translit.gr_upp = { +translit.gr_upp = translit.make_add_dict{ ["Α"] = "A", ["Ά"] = "A", ["Ὰ"] = "A", @@ -627,7 +627,7 @@ translit.tables["Greek transliteration uppercase"] = translit.gr_upp -- Varia -- ------------ -translit.gr_other = { +translit.gr_other = translit.make_add_dict{ ["ϝ"] = "w", ["Ϝ"] = "W", ["ϙ"] = "q", @@ -664,13 +664,13 @@ function translit.dogreek (mode, text) if mode == "gr" or mode == "gr_n" then - local gr_di_in, gr_in, gr_di, gr = {}, {}, {}, {} - gr_di_in = translit.add_table( gr_di_in, translit.gr_di_in_low, translit.gr_di_in_upp ) - gr_in = translit.add_table( gr_in, translit.gr_in_low, translit.gr_in_upp ) - gr_di = translit.add_table( gr_di, translit.gr_di_low, translit.gr_di_upp ) - gr = translit.add_table( gr, translit.gr_low, translit.gr_upp , translit.gr_other) + local gr_di_in, gr_in, gr_di, gr = translit.make_add_dict{}, translit.make_add_dict{}, translit.make_add_dict{}, translit.make_add_dict{} + gr_di_in = gr_di_in + translit.gr_di_in_low + translit.gr_di_in_upp + gr_in = gr_in + translit.gr_in_low + translit.gr_in_upp + gr_di = gr_di + translit.gr_di_low + translit.gr_di_upp + gr = gr + translit.gr_low + translit.gr_upp + translit.gr_other - if mode == "gr_n" then gr_di = translit.add_table( gr_di, translit.gr_nrule ) end + if mode == "gr_n" then gr_di = gr_di + translit.gr_nrule end local p_di_in, p_in, p_di, p diff --git a/tex/context/third/transliterator/trans_tables_iso9.lua b/tex/context/third/transliterator/trans_tables_iso9.lua index 4518466..e5fa980 100644 --- a/tex/context/third/transliterator/trans_tables_iso9.lua +++ b/tex/context/third/transliterator/trans_tables_iso9.lua @@ -1,3 +1,4 @@ +translit.tables = translit.tables or {} --===========================================================================-- -- ISO 9.1995(E) standardized transliteration for cyrillic -- @@ -6,7 +7,7 @@ ----------------------------------------- -- Lowercase russian cyrillic alphabet -- ----------------------------------------- -translit.ru_low = { +translit.ru_low = translit.make_add_dict({ ["а"] = "a", -- U+0430 -> U+0061 ["б"] = "b", -- U+0431 -> U+0062 ["в"] = "v", -- U+0432 -> U+0076 @@ -40,7 +41,7 @@ translit.ru_low = { ["э"] = "è", -- U+044d -> U+00e8 ["ю"] = "û", -- U+044e -> U+00fb ["я"] = "â" -- U+044f -> U+00e2 -} +}) translit.tables["russian lowercase ISO~9"] = translit.ru_low @@ -48,7 +49,7 @@ translit.tables["russian lowercase ISO~9"] = translit.ru_low -- Uppercase russian cyrillic alphabet -- ----------------------------------------- -translit.ru_upp = { +translit.ru_upp = translit.make_add_dict({ ["А"] = "A", -- U+0410 -> U+0041 ["Б"] = "B", -- U+0411 -> U+0042 ["В"] = "V", -- U+0412 -> U+0056 @@ -82,7 +83,7 @@ translit.ru_upp = { ["Э"] = "È", -- U+042d -> U+00c8 ["Ю"] = "Û", -- U+042e -> U+00db ["Я"] = "Â" -- U+042f -> U+00c2 -} +}) translit.tables["russian uppercase ISO~9"] = translit.ru_upp @@ -91,7 +92,7 @@ translit.tables["russian uppercase ISO~9"] = translit.ru_upp ---------------------------------------------------------- -- cf. http://www.russportal.ru/index.php?id=oldorth.decret1917 -translit.ru_old_low = { +translit.ru_old_low = translit.make_add_dict{ ["ѣ"] = "ě", -- U+048d -> U+011b -- 2-byte ["і"] = "ì", -- U+0456 -> U+00ec -- 2-byte ["ѳ"] = "f", -- U+0473 -> U+0066 -- 2-byte @@ -100,14 +101,14 @@ translit.ru_old_low = { translit.tables["russian pre-1918 lowercase ISO~9 2 byte"] = translit.ru_old_low -translit.ru_old_upp = { +translit.ru_old_upp = translit.make_add_dict{ ["Ѣ"] = "Ě", -- U+048c -> U+011a -- 2-byte ["І"] = "Ì", -- U+0406 -> U+00cc -- 2-byte ["Ѳ"] = "F", -- U+0424 -> U+0046 -- 2-byte ["Ѵ"] = "Ỳ", -- U+0474 -> U+1ef2 -- 3-byte } -translit.ru_jer_hack = { +translit.ru_jer_hack = translit.make_add_dict{ ["ь"] = "'", ["Ь"] = "'", ["ъ"] = "''", @@ -122,7 +123,7 @@ translit.tables["russian pre-1918 uppercase ISO~9 2 byte"] = translit.ru_old_upp -- Lowercase characters from other cyrillic alphabets -- --------------------------------------------------------- -translit.non_ru_low = { +translit.non_ru_low = translit.make_add_dict{ ["ӑ"] = "ă", -- U+04d1 -> U+0103 ["ӓ"] = "ä", -- U+04d3 -> U+00e4 ["ә"] = "a̋", -- u+04d9 -> U+0061+030b @@ -184,7 +185,7 @@ translit.tables["cyrillic other lowercase ISO~9"] = translit.non_ru_low -- Uppercase characters from other cyrillic alphabets -- --------------------------------------------------------- -translit.non_ru_upp = { +translit.non_ru_upp = translit.make_add_dict{ ["Ӑ"] = "Ă", -- U+04d0 -> U+0102 ["Ӓ"] = "Ä", -- U+04d2 -> U+00c4 ["Ә"] = "A̋", -- U+04d8 -> U+0041+030b @@ -241,11 +242,12 @@ translit.non_ru_upp = { ["Ӏ"] = "‡" -- U+04c0 -> U+2021 } +translit.tables["cyrillic other uppercase ISO~9"] = translit.non_ru_upp + --===========================================================================-- -- End Of Tables -- --===========================================================================-- -translit.tables["cyrillic other uppercase ISO~9"] = translit.non_ru_upp function translit.iso9 (mode, text) local P, R, S, V, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs @@ -267,30 +269,25 @@ function translit.iso9 (mode, text) return rules end - local iso9 = {} - iso9 = translit.add_table( iso9, - translit.ru_upp, - translit.ru_low - ) + local iso9 = translit.make_add_dict{} + iso9 = translit.ru_upp + translit.ru_low + if mode == "ru_old" or mode == "all" then - iso9 = translit.add_table(iso9, - translit.ru_old_upp, - translit.ru_old_low - ) + + iso9 = iso9 + translit.ru_old_upp + translit.ru_old_low + if mode == "all" then - iso9 = translit.add_table(iso9, - translit.non_ru_upp, - translit.non_ru_low - ) + iso9 = iso9 + + translit.non_ru_upp + + translit.non_ru_low end end if mode == "ru_old_jer_hack" then - iso9 = translit.add_table(iso9, - translit.ru_old_upp, - translit.ru_old_low, - translit.ru_jer_hack - ) + iso9 = iso9 + + translit.ru_old_upp + + translit.ru_old_low + + translit.ru_jer_hack end local p_iso9 diff --git a/tex/context/third/transliterator/trans_tables_scntfc.lua b/tex/context/third/transliterator/trans_tables_scntfc.lua index 9a4866b..7132fc8 100644 --- a/tex/context/third/transliterator/trans_tables_scntfc.lua +++ b/tex/context/third/transliterator/trans_tables_scntfc.lua @@ -1,3 +1,4 @@ +translit.tables = translit.tables or {} --===========================================================================-- -- Other transliterations -- @@ -17,7 +18,7 @@ -- Lowercase and uppercase letter Uk -- “scientific transliteration” -- ----------------------------------------------------------------------- -translit.ocs_uk = { +translit.ocs_uk = translit.make_add_dict{ ["oу"] = "u", ["оу"] = "u", ["Оу"] = "U", @@ -26,7 +27,7 @@ translit.ocs_uk = { -- Lowercase pre-Peter cyrillic characters -- “scientific transliteration” -- ----------------------------------------------------------------------------- -translit.ocs_low = { +translit.ocs_low = translit.make_add_dict{ ["а"] = "a", ["б"] = "b", ["в"] = "v", @@ -88,7 +89,7 @@ translit.tables["OCS \\quotation{scientific} transliteration lowercase"] = trans -- Uppercase pre-Peter cyrillic characters -- “scientific transliteration” -- ----------------------------------------------------------------------------- -translit.ocs_upp = { +translit.ocs_upp = translit.make_add_dict{ ["А"] = "A", ["Б"] = "B", ["В"] = "V", @@ -154,7 +155,7 @@ translit.tables["OCS \\quotation{scientific} transliteration uppercase"] = trans -- Lowercase additional pre-Peter cyrillic characters -- “scientific transliteration” -- ---------------------------------------------------------------------------------------- -translit.ocs_add_low = { +translit.ocs_add_low = translit.make_add_dict{ ["ѕ"] = "dz", -- Mapped to ẑ in ISO 9 (Macedonian …) ["ѯ"] = "ks", ["ѱ"] = "ps", @@ -176,7 +177,7 @@ translit.tables["OCS \\quotation{scientific} transliteration additional lowercas -- Uppercase additional pre-Peter cyrillic characters -- “scientific transliteration” -- ---------------------------------------------------------------------------------------- -translit.ocs_add_upp = { +translit.ocs_add_upp = translit.make_add_dict{ ["Ѕ"] = "Dz", ["Ѯ"] = "Ks", ["Ѱ"] = "Ps", @@ -208,27 +209,23 @@ function translit.scientific (mode, text) R("\224\240") * R("\128\191") * R("\128\191") + R("\241\244") * R("\128\191") * R("\128\191") * R("\128\191") - local cyr = {} + local cyr = translit.make_add_dict{} local cyruk, p_cyruk, p_cyr local scientific_parser if mode == "iso9_ocs" or mode == "iso9_ocs_hack" then - environment.loadluafile("trans_tables_iso9.lua") - translit.add_table( cyr, - translit.ru_upp, - translit.ru_low, - translit.ru_old_upp, - translit.ru_old_low, - translit.non_ru_upp, - translit.non_ru_low, - translit.ocs_add_low, - translit.ocs_add_upp - ) + environment.loadluafile("trans_tables_iso9") + cyr = translit.ru_upp + + translit.ru_low + + translit.ru_old_upp + + translit.ru_old_low + + translit.non_ru_upp + + translit.non_ru_low + + translit.ocs_add_low + + translit.ocs_add_upp if mode == "iso9_ocs_hack" then - translit.add_table( cyr, - translit.ru_jer_hack - ) + cyr = cyr + translit.ru_jer_hack end p_cyr = Cs(utfchar) / cyr @@ -241,7 +238,8 @@ function translit.scientific (mode, text) else cyruk = cyruk + P(i) end end - translit.add_table( cyr, translit.ocs_low, translit.ocs_upp ) + + cyr = translit.ocs_low + translit.ocs_upp p_cyruk = Cs(P(cyruk)) / translit.ocs_uk p_cyr = Cs(utfchar) / cyr @@ -250,7 +248,7 @@ function translit.scientific (mode, text) elseif mode == ("ocs_gla") then environment.loadluafile( "trans_tables_glag") - translit.add_table( cyr, translit.ocs_gla_low, translit.ocs_gla_upp ) + cyr = translit.ocs_gla_low + translit.ocs_gla_upp p_cyr = Cs(utfchar) / cyr scientific_parser = Cs((p_cyr + utfchar)^0) end diff --git a/tex/context/third/transliterator/trans_tables_trsc.lua b/tex/context/third/transliterator/trans_tables_trsc.lua index b3061c0..cad3567 100644 --- a/tex/context/third/transliterator/trans_tables_trsc.lua +++ b/tex/context/third/transliterator/trans_tables_trsc.lua @@ -11,7 +11,7 @@ -- Lowercase German simple transcription---first pass -- -------------------------------------------------------- -translit.ru_trsc_low_first = { +translit.ru_trsc_low_first = translit.make_add_dict{ [" е"] = " je", ["ъе"] = "je", ["ье"] = "je", @@ -36,7 +36,7 @@ translit.tables["German transcription first pass lowercase"] = translit.ru_trsc_ -- Uppercase German simple transcription---first pass -- -------------------------------------------------------- -translit.ru_trsc_upp_first = { +translit.ru_trsc_upp_first = translit.make_add_dict{ [" Е"] = " Je", ["Ъe"] = "Je", -- Pedantic, isn't it? ["Ье"] = "Je", @@ -56,7 +56,7 @@ translit.tables["German transcription first pass uppercase"] = translit.ru_trsc_ -- Lowercase German simple transcription -- ------------------------------------------- -translit.ru_trsc_low = { +translit.ru_trsc_low = translit.make_add_dict{ ["а"] = "a", ["б"] = "b", ["в"] = "w", @@ -98,7 +98,7 @@ translit.tables["German transcription second pass lowercase"] = translit.ru_trsc -- Uppercase German simple transcription -- ------------------------------------------- -translit.ru_trsc_upp = { +translit.ru_trsc_upp = translit.make_add_dict{ ["А"] = "A", ["Б"] = "B", ["В"] = "W", @@ -147,7 +147,7 @@ function translit.gen_rules_de() -- Russian vowels as well consonants that were defined earlier. -- The й-rule, VйC -> ViC - translit.ru_trsc_irule = {} + translit.ru_trsc_irule = translit.make_add_dict{} for _, vow in ipairs(translit.ru_vowels) do for _, cons in ipairs(translit.ru_consonants) do local new_ante = vow .. "й" .. cons @@ -177,7 +177,7 @@ function translit.gen_rules_de() translit.tables["German transcription j-rule"] = translit.ru_trsc_jrule -- The с-rule, VсV -> VssV - translit.ru_trsc_srule = {} + translit.ru_trsc_srule = translit.make_add_dict{} for i, vow_1 in ipairs(translit.ru_vowels) do for j, vow_2 in ipairs(translit.ru_vowels) do local new_ante = vow_1 .. "с" .. vow_2 @@ -189,7 +189,7 @@ function translit.gen_rules_de() translit.tables["German transcription s-rule"] = translit.ru_trsc_srule -- The sharp-s-rule, Vсх -> Vßх - translit.ru_trsc_sharpsrule = {} + translit.ru_trsc_sharpsrule = translit.make_add_dict{} for i, vow in ipairs(translit.ru_vowels) do local new_ante = vow .. "сх" local new_post = vow .. "ßх" @@ -199,7 +199,7 @@ function translit.gen_rules_de() translit.tables["German transcription sharp-s-rule"] = translit.ru_trsc_sharpsrule -- The е-rule, Vе -> Vje - translit.ru_trsc_jerule = {} + translit.ru_trsc_jerule = translit.make_add_dict{} for i, vow in ipairs(translit.ru_vowels) do local new_ante = vow .. "е" local new_post = vow .. "je" @@ -211,7 +211,7 @@ function translit.gen_rules_de() -- The ё-rule, Vё -> Vjo -- This should be redundant as [жцчшщ]ё -> o, else ё -> jo . -- Somebody should teach those DUDEN-guys parsimony. - translit.ru_trsc_jorule = {} + translit.ru_trsc_jorule = translit.make_add_dict{} for i, vow in ipairs(translit.ru_vowels) do local new_ante = vow .. "ё" local new_post = vow .. "jo" @@ -226,7 +226,7 @@ end -- Lowercase English simple transcription---first pass -- --------------------------------------------------------- -translit.ru_trsc_en_low_first = { +translit.ru_trsc_en_low_first = translit.make_add_dict{ [" е"] = " ye", ["ъе"] = "ye", ["ье"] = "ye", @@ -240,7 +240,7 @@ translit.tables["English transcription lowercase first pass"] = translit.ru_trsc -- Uppercase English simple transcription---first pass -- --------------------------------------------------------- -translit.ru_trsc_en_upp_first = { +translit.ru_trsc_en_upp_first = translit.make_add_dict{ [" Е"] = " Ye", ["Ъe"] = "Ye", ["Ье"] = "Ye", @@ -252,7 +252,7 @@ translit.tables["English transcription uppercase first pass"] = translit.ru_trsc -- Lowercase English simple transcription -- -------------------------------------------- -translit.ru_trsc_en_low = { +translit.ru_trsc_en_low = translit.make_add_dict{ ["а"] = "a", ["б"] = "b", ["в"] = "v", @@ -294,7 +294,7 @@ translit.tables["English transcription lowercase second pass"] = translit.ru_trs -- Uppercase English simple transcription -- -------------------------------------------- -translit.ru_trsc_en_upp = { +translit.ru_trsc_en_upp = translit.make_add_dict{ ["А"] = "A", ["Б"] = "B", ["В"] = "V", @@ -335,7 +335,7 @@ translit.tables["English transcription uppercase second pass"] = translit.ru_trs function translit.gen_rules_en () -- The english е-rule, Vе -> Vye - translit.ru_trsc_en_jerule = {} + translit.ru_trsc_en_jerule = translit.make_add_dict{} for i, vow in ipairs(translit.ru_vowels) do local new_ante = vow .. "е" local new_post = vow .. "ye" @@ -350,7 +350,7 @@ end -- Lowercase Czech transcription -- ----------------------------------- -translit.ru_trsc_cz_low = { +translit.ru_trsc_cz_low = translit.make_add_dict{ ["а"] = "a", ["б"] = "b", ["в"] = "v", @@ -392,7 +392,7 @@ translit.tables["Czech transcription lowercase"] = translit.ru_trsc_cz_low -- Uppercase Czech transcription -- ----------------------------------- -translit.ru_trsc_cz_upp = { +translit.ru_trsc_cz_upp = translit.make_add_dict{ ["А"] = "A", ["Б"] = "B", ["В"] = "V", @@ -434,7 +434,7 @@ translit.tables["Czech transcription uppercase"] = translit.ru_trsc_cz_upp -- Lowercase Additional Czech Transcription -- ---------------------------------------------- -translit.ru_trsc_cz_add_low = { +translit.ru_trsc_cz_add_low = translit.make_add_dict{ ["ѕ"] = "dz", ["з"] = "z", ["ꙁ"] = "z", @@ -460,7 +460,7 @@ translit.tables["Czech transcription for OCS and pre-1918 lowercase"] = translit -- Uppercase Additional Czech Transcription -- ---------------------------------------------- -translit.ru_trsc_cz_add_upp = { +translit.ru_trsc_cz_add_upp = translit.make_add_dict{ ["Ѕ"] = "Dz", ["З"] = "Z", ["Ꙁ"] = "Z", @@ -500,9 +500,9 @@ function translit.transcript (mode, text) local p_de function tab_subst (s, ...) - local p_tmp, tmp = nil, {} + local p_tmp, tmp = nil, translit.make_add_dict{} for _,tab in ipairs(arg) do - translit.add_table( tmp, tab) + tmp = tmp + tab end p_tmp = addrules(tmp, p_tmp) local fp = Cs((Cs(P(p_tmp) / tmp) + utfchar)^0) @@ -541,16 +541,16 @@ function translit.transcript (mode, text) if mode == "ru_transcript_de_exp" then - local de_low_upp = {} - de_low_upp = translit.add_table( de_low_upp, translit.ru_trsc_upp, translit.ru_trsc_low ) + local de_low_upp = translit.make_add_dict{} + de_low_upp = translit.ru_trsc_upp + translit.ru_trsc_low local twochar - local tworepl = {} + local tworepl = translit.make_add_dict{} twochar = addrules( translit.ru_trsc_low_first, twochar ) twochar = addrules( translit.ru_trsc_upp_first, twochar ) - tworepl = translit.add_table( tworepl, translit.ru_trsc_low_first, translit.ru_trsc_upp_first ) + tworepl = translit.ru_trsc_low_first + translit.ru_trsc_upp_first -- The й-rule, VйC -> ViC local function V_i_C (s) @@ -653,16 +653,16 @@ function translit.transcript (mode, text) elseif mode == "ru_transcript_en_exp" then - local en_low_upp = {} - en_low_upp = translit.add_table(en_low_upp, translit.ru_trsc_en_low, translit.ru_trsc_en_upp) + local en_low_upp = translit.make_add_dict{} + en_low_upp = translit.ru_trsc_en_low + translit.ru_trsc_en_upp local twochar - local tworepl = {} + local tworepl = translit.make_add_dict{} twochar = addrules( translit.ru_trsc_en_low_first, twochar) twochar = addrules( translit.ru_trsc_en_upp_first, twochar) - tworepl = translit.add_table(tworepl, translit.ru_trsc_en_low_first, translit.ru_trsc_en_upp_first) + tworepl = translit.ru_trsc_en_low_first + translit.ru_trsc_en_upp_first -- The е-rule, Vе -> Vye local function V_je (s) |