Skip to content

Commit

Permalink
Fix sorting (see #11130,11131)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieversMartin committed Sep 11, 2021
1 parent 78530d2 commit 644d139
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions muya.lua
Original file line number Diff line number Diff line change
Expand Up @@ -751,55 +751,55 @@ end
function sortletter(s)
local sortorder
if glosslang == 'Guj' then -- Gujarati
sortorder = {["a"] = 1, ["ā"] = 2, ["i"] = 3, ["ī"] = 4,["u"] = 5,
["ū"] = 6, [""] = 7, ["e"] = 8, ["o"] = 9, [""] = 10, ["k"] = 11,
["kh"] = 12, ["g"] = 13, ["gh"] = 14, [""] = 15, ["c"] = 16, ["ch"] = 17,
["j"] = 18, ["jh"] = 19, ["z"] = 20, ["ñ"] = 21, [""] = 22, ["ṭh"] = 23,
[""] = 24, ["ḍh"] = 25, [""] = 26, ["t"] = 27, ["th"] = 28, ["d"] = 29,
["dh"] = 30, ["n"] = 31, ["p"] = 32, ["ph"] = 33, ["f"] = 34, ["b"] = 35,
["bh"] = 36, ["m"] = 37, ["y"] = 38, ["r"] = 39, ["l"] = 40, ["v"] = 41,
["ś"] = 42, [""] = 43,["s"] = 44, ["h"] = 45, [""] = 46, ["1"] = 47,
["2"] = 48, ["3"] = 49, [" "] = 50}
sortorder = {["a"] = 11, ["ā"] = 12, ["i"] = 13, ["ī"] = 14,["u"] = 15,
["ū"] = 16, [""] = 17, ["e"] = 18, ["o"] = 19, [""] = 20, ["k"] = 21,
["kh"] = 22, ["g"] = 23, ["gh"] = 24, [""] = 25, ["c"] = 26, ["ch"] = 27,
["j"] = 28, ["jh"] = 29, ["z"] = 30, ["ñ"] = 31, [""] = 32, ["ṭh"] = 33,
[""] = 34, ["ḍh"] = 35, [""] = 36, ["t"] = 37, ["th"] = 38, ["d"] = 39,
["dh"] = 40, ["n"] = 41, ["p"] = 42, ["ph"] = 43, ["f"] = 44, ["b"] = 45,
["bh"] = 46, ["m"] = 47, ["y"] = 48, ["r"] = 49, ["l"] = 50, ["v"] = 51,
["ś"] = 52, [""] = 53, ["s"] = 54, ["h"] = 55, [""] = 56, ["1"] = 1,
["2"] = 2, ["3"] = 3, [" "] = 60}
elseif glosslang == 'MP' then -- Middle Persian (Pahlavi)
sortorder = {["a"] = 1, ["ā"] = 2, ["b"] = 3, ["c"] = 4, ["d"] = 5,
["e"] = 6, ["ē"] = 7, ["f"] = 8, ["g"] = 9, ["γ"] = 10, ["h"] = 11,
["i"] = 12, ["ī"] = 13, ["j"] = 14, ["k"] = 15, ["l"] = 16, ["m"] = 17,
["n"] = 18, ["o"] = 19, ["ō"] = 20, ["p"] = 21, ["r"] = 22, ["s"] = 23,
["š"] = 24, ["t"] = 25, ["u"] = 26, ["ū"] = 27, ["w"] = 28, ["x"] = 29,
["y"] = 30, ["z"] = 31, ["ž"] = 32, ["1"] = 33, ["2"] = 34, ["3"] = 35,
[" "] = 36}
sortorder = {["a"] = 11, ["ā"] = 12, ["b"] = 13, ["c"] = 14, ["d"] = 15,
["e"] = 16, ["ē"] = 17, ["f"] = 18, ["g"] = 19, ["γ"] = 20, ["h"] = 21,
["i"] = 22, ["ī"] = 23, ["j"] = 24, ["k"] = 25, ["l"] = 26, ["m"] = 27,
["n"] = 28, ["o"] = 29, ["ō"] = 30, ["p"] = 31, ["r"] = 32, ["s"] = 33,
["š"] = 34, ["t"] = 35, ["u"] = 36, ["ū"] = 37, ["w"] = 38, ["x"] = 39,
["y"] = 40, ["z"] = 41, ["ž"] = 42, ["1"] = 1, ["2"] = 2, ["3"] = 3,
[" "] = 50}
elseif glosslang == 'NP' then -- New Persian
sortorder = {["a"] = 1, ["ā"] = 2, ["e"] = 3, ["o"] = 4, ["u"] = 5,
["i"] = 6, ["b"] = 7, ["p"] = 8, ["t"] = 9, [""] = 10, ["j"] = 11,
["č"] = 12, [""] = 13, ["x"] = 14, ["d"] = 15, [""] = 16, ["r"] = 17,
["z"] = 18, ["ž"] = 19, ["s"] = 20, ["š"] = 21, [""] = 22, ["ż"] = 23,
[""] = 24, [""] = 25, ["ʿ"] = 26, [""] = 27, ["f"] = 28, ["q"] = 29,
["k"] = 30, ["g"] = 31, ["l"] = 32, ["m"] = 33, ["n"] = 34, ["w"] = 35,
["h"] = 36, ["y"] = 37, ["1"] = 38, ["2"] = 39, ["3"] = 40, [" "] = 41}
sortorder = {["a"] = 11, ["ā"] = 12, ["e"] = 13, ["o"] = 14, ["u"] = 15,
["i"] = 16, ["b"] = 17, ["p"] = 18, ["t"] = 19, [""] = 20, ["j"] = 21,
["č"] = 22, [""] = 23, ["x"] = 24, ["d"] = 25, [""] = 26, ["r"] = 27,
["z"] = 28, ["ž"] = 29, ["s"] = 30, ["š"] = 31, [""] = 32, ["ż"] = 33,
[""] = 34, [""] = 35, ["ʿ"] = 36, [""] = 37, ["f"] = 38, ["q"] = 39,
["k"] = 40, ["g"] = 41, ["l"] = 42, ["m"] = 43, ["n"] = 44, ["w"] = 45,
["h"] = 46, ["y"] = 47, ["1"] = 2, ["2"] = 2, ["3"] = 3, [" "] = 50}
elseif glosslang == 'Av' then -- Avestan, standard case
sortorder = {["a"] = 1, ["ā"] = 2, ["ā̊ "] = 3, ["ą"] = 4, ["b"] = 5,
["β"] = 6, ["c"] = 7, ["d"] = 8, ["δ"] = 9, ["e"] = 10, ["ē"] = 11,
["ǝ"] = 12, ["ǝ̄"] = 13, -- U+01DD
["ə"] = 12, ["ə̄"] = 13, -- U+0259
["f"] = 14, ["g"] = 15, ["γ"] = 16, ["h"] = 17,
["i"] = 18, ["ī"] = 19, ["j"] = 20, ["k"] = 21, ["m"] = 22, ["n"] = 23,
["ń"] = 24, [""] = 25, ["ŋ"] = 26, ["ŋ́"] = 27, ["ŋv"] = 28, ["o"] = 29,
["ō"] = 30, ["p"] = 31, ["r"] = 32, ["s"] = 33, ["š"] = 34,
["š́ "] = 35, ["ṣ̌"] = 36, ["t"] = 37, [""] = 38, ["ϑ"] = 39, ["θ"] = 39,
["u"] = 40, ["ū"] = 41,
["v"] = 42, ["x"] = 43, [""] = 44, ["xv"] = 45, ["y"] = 46, ["z"] = 47,
["ž"] = 48, ["1"] = 49, ["2"] = 50, ["3"] = 51, [" "] = 52}
sortorder = {["a"] = 11, ["ā"] = 12, ["ā̊ "] = 13, ["ą"] = 14, ["b"] = 15,
["β"] = 16, ["c"] = 17, ["d"] = 18, ["δ"] = 19, ["e"] = 20, ["ē"] = 21,
["ǝ"] = 22, ["ǝ̄"] = 23, -- U+01DD
["ə"] = 22, ["ə̄"] = 23, -- U+0259
["f"] = 24, ["g"] = 25, ["γ"] = 26, ["h"] = 27,
["i"] = 28, ["ī"] = 29, ["j"] = 30, ["k"] = 31, ["m"] = 32, ["n"] = 33,
["ń"] = 34, [""] = 35, ["ŋ"] = 36, ["ŋ́"] = 37, ["ŋv"] = 38, ["o"] = 39,
["ō"] = 40, ["p"] = 41, ["r"] = 42, ["s"] = 43, ["š"] = 44,
["š́ "] = 45, ["ṣ̌"] = 46, ["t"] = 47, [""] = 48, ["ϑ"] = 49, ["θ"] = 49,
["u"] = 50, ["ū"] = 51,
["v"] = 52, ["x"] = 53, [""] = 54, ["xv"] = 55, ["y"] = 56, ["z"] = 57,
["ž"] = 58, ["1"] = 1, ["2"] = 2, ["3"] = 3, [" "] = 60}
elseif glosslang == 'Skt' then -- Sanskrit
sortorder = {["a"] = 1, ["ā"] = 2, ["i"] = 3, ["ī"] = 4, ["u"] = 5,
["ū"] = 6, [""] = 7, ["r̥̄"] = 8, ["e"] = 9, ["ai"] = 10, ["o"] = 11,
["au"] = 12, [""] = 13, [""] = 14, ["k"] = 15, ["kh"] = 16, ["g"] = 17,
["gh"] = 18, [""] = 19, ["c"] = 20, ["ch"] = 21, ["j"] = 22, ["jh"] = 23,
["ñ"] = 24, [""] = 25, ["ṭh"] = 26, [""] = 27, ["ḍh"] = 28, [""] = 29,
["t"] = 30, ["th"] = 31, ["d"] = 32, ["dh"] = 33, ["n"] = 35,
["p"] = 36, ["ph"] = 34, ["b"] = 37, ["bh"] = 38, ["m"] = 39,
["y"] = 40, ["r"] = 41,
["l"] = 42, ["v"] = 43, ["ś"] = 44, [""] = 45, ["s"] = 46, ["h"] = 47,
["1"] = 49, ["2"] = 50, ["3"] = 51, [" "] = 52}
sortorder = {["a"] = 11, ["ā"] = 12, ["i"] = 13, ["ī"] = 14, ["u"] = 15,
["ū"] = 16, [""] = 17, ["r̥̄"] = 18, ["e"] = 19, ["ai"] = 20, ["o"] = 21,
["au"] = 22, [""] = 23, [""] = 24, ["k"] = 25, ["kh"] = 26, ["g"] = 27,
["gh"] = 28, [""] = 29, ["c"] = 30, ["ch"] = 31, ["j"] = 32, ["jh"] = 33,
["ñ"] = 34, [""] = 35, ["ṭh"] = 36, [""] = 37, ["ḍh"] = 38, [""] = 39,
["t"] = 40, ["th"] = 41, ["d"] = 42, ["dh"] = 43, ["n"] = 44,
["p"] = 45, ["ph"] = 46, ["b"] = 47, ["bh"] = 48, ["m"] = 49,
["y"] = 50, ["r"] = 51,
["l"] = 52, ["v"] = 53, ["ś"] = 54, [""] = 55, ["s"] = 56, ["h"] = 57,
["1"] = 1, ["2"] = 2, ["3"] = 3, [" "] = 60}
else
texio.write_nl( "Unknown language for glossary sorting" )
end
Expand Down

0 comments on commit 644d139

Please sign in to comment.