From 889ace69482cd1b3e2be4142fe5403922ec226df Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 10 May 2011 12:28:08 +0200 Subject: expanded manual --- tex/context/interface/third/t-transliterator.xml | 3 +++ tex/context/third/transliterator/trans_tables_sr.lua | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'tex') diff --git a/tex/context/interface/third/t-transliterator.xml b/tex/context/interface/third/t-transliterator.xml index b5b189f..f80c48e 100644 --- a/tex/context/interface/third/t-transliterator.xml +++ b/tex/context/interface/third/t-transliterator.xml @@ -17,6 +17,8 @@ + + @@ -28,6 +30,7 @@ + diff --git a/tex/context/third/transliterator/trans_tables_sr.lua b/tex/context/third/transliterator/trans_tables_sr.lua index 9abe5b2..84319b0 100644 --- a/tex/context/third/transliterator/trans_tables_sr.lua +++ b/tex/context/third/transliterator/trans_tables_sr.lua @@ -100,14 +100,16 @@ end local t = translit local function sr (mode, text) - local P, R, S, V, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs + local P, R, Cs = lpeg.P, lpeg.R, lpeg.Cs local utfchar = translit.utfchar - local trl_sr = translit.make_add_dict{} - trl_sr = t[mode.."_upper"] + t[mode.."_lower"] + local trl_sr = translit.make_add_dict{} + trl_sr = t[mode.."_upper"] + t[mode.."_lower"] - local _p_sr = translit.addrules (trl_sr, _p_sr) - local p_sr = Cs((_p_sr / trl_sr + utfchar)^0) + -- transliteration from latin script requires macro handling … + local _p_macro = P[[\]] * R("az", "AZ")^1 + local _p_sr = translit.addrules (trl_sr, _p_sr) + local p_sr = Cs((_p_macro + (_p_sr / trl_sr) + utfchar)^0) return p_sr:match(text) end -- cgit v1.2.3