diff options
author | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2010-12-24 16:05:30 +0100 |
---|---|---|
committer | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2010-12-24 16:05:30 +0100 |
commit | 8f57b0ace4826104e586e289d0977b55570f0c8b (patch) | |
tree | 030fbdb090f5efd4c1b626c6c7114508b53e8108 /tex/context/third/transliterator/trans_tables_trsc.lua | |
parent | 26ae25dbea9b066eae665f8aefb2b046ac67d431 (diff) | |
download | transliterator-8f57b0ace4826104e586e289d0977b55570f0c8b.tar.gz |
utf character handling; optimized iso9 parser code
Diffstat (limited to 'tex/context/third/transliterator/trans_tables_trsc.lua')
-rw-r--r-- | tex/context/third/transliterator/trans_tables_trsc.lua | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/tex/context/third/transliterator/trans_tables_trsc.lua b/tex/context/third/transliterator/trans_tables_trsc.lua index 0458539..bdeaf89 100644 --- a/tex/context/third/transliterator/trans_tables_trsc.lua +++ b/tex/context/third/transliterator/trans_tables_trsc.lua @@ -488,7 +488,7 @@ translit.tables["Czech transcription for OCS and pre-1918 uppercase"] = translit function translit.transcript (mode, text) local P, R, S, V, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs local addrules = translit.addrules - local utfchar = lpeg.patterns.utf8char + local utfchar = translit.utfchar local trsc_parser, p_rules, capt, p_de @@ -502,25 +502,10 @@ function translit.transcript (mode, text) return fp:match(s) end - -- The following is needed becaus lpeg.S doesn't work with utf. local vow, con, iy - for _,v in ipairs (translit.ru_vowels) do - if vow == nil then vow = P(v) - else vow = vow + P(v) - end - end - - for _,c in ipairs (translit.ru_consonants) do - if con == nil then con = P(c) - else con = con + P(c) - end - end - - for _,i in ipairs (translit.ru_trsc_iy) do - if iy == nil then iy = P(i) - else iy = iy + P(i) - end - end + vow = addrules(translit.ru_vowels, vow) + con = addrules(translit.ru_consonants, con) + iy = addrules(translit.ru_trsc_iy, iy ) if mode == "ru_transcript_de_exp" then |